/* [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','6001',jdecode('Home'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','6052',jdecode('About+us'),jdecode(''), jdecode('%2F6052.html'), 'true',[],'',''],
	['PAGE','6073',jdecode('News'),jdecode(''), jdecode('%2F6073.html'), 'true',[],'',''],
	['PAGE','6199',jdecode('Products'),jdecode(''), jdecode('%2F6199%2Findex.html'), 'true',[ 
		['PAGE','38812',jdecode('Batteries'),jdecode(''), jdecode('%2F6199%2F38812.html'), 'true',[],'',''],
		['PAGE','52175',jdecode('ECO+Safe+Antifreeze'),jdecode(''), jdecode('%2F6199%2F52175.html'), 'true',[],'',''],
		['PAGE','47175',jdecode('MASS+Energy+Storage%2C+Grid+Tie'),jdecode(''), jdecode('%2F6199%2F47175.html'), 'true',[],'',''],
		['PAGE','38833',jdecode('Solar'),jdecode(''), jdecode('%2F6199%2F38833.html'), 'true',[],'',''],
		['PAGE','98675',jdecode('Solar+Thermal'),jdecode(''), jdecode('%2F6199%2F98675.html'), 'true',[],'',''],
		['PAGE','97675',jdecode('Agriculture+Energy+'),jdecode(''), jdecode('%2F6199%2F97675.html'), 'true',[],'',''],
		['PAGE','94675',jdecode('Telecomm+Energy'),jdecode(''), jdecode('%2F6199%2F94675.html'), 'true',[],'',''],
		['PAGE','102375',jdecode('OUTBACK+POWER'),jdecode(''), jdecode('%2F6199%2F102375.html'), 'true',[],'',''],
		['PAGE','103875',jdecode('UNI-Solar'),jdecode(''), jdecode('%2F6199%2F103875.html'), 'true',[],'','']
	],'',''],
	['PAGE','90775',jdecode('Sales'),jdecode(''), jdecode('%2F90775.html'), 'true',[],'',''],
	['PAGE','6157',jdecode('Contact'),jdecode(''), jdecode('%2F6157.html'), 'true',[],'',''],
	['PAGE','36312',jdecode('Jobs'),jdecode(''), jdecode('%2F36312.html'), 'true',[],'',''],
	['PAGE','36333',jdecode('List+of+links'),jdecode(''), jdecode('%2F36333.html'), 'true',[],'',''],
	['PAGE','67175',jdecode('Green+Jobs+for+Veterans'),jdecode(''), jdecode('%2F67175.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2459';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='462';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2459',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'462',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20120123-093824'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6052',
internalId:  '',
customField: '20120123-094245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6073',
internalId:  '',
customField: '20120123-100450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6157',
internalId:  '',
customField: '20120123-095050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38812',
internalId:  '',
customField: '20110607-184638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6199',
internalId:  '',
customField: '20120123-095236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36312',
internalId:  '',
customField: '20120123-101124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36333',
internalId:  '',
customField: '20101221-123612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38833',
internalId:  '',
customField: '20101205-222835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47175',
internalId:  '',
customField: '20110607-184748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52175',
internalId:  '',
customField: '20090723-234922'
};
webappMappings['7008']=webappMappings['7008-17130']={
webappId:    '7008',
documentId:  '67175',
internalId:  '17130',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67175',
internalId:  '',
customField: '20120123-095930'
};
webappMappings['7008']=webappMappings['7008-18636']={
webappId:    '7008',
documentId:  '36312',
internalId:  '18636',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-21481']={
webappId:    '7008',
documentId:  '90775',
internalId:  '21481',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90775',
internalId:  '',
customField: '20110313-160955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94675',
internalId:  '',
customField: '20110223-055613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97675',
internalId:  '',
customField: '20120123-095547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98675',
internalId:  '',
customField: '20111228-194903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102375',
internalId:  '',
customField: '20110313-084615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103875',
internalId:  '',
customField: '20110313-100156'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH556';
var companyName   = 'US+UNITED+ENERGY+SYSTEMS+';
var htmlTitle	  = 'battery%2CEV+%26+Hybrid+Products%2CControl+Systems%2CBatteries+Systems%2CEnergy+Management%2CThermal+Transfer+%2F+Heating+%26+Cooling%2CWind+Energy+Generation%2CSolar+Energy+Generation%2CLithium+Iron+Phosphate%2CLiFePO+4%2CHigh+Energy+Large+Prismatic+Rechargeable+Cells+Batteries%2CE';
var metaKeywords  = 'battery%2CEV+%26+Hybrid+Products%2CControl+Systems%2CBatteries+Systems%2CEnergy+Management%2CThermal+Transfer+%2F+Heating+%26+Cooling%2CWind+Energy+Generation%2CSolar+Energy+Generation%2CLithium+Iron+Phosphate%2CLiFePO+4%2CHigh+Energy+Large+Prismatic+Rechargeable+Cells+Batteries%2Celectric+buses%2Celectric+boat%2Celectric+mower%2Cenergy+audit%2Csolar%2Csolar+thermal%2C+wind+turbine%2C+outback+power%2C++solar+pool+heater%2Coutboard+electric%2C+hybrid+boats%2C+boating%2C+boats';
var metaContents  = 'battery%2CEV+%26+Hybrid+Products%2CControl+Systems%2CBatteries+Systems%2CEnergy+Management%2CThermal+Transfer+%2F+Heating+%26+Cooling%2CWind+Energy+Generation%2CSolar+Energy+Generation%2CLithium+Iron+Phosphate%2CLiFePO+4%2CHigh+Energy+Large+Prismatic+Rechargeable+Cells+Batteries%2Celectric+buses%2Celectric+boat%2Celectric+mower%2C+energy+audit%2Csolar%2Csolar+thermal%2C+wind+turbine%2C+outback+power%2C+solar+pool+heater%2C+outboard+electric%2C+hybrid+boats%2C+boating%2C+boats';
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();
};

