/* [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','6701',jdecode('Home'),jdecode(''), jdecode('%2F6701.html'), 'true',[],'',''],
	['PAGE','6752',jdecode('Linecard'),jdecode(''), jdecode('%2F6752.html'), 'true',[],'',''],
	['PAGE','15601',jdecode('New+Products'),jdecode(''), jdecode('%2F15601.html'), 'true',[],'',''],
	['PAGE','6773',jdecode('Contact+Us'),jdecode(''), jdecode('%2F6773.html'), 'true',[],'',''],
	['PAGE','19601',jdecode('Jobs'),jdecode(''), jdecode('%2F19601.html'), 'true',[],'',''],
	['PAGE','6794',jdecode('About+us'),jdecode(''), jdecode('%2F6794%2Findex.html'), 'true',[ 
		['PAGE','6815',jdecode('Our+team'),jdecode(''), jdecode('%2F6794%2F6815.html'), 'true',[],'','']
	],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp19-dulles',
  product: 'WSCSYSSSSLYTCPII'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'291',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6752',
internalId:  '',
customField: '20110820-190110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20110820-182352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6773',
internalId:  '',
customField: '20110914-023621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6794',
internalId:  '',
customField: '20110820-184102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6815',
internalId:  '',
customField: '20090708-171331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20110112-180139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20110914-025017'
};
webappMappings['1501']=webappMappings['1501-15598575']={
webappId:    '1501',
documentId:  '6701',
internalId:  '15598575',
customField: '1501'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ17M';
var companyName   = 'Abbott+Associates';
var htmlTitle	  = 'Abbott+Associates';
var metaKeywords  = 'electrical%2C+manufacturer%27s+rep%2C+unistrut%2C+strut%2C+fittings%2C+stainless+steel%2C+RAB%2C+RAB+Lighting%2C+LED+Lighting%2C+LED%2C+cord+grips%2C+wire+mesh+grips%2C+pvc+cement%2C+enclosures%2C+fixture+whips%2C+temp+lighting%2C+HID+fixtures%2C+tube+guards%2C+temp+fixtures%2C+photo+cells%2C+photocontrols%2C+photo+controls%2C+316ss%2C+304ss%2C+conduit+fittings%2C+die+cast+fittings%2C+steel+fittings%2C+emt+fittings%2C+GRC%2C+EMT%2C+NEC%2C+nipples%2C+elbows%2C+couplings%2C+NMLT%2C+ULLT%2C+flexible+conduit%2C+RWA%2C+RWS%2C+unit+heaters%2C+baseboard+heaters%2C+radiant+heaters%2C+heat%2C+wall+heaters%2C+industrial+heating%2C+air+curtains%2C+marley%2C+berko%2C+qmark%2C+leading+edge%2C+plenum+heaters%2C+infrared+heaters%2C+cove+heaters%2C+portable+heaters%2C+maxlite%2C+highmax+lamps%2C+highbay+fixtures%2C+t5%2C+t8%2C+MGM+Transformers%2C+transformers%2C+weatherproof%2C+mulberry+metal%2C+conduit+bodies%2C+condulets%2C+wall+plates%2C+custom+wall+plates%2C+phd%2C+made+in+the+usa%2C+usa+made%2C+box+covers%2C+cfl%2C+cfl+lighting%2C+wall+packs%2C+wallpacks%2C+sensors%2C+stealth+sensors%2C+stealth%2C+wpled10%2C+wpled20%2C+wpled26%2C+hbled13%2C+floodzilla%2C+megaflood%2C+hps%2C+sola+ballast%2C+hid+ballast+kits%2C+ballast%2C+hand+dryers%2C+knipex+tools%2C+epco%2C+engineered+products%2C+fisher+pierce%2C+gibson+stainless%2C+madison+electric+products%2C+cooper+wiring+devices%2C+led+bollards%2C+phd%2C+pipe+hangers%2C+wpled52%2C+eiko%2C+eiko+lamps%2C+customer+service%2C+inside+sales%2C+job+opening%2C+4101+W.+Van+Buren+St.%2C+Phoenix%2C+AZ++85009';
var metaContents  = 'Abbott+Associates+is+a+leading+manufacturer%27s+rep+serving+the+electrical+industry+in+Arizona%2C+Las+Vegas%2C+New+Mexico+%26+El+Paso+Texas.';
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();
};

