/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','27312',jdecode('Online+Store'),jdecode(''),'/27312.html','true',[],''],
	['PAGE','11812',jdecode('Contact+Us'),jdecode(''),'/11812.html','true',[],''],
	['PAGE','11833',jdecode('About+Us'),jdecode(''),'/11833/index.html','true',[ 
		['PAGE','18912',jdecode('History'),jdecode(''),'/11833/18912.html','true',[],''],
		['PAGE','18933',jdecode('How+to+find+us'),jdecode(''),'/11833/18933.html','true',[],'']
	],''],
	['PAGE','12312',jdecode('Product+lines'),jdecode(''),'/12312/index.html','true',[ 
		['PAGE','12417',jdecode('Bed+Covers'),jdecode(''),'/12312/12417.html','true',[],''],
		['PAGE','12354',jdecode('Nerf+Bars'),jdecode(''),'/12312/12354.html','true',[],''],
		['PAGE','12333',jdecode('Suspension'),jdecode(''),'/12312/12333.html','true',[],''],
		['PAGE','12375',jdecode('Tires'),jdecode(''),'/12312/12375.html','true',[],''],
		['PAGE','12396',jdecode('Wheels'),jdecode(''),'/12312/12396.html','true',[],''],
		['PAGE','22712',jdecode('Winches'),jdecode(''),'/12312/22712.html','true',[],'']
	],''],
	['PAGE','2252',jdecode('Customer+Rides'),jdecode(''),'/2252.html','true',[],''],
	['PAGE','18954',jdecode('Links'),jdecode(''),'/18954.html','true',[],''],
	['PAGE','24712',jdecode('Helpful+tools'),jdecode(''),'/24712.html','true',[],''],
	['PAGE','24733',jdecode('Show+schedule'),jdecode(''),'/24733.html','true',[],''],
	['PAGE','31212',jdecode('Club+Links'),jdecode(''),'/31212.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='C239A1';
theSitetree.keyvisualId='8817';
theSitetree.keyvisualName='KV_03.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12652';
theSitetree.contentColor='FFBEEF';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Holz',
				paletteFamily: 	'C239A1',
				keyvisualId: 	'8817',
				keyvisualName: 	'KV_03.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12652',
				contentColor: 	'FFBEEF',
				contentBGColor: '262626',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'C039A3',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20091206-221117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20090610-233401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27312',
internalId:  '',
customField: '20090115-001218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11812',
internalId:  '',
customField: '20090608-205619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11833',
internalId:  '',
customField: '20090608-205833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12333',
internalId:  '',
customField: '20090120-104030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12312',
internalId:  '',
customField: '20090120-103926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12354',
internalId:  '',
customField: '20090120-104012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12375',
internalId:  '',
customField: '20090629-205203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12396',
internalId:  '',
customField: '20090629-205848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12417',
internalId:  '',
customField: '20090120-103950'
};
webappMappings['1501']=webappMappings['1501-14788234']={
webappId:    '1501',
documentId:  '2201',
internalId:  '14788234',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18912',
internalId:  '',
customField: '20090109-154502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18933',
internalId:  '',
customField: '20090110-102524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18954',
internalId:  '',
customField: '20090120-104156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24712',
internalId:  '',
customField: '20090120-104215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24733',
internalId:  '',
customField: '20090218-160809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22712',
internalId:  '',
customField: '20090120-104128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31212',
internalId:  '',
customField: '20090411-204031'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEET0';
var companyName   = 'Truck+Stuff+And+More';
var htmlTitle	  = 'Truck+Stuff+And+More%2C+Bellefonte%2C+PA';
var metaKeywords  = 'jeep%2Cjeep+parts%2Cjeep+wrangler%2Cjeep+unlimited%2Cjeeps%2Cjeep+accessories%2Cjeep+cherokee%2Coff+road+tires%2Cjeep+rubicon%2Coff+road%2Cjeep+grand+cherokee%2Cwinch%2C4x4+parts%2Cjeep+wrangler+accessories%2Cjeep+wrangler+parts%2Cjeep+cherokee+parts%2Cjeep+accesories%2Cjeep+tops%2Cjeep+cj%2Cjeep+engines%2Cjeep+bumpers%2Coff+road+parts%2Ctruck+accessories%2Clift+kits%2Ccentre+county%2Cpa%2Cbellefonte%2Ccentral+pa%2Cstate+college%2Cpenn+state';
var metaContents  = 'Central+PAs+Jeep%2C+truck+and+SUV+accessory+headquarters%21+From+mud+to+rocks+to+show+and+shine+we+got+you+covered%21';
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();
};
