/* [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','1801',jdecode('Home'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','14701',jdecode('+PAINTED+BODIES+FOR+SALE'),jdecode(''), jdecode('%2F14701.html'), 'true',[],'',''],
	['PAGE','223579',jdecode('More+Painted+bodies'),jdecode(''), jdecode('%2F223579.html'), 'true',[],'',''],
	['PAGE','199779',jdecode('PROMOD+BODIES-PAINTED+FOR+SALE'),jdecode(''), jdecode('%2F199779.html'), 'true',[],'',''],
	['PAGE','5622',jdecode('+STYRENE+BODIES+UNPAINTED+NEW'),jdecode(''), jdecode('%2F5622.html'), 'true',[],'',''],
	['PAGE','159168',jdecode('ALTERED+BODIES+UNPAINTED+NEW'),jdecode(''), jdecode('%2F159168.html'), 'true',[],'',''],
	['PAGE','159968',jdecode('TOP+FUEL+RAIL+BODIES-+UNPAINTED+-+NEW'),jdecode(''), jdecode('%2F159968.html'), 'true',[],'',''],
	['PAGE','163268',jdecode('DRAG+BIKES+-UNPAINTED+-NEW'),jdecode(''), jdecode('%2F163268.html'), 'true',[],'',''],
	['PAGE','86613',jdecode('OTHER+BODIES+-UNPAINTED+-NEW'),jdecode(''), jdecode('%2F86613.html'), 'true',[],'',''],
	['PAGE','7101',jdecode('COMPLETE+CARS+FOR+SALE'),jdecode(''), jdecode('%2F7101.html'), 'true',[],'',''],
	['PAGE','198879',jdecode('Open+Motor+Cars+for+sale'),jdecode(''), jdecode('%2F198879.html'), 'true',[],'',''],
	['PAGE','204879',jdecode('Used+Cars+for+Sale'),jdecode(''), jdecode('%2F204879.html'), 'true',[],'',''],
	['PAGE','8301',jdecode('Tires+%2F+Wheels'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'',''],
	['PAGE','93613',jdecode('CHassis+kits+'),jdecode(''), jdecode('%2F93613.html'), 'true',[],'',''],
	['PAGE','101013',jdecode('Drag+Motors'),jdecode(''), jdecode('%2F101013.html'), 'true',[],'',''],
	['PAGE','18201',jdecode('1%2F24++Engines'),jdecode(''), jdecode('%2F18201.html'), 'true',[],'',''],
	['PAGE','18222',jdecode('+Scoops+%26+Wings'),jdecode(''), jdecode('%2F18222.html'), 'true',[],'',''],
	['PAGE','28201',jdecode('Hoods+-+Grills'),jdecode(''), jdecode('%2F28201.html'), 'true',[],'',''],
	['PAGE','36201',jdecode('Interiors'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'',''],
	['PAGE','20401',jdecode('+resin+-+engine+parts'),jdecode(''), jdecode('%2F20401.html'), 'true',[],'',''],
	['PAGE','110013',jdecode('Accessaries'),jdecode(''), jdecode('%2F110013.html'), 'true',[],'',''],
	['PAGE','28222',jdecode('Race+Winners'),jdecode(''), jdecode('%2F28222.html'), 'true',[],'',''],
	['PAGE','36222',jdecode('Customer+paint+jobs-send+in'),jdecode(''), jdecode('%2F36222.html'), 'true',[],'',''],
	['PAGE','18243',jdecode('Photo+Album'),jdecode(''), jdecode('%2F18243.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Contact'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','238779',jdecode('payment+'),jdecode(''), jdecode('%2F238779.html'), 'true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Elegant';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32899';
theSitetree.graphicsetId='13971';
theSitetree.contentColor='cab397';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Elegant',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32899',
				graphicsetId: 	'13971',
				contentColor: 	'cab397',
				contentBGColor: '000000',
				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:  '1801',
internalId:  '',
customField: '20111005-094250'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20110910-084344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20111108-060927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20120129-071605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20091124-225332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20120129-072301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20101022-095202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20401',
internalId:  '',
customField: '20100129-102942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18222',
internalId:  '',
customField: '20110907-103431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18243',
internalId:  '',
customField: '20111130-102349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20090701-095403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28222',
internalId:  '',
customField: '20100813-105802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20110417-084408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36222',
internalId:  '',
customField: '20110305-090315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110013',
internalId:  '',
customField: '20091114-230245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159168',
internalId:  '',
customField: '20101014-164715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86613',
internalId:  '',
customField: '20110503-120852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93613',
internalId:  '',
customField: '20100712-145146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101013',
internalId:  '',
customField: '20101006-092335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159968',
internalId:  '',
customField: '20101014-164749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163268',
internalId:  '',
customField: '20110505-113301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '198879',
internalId:  '',
customField: '20110223-114625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '199779',
internalId:  '',
customField: '20110924-084758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204879',
internalId:  '',
customField: '20111108-061127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223579',
internalId:  '',
customField: '20120104-100830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '238779',
internalId:  '',
customField: '20111025-095632'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH4OC';
var companyName   = 'coachman281';
var htmlTitle	  = 'Slot+Car+Drags+1%2F24';
var metaKeywords  = '';
var metaContents  = '';
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();
};

