/* [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 theSitetree=[ 
	['PAGE','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],''],
	['PAGE','1352',jdecode('Allen+-+Bradley'),jdecode(''),'/1352.html','true',[],''],
	['PAGE','5901',jdecode('Foxboro'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','5922',jdecode('Moore+Products'),jdecode(''),'/5922.html','true',[],''],
	['PAGE','10101',jdecode('Rosemount'),jdecode(''),'/10101.html','true',[],''],
	['PAGE','10122',jdecode('Yokogawa'),jdecode(''),'/10122.html','true',[],''],
	['PAGE','10143',jdecode('Sentrol+%28Valmet%29'),jdecode(''),'/10143.html','true',[],''],
	['PAGE','10164',jdecode('Leeds+%26+Northrup'),jdecode(''),'/10164.html','true',[],''],
	['PAGE','5943',jdecode('Misc.+Instruments'),jdecode(''),'/5943.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Commander';
theSitetree.paletteFamily='2B25A2';
theSitetree.keyvisualId='2380';
theSitetree.keyvisualName='computerchips.jpg';
theSitetree.fontsetId='391';
theSitetree.graphicsetId='439';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E0E0E0';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Commander',
				paletteFamily: 	'2B25A2',
				keyvisualId: 	'2380',
				keyvisualName: 	'computerchips.jpg',
				fontsetId: 		'391',
				graphicsetId: 	'439',
				contentColor: 	'000000',
				contentBGColor: 'E0E0E0',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'E0E0E0',
				b_color: 		'5762CA',
				c_color: 		'A1A4D2',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20090621-175138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1352',
internalId:  '',
customField: '20080212-195824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090303-010453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20080213-033843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20080212-200044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10122',
internalId:  '',
customField: '20080212-200336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10143',
internalId:  '',
customField: '20080212-200555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10164',
internalId:  '',
customField: '20080212-200708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5943',
internalId:  '',
customField: '20080212-033525'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ217';
var companyName   = 'Applied+Control+Technology';
var htmlTitle	  = 'New+and+Refurbished+Industrial+Instrumentation+and+Controls';
var metaKeywords  = 'Industrial+Automation%2C+Process+Controls%2C+refurbished%2C+Foxboro%2C+Allen-Bradley%2C+Yokogawa%2C+Rosemount%2C+Moore+Products%2C+Siemens%2C+Moore+Apacs%2C+Swedgelok%2C++Micro+Motion%2C+Sentrol%2C+Valmet%2C+Bently+Nevada%2C+Acromag%2C+Anderson+Greenwood%2C+APC%2C+Bailey%2C+Brandt%2C+Chessel%2C+Dwyer%2C+Fisher%2C+Honeywell%2C+Horiba%2C+Lambda%2C+Leeds++Northrup%2C+Liquid+Solids+Control%2C+Thwing-Albert%2C+Thermo+Environmental%2C+United+Science%2C+1771-A4B%2C+1771-ASB%2C+1785-L40B%2FE%2C+1785-L30BC%2C+1785-LT2A%2C+1771-P4S%2C+1771-IAD%2C+1771-IDC%2C+1771-OAD1771-ODD%2C+1771-IFE%2C+1771-OFE%2C+1756-DRIO%2C+1791-8AC%2C+2706-A21J%2C+2711TC4X%2C+2711-TC1X%2C+RFT+9712+%2CRFT+9739%2C+3300+System%2C+SU2200RMNET%2C+67AFR%2C+760CSA%2C+761CSA%2C+E27R-S3R%2C+62H-4ES%2C+Model+52A%2C+IDP10%2C+IFL10%2C+821GM%2C+823DP%2C+843DP%2C+E69F%2C+E96F%2C+696A%2C+1804-SABA%2C+2803-SABA%2C+13A%2C+15A%2C+SPEC+200%2C+2CDA-SI%2C+2CCA-SA%2C+2AS-I3I%2C+PIR-2000%2C+Cat.440%2C+Cat.442%2C+Cat.448%2C+10970-40%2C+Model+1022%2C+Cat.470%2C+CMF300M355NU%2C+DMS1NL1CSN%2C+Model+352%2C+Model+353%2C+300DCS%2C+13044CA%2C+1151DP%2C+1151GP%2C+IRS6%2C+Evans+Manifold%2C+Model+89SFE';
var metaContents  = 'Applied+Control+Technology+is+a+supplier+of+refurbished+process+control+instrumentation+for+industrial+automation+from+such+manufacturers+as+Allen-Bradley%2C+Foxboro%2C+Siemens%2C+Moore+Products%2C+Rosemount%2C+Micro+Motion%2C+Sentrol+300SG%2C+Valmet%2C+Yokogawa%2C+Bailey%2C+Leeds++Northrup+and+many+others.';
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();
};
