/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var theSitetree=[ 
	['PAGE','5301',jdecode('Home'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','5352',jdecode('Products'),jdecode(''),'/5352.html','true',[],''],
	['PAGE','5373',jdecode('Services'),jdecode(''),'/5373.html','true',[],''],
	['PAGE','5394',jdecode('About+us'),jdecode(''),'/5394/index.html','true',[ 
		['PAGE','5415',jdecode('How+to+find+us'),jdecode(''),'/5394/5415.html','true',[],''],
		['PAGE','5436',jdecode('Our+team'),jdecode(''),'/5394/5436.html','false',[],'']
	],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='757272';
theSitetree.keyvisualId='2415';
theSitetree.keyvisualName='computer.jpg';
theSitetree.fontsetId='399';
theSitetree.graphicsetId='443';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='757272';
var theTemplate={
				name: 			'Amaze',
				paletteFamily: 	'757272',
				keyvisualId: 	'2415',
				keyvisualName: 	'computer.jpg',
				fontsetId: 		'399',
				graphicsetId: 	'443',
				contentColor: 	'FFFFFF',
				contentBGColor: '757272',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'757272',
				b_color: 		'565454',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090115-191853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5352',
internalId:  '',
customField: '20090116-173536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5373',
internalId:  '',
customField: '20090116-173653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5394',
internalId:  '',
customField: '20090116-173214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5415',
internalId:  '',
customField: '20090115-191644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5436',
internalId:  '',
customField: '20090115-191741'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2TY6';
var companyName   = 'ACT+communication+technology';
var htmlTitle	  = '';
var metaKeywords  = 'networking%2C+colorado%2C+denver%2C+boulder%2C+telephone%2C+systems%2C+integration%2C+voip%2C+longmont%2C+metro%2C+cabling%2C+wiring%2C+avaya%2C+hewlett+packard%2C+dell%2C+ibm%2C+nortel%2C+partner%2C+computer%2C+computer+networking%2C+microsoft%2C+server%2C+voice+over+ip%2C+wireless%2C+router%2C+email%2C+internet%2C+qwest%2C+comcast%2C+cbeyond%2C+partner%2C+pc%2C+windows%2C+windows+server%2C+office%2C+fiber%2C+ethernet%2C+consulting%2C+consultant%2C+telecom%2C+phone%2C+long+distance%2C+phone+service%2C+analog%2C+digital%2C+wired%2C+CATV%2C+security+system%2C+security%2C+anti-virus%2C+front+range%2C+networks%2C+data%2C+data+networks%2C+remote+access%2C+citrix%2C+symantec%2C+acer%2C+toshiba%2C+nortel%2C+norstar%2C+office%2C+';
var metaContents  = '+ACT+Communication+Technologies+has+been+formed+to+help+small+business+and+home+users+with+their+communication+technology+needs.+We+offer+support+and+sales+for+telephone+systems%2C+computer+networks+and+connectivity+options+at+reasonable+rates+and+with+superior+service.+Our+objective+is+to+make+it+as+easy+and+seamless+as+possible+all+technology+related+communications+for+the+home+or+small+buisness.+We+offer+only+the+name+brand+systems+and+hardware+with+professional+installation+from+technicaians+that+have+had+years+of+experience+in+the+field.+Our+thourough+pre-consultation+will+insure+that+the+solution+you+purchase+fits+the+needs+of+your+business+or+home.';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

