/* [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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','53',jdecode('Home'),jdecode(''), jdecode('%2F53.html'), 'true',[],'',''],
	['PAGE','20617',jdecode('Contact+Me'),jdecode(''), jdecode('%2F20617.html'), 'true',[],'',''],
	['PAGE','2380',jdecode('Automobiles'),jdecode(''), jdecode('%2F2380.html'), 'true',[],'',''],
	['PAGE','4469',jdecode('Const++Equipment'),jdecode(''), jdecode('%2F4469.html'), 'true',[],'',''],
	['PAGE','17128',jdecode('Cranes+%2F++Booms'),jdecode(''), jdecode('%2F17128.html'), 'true',[],'',''],
	['PAGE','49401',jdecode('Dump+Trucks'),jdecode(''), jdecode('%2F49401.html'), 'true',[],'',''],
	['PAGE','20064',jdecode('+Farm+tractors'),jdecode(''), jdecode('%2F20064.html'), 'true',[],'',''],
	['PAGE','20397',jdecode('Front-Ready-Mix'),jdecode(''), jdecode('%2F20397.html'), 'true',[],'',''],
	['PAGE','3125',jdecode('Read-mix++Trucks'),jdecode(''), jdecode('%2F3125.html'), 'true',[],'',''],
	['PAGE','48601',jdecode('Garbage+Trucks'),jdecode(''), jdecode('%2F48601.html'), 'true',[],'',''],
	['PAGE','47401',jdecode('Pickup+Trucks'),jdecode(''), jdecode('%2F47401.html'), 'true',[],'',''],
	['PAGE','13077',jdecode('Pumps+Trucks'),jdecode(''), jdecode('%2F13077.html'), 'true',[],'',''],
	['PAGE','3107',jdecode('Potpourri++models'),jdecode(''), jdecode('%2F3107.html'), 'true',[],'',''],
	['PAGE','3116',jdecode('+Large+Trucks'),jdecode(''), jdecode('%2F3116.html'), 'true',[],'',''],
	['PAGE','4460',jdecode('LINKS'),jdecode(''), jdecode('%2F4460.html'), 'true',[],'',''],
	['PAGE','19253',jdecode('Client+Logos+'),jdecode(''), jdecode('%2F19253.html'), 'true',[],'',''],
	['PAGE','44501',jdecode('+What++is+my+story'),jdecode(''), jdecode('%2F44501.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Bombay';
theSitetree.paletteFamily='395987';
theSitetree.keyvisualId='7518';
theSitetree.keyvisualName='kv_7518.jpg';
theSitetree.fontsetId='16582';
theSitetree.graphicsetId='12202';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C0B89D';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC241'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bombay',
				paletteFamily: 	'395987',
				keyvisualId: 	'7518',
				keyvisualName: 	'kv_7518.jpg',
				fontsetId: 		'16582',
				graphicsetId: 	'12202',
				contentColor: 	'000000',
				contentBGColor: 'C0B89D',
				a_color: 		'395987',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-233298']={
webappId:    '1501',
documentId:  '53',
internalId:  '233298',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20120113-182106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20120130-175356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3125',
internalId:  '',
customField: '20120128-150727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20397',
internalId:  '',
customField: '20111017-115223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20111130-163021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13077',
internalId:  '',
customField: '20111017-115737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3116',
internalId:  '',
customField: '20120113-181606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17128',
internalId:  '',
customField: '20120114-122441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20064',
internalId:  '',
customField: '20111017-115125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4469',
internalId:  '',
customField: '20120114-130405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44501',
internalId:  '',
customField: '20120115-122400'
};
webappMappings['7008']=webappMappings['7008-10599']={
webappId:    '7008',
documentId:  '20617',
internalId:  '10599',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2380',
internalId:  '',
customField: '20111216-135511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20617',
internalId:  '',
customField: '20120130-180255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47401',
internalId:  '',
customField: '20111130-163105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3107',
internalId:  '',
customField: '20111211-124547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4460',
internalId:  '',
customField: '20101211-094434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19253',
internalId:  '',
customField: '20120115-124133'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3QD';
var companyName   = 'Wooden+Classic+Wheels+custom+wooden+model++replicas';
var htmlTitle	  = 'Wooden+Classic+Wheels+provides+highest+quality+one+of+a+kind+wooden+model+replicas.+++';
var metaKeywords  = 'wooden+model+replicas%2C+wood+replicas+%2C+handmade+wooden++replicas%2Ccars%2C+trucks+%2C+wood+replica+car%2C+collectible+replica+novelty+items+%2C+construction+equipment+models+%2C+collectible+models+%2C+vintage+trucks%2Cexcavators%2Chardwood%2Ccustom+model+replicas%2Cmodels%2C+wooden+models%2C+replica+trash+trucks%2Cgarbage+truck+modesl';
var metaContents  = 'Wooden+Classic+Wheels+provides+highest+quality+one+of+a+kind+wooden+model+replicas.+++';
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();
};

