/* [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','3901',jdecode('Home'),jdecode(''), jdecode('%2F3901.html'), 'true',[],'',''],
	['PAGE','7264',jdecode('Products'),jdecode(''), jdecode('%2F7264%2Findex.html'), 'true',[ 
		['PAGE','7285',jdecode('Process+Controls'),jdecode(''), jdecode('%2F7264%2F7285.html'), 'true',[],'',''],
		['PAGE','7306',jdecode('Heaters'),jdecode(''), jdecode('%2F7264%2F7306.html'), 'true',[],'',''],
		['PAGE','7327',jdecode('Sensors'),jdecode(''), jdecode('%2F7264%2F7327.html'), 'true',[],'',''],
		['PAGE','7348',jdecode('SCR%26%23x27%3Bs+and+Contactors'),jdecode(''), jdecode('%2F7264%2F7348.html'), 'true',[],'',''],
		['PAGE','7369',jdecode('Recorders+and+Data+Acq'),jdecode(''), jdecode('%2F7264%2F7369.html'), 'true',[],'',''],
		['PAGE','7390',jdecode('Actuatos%2C+Motors%2C+Valves'),jdecode(''), jdecode('%2F7264%2F7390.html'), 'true',[],'',''],
		['PAGE','7411',jdecode('Chemical+Compounds'),jdecode(''), jdecode('%2F7264%2F7411.html'), 'true',[],'',''],
		['PAGE','7432',jdecode('Control+Panels+%2F+Systems'),jdecode(''), jdecode('%2F7264%2F7432.html'), 'true',[],'',''],
		['PAGE','7453',jdecode('Technical+Documents'),jdecode(''), jdecode('%2F7264%2F7453.html'), 'true',[],'','']
	],'',''],
	['PAGE','7901',jdecode('Services'),jdecode(''), jdecode('%2F7901%2Findex.html'), 'true',[ 
		['PAGE','7474',jdecode('Calibration'),jdecode(''), jdecode('%2F7901%2F7474.html'), 'true',[],'',''],
		['PAGE','7495',jdecode('Field+Service'),jdecode(''), jdecode('%2F7901%2F7495.html'), 'true',[],'',''],
		['PAGE','7516',jdecode('Repairs'),jdecode(''), jdecode('%2F7901%2F7516.html'), 'true',[],'',''],
		['PAGE','7537',jdecode('System+Design'),jdecode(''), jdecode('%2F7901%2F7537.html'), 'true',[],'','']
	],'',''],
	['PAGE','7201',jdecode('What%26%23x27%3Bs+New%3F'),jdecode(''), jdecode('%2F7201%2Findex.html'), 'true',[ 
		['PAGE','19045',jdecode('Comark'),jdecode(''), jdecode('%2F7201%2F19045.html'), 'true',[],'','']
	],'',''],
	['PAGE','7579',jdecode('Contact'),jdecode(''), jdecode('%2F7579%2Findex.html'), 'true',[ 
		['PAGE','23256',jdecode('Appleton+Location'),jdecode(''), jdecode('%2F7579%2F23256.html'), 'true',[],'',''],
		['PAGE','7558',jdecode('Milwaukee+Location'),jdecode(''), jdecode('%2F7579%2F7558.html'), 'true',[],'',''],
		['PAGE','23277',jdecode('Mineapolis+Location'),jdecode(''), jdecode('%2F7579%2F23277.html'), 'true',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Esoteric';
theSitetree.paletteFamily='3B3B3B';
theSitetree.keyvisualId='5845';
theSitetree.keyvisualName='kv_5845.jpg';
theSitetree.fontsetId='11101';
theSitetree.graphicsetId='11884';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F4F4';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Esoteric',
				paletteFamily: 	'3B3B3B',
				keyvisualId: 	'5845',
				keyvisualName: 	'kv_5845.jpg',
				fontsetId: 		'11101',
				graphicsetId: 	'11884',
				contentColor: 	'000000',
				contentBGColor: 'F5F4F4',
				a_color: 		'DBDBDB',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20110617-151016'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7558',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-7676']={
webappId:    '7008',
documentId:  '7579',
internalId:  '7676',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7558',
internalId:  '',
customField: '20110727-085331'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7579',
internalId:  '',
customField: '20100427-141835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20100427-142207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7264',
internalId:  '',
customField: '20101116-112737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7285',
internalId:  '',
customField: '20110427-111102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100423-132625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7306',
internalId:  '',
customField: '20101021-095921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7327',
internalId:  '',
customField: '20100428-085222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7348',
internalId:  '',
customField: '20100428-085204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7411',
internalId:  '',
customField: '20100427-152350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7390',
internalId:  '',
customField: '20111013-083355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7369',
internalId:  '',
customField: '20100423-182147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7432',
internalId:  '',
customField: '20100427-152504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7453',
internalId:  '',
customField: '20100428-085303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7474',
internalId:  '',
customField: '20100428-085505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7495',
internalId:  '',
customField: '20100428-091421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7516',
internalId:  '',
customField: '20100428-091337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7537',
internalId:  '',
customField: '20100427-150608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19045',
internalId:  '',
customField: '20100505-092527'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '3901',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23256',
internalId:  '',
customField: '20110727-105003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23277',
internalId:  '',
customField: '20110727-090744'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLKQ6';
var companyName   = 'Pyro-matic%2C+Inc.';
var htmlTitle	  = 'Pyro-matic%2C+Inc.+-+Industrial+Process+Controls+and+Engineering';
var metaKeywords  = 'Thermocouple%0D%0AActuator%0D%0APID%0D%0AProcess+Control%0D%0ATemperature+Control%0D%0AFlow%0D%0APressure%0D%0APaperless+Recorders%0D%0AValves%0D%0AHeaters%0D%0ADuct+Heaters%0D%0AExplosionproof+Heaters%0D%0AUL+Panel';
var metaContents  = 'Industrial+Process+Controls+and+Related+Products';
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();
};

