/* [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','5001',jdecode('Home'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5073',jdecode('News'),jdecode(''),'/5073.html','true',[],'',''],
	['PAGE','5301',jdecode('Markets'),jdecode(''),'/5301/index.html','true',[ 
		['PAGE','5401',jdecode('Healthcare'),jdecode(''),'/5301/5401.html','true',[],'',''],
		['PAGE','5464',jdecode('Commercial'),jdecode(''),'/5301/5464.html','true',[],'',''],
		['PAGE','5443',jdecode('Industrial'),jdecode(''),'/5301/5443.html','true',[],'',''],
		['PAGE','5422',jdecode('Marine'),jdecode(''),'/5301/5422.html','true',[],'',''],
		['PAGE','5485',jdecode('Residential'),jdecode(''),'/5301/5485.html','true',[],'','']
	],'',''],
	['PAGE','5322',jdecode('Services'),jdecode(''),'/5322/index.html','true',[ 
		['PAGE','5985',jdecode('Power+System+Surveys'),jdecode(''),'/5322/5985.html','true',[],'',''],
		['PAGE','5922',jdecode('Infrared+Thermography'),jdecode(''),'/5322/5922.html','true',[],'',''],
		['PAGE','5964',jdecode('Arc+Flash+Analysis'),jdecode(''),'/5322/5964.html','true',[],'',''],
		['PAGE','5901',jdecode('Isolated+Power+Systems'),jdecode(''),'/5322/5901.html','true',[],'',''],
		['PAGE','8601',jdecode('Ground+System+Testing'),jdecode(''),'/5322/8601.html','true',[],'',''],
		['PAGE','8622',jdecode('Conductive+Floor+Testing'),jdecode(''),'/5322/8622.html','true',[],'',''],
		['PAGE','5943',jdecode('Harbor+%26+Marina+Testing'),jdecode(''),'/5322/5943.html','true',[],'',''],
		['PAGE','13701',jdecode('Project+Management'),jdecode(''),'/5322/13701.html','true',[],'','']
	],'',''],
	['PAGE','7801',jdecode('Products'),jdecode(''),'/7801/index.html','true',[ 
		['PAGE','8901',jdecode('UPS+%2F+Power+Protection'),jdecode(''),'/7801/8901.html','true',[],'',''],
		['PAGE','8985',jdecode('Line+Isolation+Monitors'),jdecode(''),'/7801/8985.html','true',[],'',''],
		['PAGE','9006',jdecode('Protective+Relays'),jdecode(''),'/7801/9006.html','true',[],'',''],
		['PAGE','9027',jdecode('MarinaGuard'),jdecode(''),'/7801/9027.html','true',[],'',''],
		['PAGE','9048',jdecode('IR+Inspection+Windows'),jdecode(''),'/7801/9048.html','true',[],'',''],
		['PAGE','9069',jdecode('Capital+Eqpt+Leases'),jdecode(''),'/7801/9069.html','true',[],'','']
	],'',''],
	['PAGE','5052',jdecode('Contact+Us'),jdecode(''),'/5052.html','true',[],'',''],
	['PAGE','12501',jdecode('Partners'),jdecode(''),'/12501.html','true',[],'',''],
	['PAGE','12522',jdecode('Industry+Links'),jdecode(''),'/12522.html','true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				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:  '5001',
internalId:  '',
customField: '20090112-090310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20090206-160634'
};
webappMappings['7008']=webappMappings['7008-2070']={
webappId:    '7008',
documentId:  '5052',
internalId:  '2070',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20081231-190235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20090111-131723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20090110-134733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20090127-111334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20090111-131654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20090111-131823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20090111-132207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20081231-190749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090209-110019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20090111-190547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5943',
internalId:  '',
customField: '20090110-121434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5964',
internalId:  '',
customField: '20090209-105602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5985',
internalId:  '',
customField: '20090109-150741'
};
webappMappings['1501']=webappMappings['1501-12481463']={
webappId:    '1501',
documentId:  '5001',
internalId:  '12481463',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20081231-191442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20090110-125115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8622',
internalId:  '',
customField: '20090110-115617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20081230-082728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20090111-190400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8985',
internalId:  '',
customField: '20090618-090842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9006',
internalId:  '',
customField: '20090109-164609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9027',
internalId:  '',
customField: '20090109-170116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9048',
internalId:  '',
customField: '20090109-164905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9069',
internalId:  '',
customField: '20090109-165844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12522',
internalId:  '',
customField: '20090111-190501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20090111-113708'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INP28W';
var companyName   = 'POWERSERVE+Inc.';
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();
};
