/* [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','601',jdecode('HOME'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','5306',jdecode('DEALERS'),jdecode(''), jdecode('%2F5306.html'), 'true',[],'',''],
	['PAGE','20501',jdecode('Photo+Album'),jdecode(''), jdecode('%2F20501.html'), 'true',[],'',''],
	['PAGE','5432',jdecode('CONTACT+INFO'),jdecode(''), jdecode('%2F5432.html'), 'true',[],'',''],
	['PAGE','5327',jdecode('Information+%26+FAQ'),jdecode(''), jdecode('%2F5327%2Findex.html'), 'true',[ 
		['PAGE','5411',jdecode('FAQ'),jdecode(''), jdecode('%2F5327%2F5411.html'), 'true',[],'',''],
		['PAGE','5348',jdecode('STATUS'),jdecode(''), jdecode('%2F5327%2F5348.html'), 'true',[],'',''],
		['PAGE','5369',jdecode('SPECIAL+PRODUCTS'),jdecode(''), jdecode('%2F5327%2F5369.html'), 'true',[],'',''],
		['PAGE','5390',jdecode('TESTIMONIALS'),jdecode(''), jdecode('%2F5327%2F5390.html'), 'true',[],'',''],
		['PAGE','18901',jdecode('WARRANTY+INFO'),jdecode(''), jdecode('%2F5327%2F18901.html'), 'true',[],'','']
	],'',''],
	['PAGE','5201',jdecode('WHEEL+OPTS.+%26+APPS.'),jdecode(''), jdecode('%2F5201%2Findex.html'), 'true',[ 
		['PAGE','5222',jdecode('OPTIONS'),jdecode(''), jdecode('%2F5201%2F5222.html'), 'true',[],'',''],
		['PAGE','5243',jdecode('WHEEL+APPLICATION'),jdecode(''), jdecode('%2F5201%2F5243.html'), 'true',[],'','']
	],'',''],
	['PAGE','5264',jdecode('VA+PURCHASE'),jdecode(''), jdecode('%2F5264%2Findex.html'), 'true',[ 
		['PAGE','5285',jdecode('VA+PURCHASE'),jdecode(''), jdecode('%2F5264%2F5285.html'), 'true',[],'','']
	],'',''],
	['PAGE','26301',jdecode('Salky+Wheels'),jdecode(''), jdecode('%2F26301.html'), 'true',[],'',''],
	['PAGE','7406',jdecode('Guestbook'),jdecode(''), jdecode('%2F7406%2Findex.html'), 'true',[ 
		['PAGE','7401',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F7406%2F7401.html'), 'false',[],'','']
	],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2411';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='397';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2411',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'397',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-7406aendu0in2cxm']={
webappId:    '1002',
documentId:  '7406',
internalId:  '7406aendu0in2cxm',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090115-084155'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-600b39db770b4c04cc2e201437f4010e']={
webappId:    '7060',
documentId:  '20501',
internalId:  '600b39db770b4c04cc2e201437f4010e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20090114-182613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20090114-182843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5243',
internalId:  '',
customField: '20090114-183001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5264',
internalId:  '',
customField: '20090114-182428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5285',
internalId:  '',
customField: '20080204-090030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5306',
internalId:  '',
customField: '20111115-084025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5327',
internalId:  '',
customField: '20080212-111208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5411',
internalId:  '',
customField: '20080213-093355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5348',
internalId:  '',
customField: '20080406-150620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20080610-003806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5369',
internalId:  '',
customField: '20080229-094950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5390',
internalId:  '',
customField: '20080204-093033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20080610-005150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5432',
internalId:  '',
customField: '20111115-082859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7406',
internalId:  '',
customField: '20080126-081225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20080126-081225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20090114-191525'
};
webappMappings['1501']=webappMappings['1501-9362658']={
webappId:    '1501',
documentId:  '601',
internalId:  '9362658',
customField: '1501'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2CXM';
var companyName   = 'GLANCE+WHEELS+LLC.';
var htmlTitle	  = 'GLANCE+WHEELS.COM';
var metaKeywords  = 'wheelchairwheels%2Cwheels%2CBILLET+WHEELS%2C++MEDICAL+WHEEL+CHAIRS+%2C+SPORTAID+%2C+SPINLIFE+%2C++WHEELS+ALUMINUM%2C+HARNESS+SULKY%2CSULKY+RACING%2C+HORSE+RACING%2CWHEELCHAIR+WHEELS%2CGLANCE%2C+GLANCEWHEELS%2C+WHEELS+GLANCE%2CSALKY+WHEELS%2CBILLET+ALUMINUM+WHEELS%2CBILLET%2CBILLET+WHEELS%2CHarness+Racing';
var metaContents  = 'wheels%2Cwheelchair+wheels+%2CGLANCE+WHEELS+LLC%2C++Sportaid%2C+Spinlife%2C+CARE+MEDICAL%2C+SOUTHWEST+MEDICAL%2C+LASHER%2CGLANCE%2C+WHEELS%2C+WHEELCHAIR+WHEELS%2C+ALUMINUM%2C+ALUMINUM+WHEELCHAIR+WHEELS%2CCOOL+WHEELS%2CSALKY%2C+SALKY+RACING%2CHARNESS+RACING%2CSALKY+WHEELS%2CBILLET+WHEELS%2C+BILLET+WHEEL+CHAIRWHEELS%2C+WHEELS+BILLET%2CBILLET+WHEELS%2C+Harness+Racing';
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();
};

