/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','936',jdecode('Services'),jdecode(''),'/936/index.html','true',[ 
		['PAGE','55701',jdecode('Repair+Estimates'),jdecode(''),'/936/55701.html','true',[],'']
	],''],
	['PAGE','57301',jdecode('Products'),jdecode(''),'/57301/index.html','true',[ 
		['PAGE','57322',jdecode('First+Product'),jdecode(''),'/57301/57322.html','true',[],''],
		['PAGE','57343',jdecode('Second+Product'),jdecode(''),'/57301/57343.html','true',[],''],
		['PAGE','57364',jdecode('Third+Product'),jdecode(''),'/57301/57364.html','true',[],'']
	],''],
	['PAGE','6701',jdecode('Hot+Deals%21'),jdecode(''),'/6701.html','true',[],''],
	['PAGE','957',jdecode('Support'),jdecode(''),'/957/index.html','true',[ 
		['PAGE','57385',jdecode('Download'),jdecode(''),'/957/57385.html','true',[],'']
	],''],
	['PAGE','978',jdecode('Contact'),jdecode(''),'/978/index.html','true',[ 
		['PAGE','15101',jdecode('Map'),jdecode(''),'/978/15101.html','true',[],''],
		['PAGE','17501',jdecode('Driving+directions'),jdecode(''),'/978/17501.html','true',[],'']
	],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Commander';
theSitetree.paletteFamily='2B25A2';
theSitetree.keyvisualId='2380';
theSitetree.keyvisualName='computerchips.jpg';
theSitetree.fontsetId='391';
theSitetree.graphicsetId='439';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E0E0E0';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Commander',
				paletteFamily: 	'2B25A2',
				keyvisualId: 	'2380',
				keyvisualName: 	'computerchips.jpg',
				fontsetId: 		'391',
				graphicsetId: 	'439',
				contentColor: 	'000000',
				contentBGColor: 'E0E0E0',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'E0E0E0',
				b_color: 		'5762CA',
				c_color: 		'A1A4D2',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['4001']=webappMappings['4001-452986']={
webappId:    '4001',
documentId:  '6701',
internalId:  '452986',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15101',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-968537']={
webappId:    '1501',
documentId:  '801',
internalId:  '968537',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20070701-182851'
};
webappMappings['7008']=webappMappings['7008-885']={
webappId:    '7008',
documentId:  '957',
internalId:  '885',
customField: 'language:en;country:US;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '17501',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20080805-005412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55701',
internalId:  '',
customField: '20070701-184408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57301',
internalId:  '',
customField: '20080805-005225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57322',
internalId:  '',
customField: '20080805-002326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57343',
internalId:  '',
customField: '20080805-002326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57364',
internalId:  '',
customField: '20080805-002326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20070109-164156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20070701-181603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20070701-181224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20060814-233904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20060829-000815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57385',
internalId:  '',
customField: '20080805-002326'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INX3EZ';
var companyName   = 'S+%26+S+ELECTRONICS++';
var htmlTitle	  = 'car+audio+repair+centre%2C+subwoofer+reckoning%2C+refurbished+car+audio%2Celectronics+repair';
var metaKeywords  = 'car+amplifier+repair%2C+repairing+car+audio%2C+playstation+modification%2C+solar+pest+repeller%2C+rodent+repeller%2C+raccoon+repellent%2C+dynamo+led+flashlight%2C+2+awg+wiring+kits%2C+0+awg+wing+kits%2C+unlocking+eclipse+esn%2C+eclipse+unlocking+procedure%2C+rockford+fosgate+repair+centre+in+canada%2C++authorized+rockford+fosgate+repair+centre+in+canada%2C++rockford+fosgate+authorized+repair+center%2C+electric+assisted+bicycle%2C+energ%2B+generator%2C+120w+solar+panel%2C+quality+video+surveillance+system%2C+vandal+proof+video+surveillance+';
var metaContents  = 'car+amplifier+repair%2C+repairing+car+audio%2C+playstation+modification%2C+solar+pest+repeller%2C+rodent+repeller%2C+raccoon+repellent%2C+dynamo+led+flashlight%2C+2+awg+wiring+kits%2C+0+awg+wing+kits%2C+unlocking+eclipse+esn%2C+eclipse+unlocking+procedure%2C+rockford+fosgate+repair+centre+in+canada%2C++authorized+rockford+fosgate+repair+centre+in+canada%2C++rockford+fosgate+authorized+repair+center%2C+electric+assisted+bicycle';
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();
};
