/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','41201',jdecode('Press+Release%3A'),jdecode(''),'/41201.html','true',[],'',''],
	['PAGE','552',jdecode('About+us'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','573',jdecode('Our+team'),jdecode(''),'/552/573.html','true',[],'','']
	],'',''],
	['PAGE','23101',jdecode('ICE+vs+EV+Chart'),jdecode(''),'/23101.html','true',[],'',''],
	['PAGE','16601',jdecode('Dealership+info'),jdecode(''),'/16601/index.html','true',[ 
		['PAGE','16622',jdecode('Application'),jdecode(''),'/16601/16622.html','true',[],'','']
	],'',''],
	['PAGE','34301',jdecode('SOLAR+Energy'),jdecode(''),'/34301.html','true',[],'',''],
	['PAGE','594',jdecode('Projects'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','22501',jdecode('EV+Calculator'),jdecode(''),'/22501.html','true',[],'',''],
	['PAGE','36201',jdecode('Catalog'),jdecode(''),'/36201/index.html','true',[ 
		['PAGE','36222',jdecode('EV+Components'),jdecode(''),'/36201/36222.html','true',[],'',''],
		['PAGE','36243',jdecode('Solar+Components'),jdecode(''),'/36201/36243.html','true',[],'',''],
		['PAGE','36264',jdecode('Batteries+%26+Systems'),jdecode(''),'/36201/36264.html','true',[],'','']
	],'',''],
	['PAGE','615',jdecode('Products'),jdecode(''),'/615/index.html','true',[ 
		['PAGE','636',jdecode('Car+Kits'),jdecode(''),'/615/636.html','true',[],'',''],
		['PAGE','657',jdecode('Watercraft+Kits'),jdecode(''),'/615/657.html','true',[],'',''],
		['PAGE','678',jdecode('Integrated+Parts'),jdecode(''),'/615/678.html','true',[],'',''],
		['PAGE','7501',jdecode('Hi+Pro+Batteries'),jdecode(''),'/615/7501.html','true',[],'','']
	],'',''],
	['PAGE','699',jdecode('Services'),jdecode(''),'/699.html','true',[],'',''],
	['PAGE','720',jdecode('Employment'),jdecode(''),'/720.html','true',[],'',''],
	['PAGE','825',jdecode('News'),jdecode(''),'/825.html','true',[],'',''],
	['PAGE','39001',jdecode('Tax+Incentives'),jdecode(''),'/39001.html','true',[],'',''],
	['ITEM','48101',jdecode('Contact'),jdecode(''),'http://www.usunitedenergysystems.com/6157.html','true',[],'','_blank'],
	['PAGE','44401',jdecode('Investor+oper'),jdecode(''),'/44401.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Maschine';
theSitetree.paletteFamily='264B41';
theSitetree.keyvisualId='1917';
theSitetree.keyvisualName='industry2.jpg';
theSitetree.fontsetId='321';
theSitetree.graphicsetId='371';
theSitetree.contentColor='90A3A7';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Maschine',
				paletteFamily: 	'264B41',
				keyvisualId: 	'1917',
				keyvisualName: 	'industry2.jpg',
				fontsetId: 		'321',
				graphicsetId: 	'371',
				contentColor: 	'90A3A7',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-922']={
webappId:    '7008',
documentId:  '720',
internalId:  '922',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091214-193754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20081203-074506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20080610-050935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20080711-211714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20080618-102925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20080618-102946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20080927-064714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20080820-141508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20080630-171332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20090329-045020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36222',
internalId:  '',
customField: '20080926-051018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36243',
internalId:  '',
customField: '20080926-051018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36264',
internalId:  '',
customField: '20080926-051018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20080628-111621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20080603-010848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20080603-011458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20080603-011527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20080922-125409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20080804-103858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20090119-000952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '825',
internalId:  '',
customField: '20081231-131117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39001',
internalId:  '',
customField: '20081202-182202'
};
webappMappings['7008']=webappMappings['7008-4391']={
webappId:    '7008',
documentId:  '44401',
internalId:  '4391',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-1015562ffcaf5e926f39b819222fb738']={
webappId:    '7060',
documentId:  '41201',
internalId:  '1015562ffcaf5e926f39b819222fb738',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20090223-135609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20090213-100018'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFXZA';
var companyName   = 'EV+PERFORMANCE+Warehouse';
var htmlTitle	  = '';
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();
};
