/* [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','9201',jdecode('Home'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','9252',jdecode('Products'),jdecode(''),'/9252.html','true',[],''],
	['PAGE','9273',jdecode('Services'),jdecode(''),'/9273.html','true',[],''],
	['PAGE','9294',jdecode('Contact+Us'),jdecode(''),'/9294.html','true',[],''],
	['PAGE','9315',jdecode('Online+Payment'),jdecode(''),'/9315.html','true',[],'']];
var siteelementCount=5;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='85AB88';
theSitetree.keyvisualId='11163';
theSitetree.keyvisualName='kv_11163.jpg';
theSitetree.fontsetId='32062';
theSitetree.graphicsetId='13880';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Office',
				paletteFamily: 	'85AB88',
				keyvisualId: 	'11163',
				keyvisualName: 	'kv_11163.jpg',
				fontsetId: 		'32062',
				graphicsetId: 	'13880',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20090121-011501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9252',
internalId:  '',
customField: '20090119-150708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9273',
internalId:  '',
customField: '20090121-013940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9294',
internalId:  '',
customField: '20090119-161442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9315',
internalId:  '',
customField: '20090121-013819'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-15058446']={
webappId:    '1501',
documentId:  '9201',
internalId:  '15058446',
customField: '1501'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEV2D';
var companyName   = 'Computer+Specialist';
var htmlTitle	  = 'Computer+Specialist';
var metaKeywords  = 'Computer+Repair%2C+Computer+Troubleshooting%2C+Notebook+repair%2C+Laptop+Repair%2C+Computer+Virus+Removal%2C+Virus+Cleanup%2C+Computer+Networking%2C+Technology+Consulting%2C+Broadband+Setup%2C+Computer+Setup%2C+Computer+Installation%2C+Wireless+Setup%2C+Wireless+Troubleshooting%2C+Printer+Networking%2C+Printer+Setup%2C+Computer%2C+Printer%2C+Laptop%2C+Notebook%2C+DELL%2C+HP%2C+MAC%2C+APPLE%2C+IBM%2C+COMPAQ%2C+Brother%2C+Laser+printer%2C+DSL%2C+IP+Phone%2C+Internet%2C+Satellite%2C+Cable%2C+Cabling%2C+CAT+5%2C+CAT5%2C+Web+Design%2C+Website%2C+Training%2C+Tutoring%2C+Online+Support%2C+Tech+Support%2C+Help%2C+Online+Help';
var metaContents  = 'Our+business+was+established+in+1996%2C+and+we+pride+ourselves+in+providing+customers+with+high-quality+products+and+cutomer+service.+We+thrive+in+customer+satisfaction.Providing+good+service+means+taking+the+time+to+listen.+We+will+work+with+you+every+step+of+the+way+to+make+sure+you+receive+the+services+you+need.+Our+business+is+client-oriented%2C+and+we+maintain+strict+confidentiality.';
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();
};
