/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','113333',jdecode('Projects'),jdecode(''), jdecode('%2F113333%2Findex.html'), 'true',[ 
		['PAGE','113342',jdecode('MBR+Railroad+Museum'),jdecode(''), jdecode('%2F113333%2F113342.html'), 'true',[],'','']
	],'',''],
	['PAGE','108458',jdecode('Sure-Seal+Spiral%E2%84%A2'),jdecode(''), jdecode('%2F108458%2Findex.html'), 'true',[ 
		['PAGE','113351',jdecode('Projects'),jdecode(''), jdecode('%2F108458%2F113351.html'), 'true',[],'','']
	],'',''],
	['PAGE','108467',jdecode('Sure-Clamp+Spiral%E2%84%A2'),jdecode(''), jdecode('%2F108467%2Findex.html'), 'true',[ 
		['PAGE','113607',jdecode('Submittals'),jdecode(''), jdecode('%2F108467%2F113607.html'), 'true',[],'','']
	],'',''],
	['PAGE','110120',jdecode('Sure-Clamp+DW+Spiral%E2%84%A2'),jdecode(''), jdecode('%2F110120.html'), 'true',[],'',''],
	['PAGE','108485',jdecode('Sure-Clamp+Take+Off%E2%84%A2'),jdecode(''), jdecode('%2F108485.html'), 'true',[],'',''],
	['PAGE','108476',jdecode('Sure-Flange+Spiral%E2%84%A2'),jdecode(''), jdecode('%2F108476.html'), 'true',[],'',''],
	['PAGE','17122',jdecode('Stainless+Steel+Cladding'),jdecode(''), jdecode('%2F17122.html'), 'true',[],'',''],
	['PAGE','1204',jdecode('Specialty+Work+%2F+Weld'),jdecode(''), jdecode('%2F1204.html'), 'true',[],'',''],
	['PAGE','27701',jdecode('Welded+Duct+%2F+Fittings'),jdecode(''), jdecode('%2F27701%2Findex.html'), 'true',[ 
		['PAGE','27722',jdecode('Galvanized'),jdecode(''), jdecode('%2F27701%2F27722.html'), 'true',[],'',''],
		['PAGE','27743',jdecode('Carbon+Steel'),jdecode(''), jdecode('%2F27701%2F27743.html'), 'true',[],'',''],
		['PAGE','27764',jdecode('Stainless+Steel'),jdecode(''), jdecode('%2F27701%2F27764.html'), 'true',[],'',''],
		['PAGE','27785',jdecode('Aluminum'),jdecode(''), jdecode('%2F27701%2F27785.html'), 'true',[],'','']
	],'',''],
	['PAGE','952',jdecode('Spiral+%2F+Round+Ductwork'),jdecode(''), jdecode('%2F952%2Findex.html'), 'true',[ 
		['PAGE','973',jdecode('Galvanized%2FGalvanneal'),jdecode(''), jdecode('%2F952%2F973.html'), 'true',[],'',''],
		['PAGE','994',jdecode('Stainless+Steel'),jdecode(''), jdecode('%2F952%2F994.html'), 'true',[],'',''],
		['PAGE','1015',jdecode('Aluminum'),jdecode(''), jdecode('%2F952%2F1015.html'), 'true',[],'',''],
		['PAGE','5701',jdecode('PCD+%2F+Underground'),jdecode(''), jdecode('%2F952%2F5701.html'), 'true',[],'','']
	],'',''],
	['PAGE','1036',jdecode('Rectangular+Ductwork'),jdecode(''), jdecode('%2F1036%2Findex.html'), 'true',[ 
		['PAGE','1057',jdecode('Galvanized%2FGalvanneal'),jdecode(''), jdecode('%2F1036%2F1057.html'), 'true',[],'',''],
		['PAGE','1078',jdecode('Stainless+Steel'),jdecode(''), jdecode('%2F1036%2F1078.html'), 'true',[],'',''],
		['PAGE','1099',jdecode('Aluminum'),jdecode(''), jdecode('%2F1036%2F1099.html'), 'true',[],'',''],
		['PAGE','5722',jdecode('PCD+%2F+Underground'),jdecode(''), jdecode('%2F1036%2F5722.html'), 'true',[],'','']
	],'',''],
	['PAGE','1162',jdecode('Oval+Duct+%2F+Fittings'),jdecode(''), jdecode('%2F1162.html'), 'true',[],'',''],
	['PAGE','1183',jdecode('Double+Wall+Ductwork'),jdecode(''), jdecode('%2F1183.html'), 'true',[],'',''],
	['PAGE','1225',jdecode('Catalog'),jdecode(''), jdecode('%2F1225.html'), 'true',[],'',''],
	['PAGE','1246',jdecode('Our+Facility+%2F+Directions'),jdecode(''), jdecode('%2F1246%2Findex.html'), 'true',[ 
		['PAGE','36401',jdecode('Automated+Processes'),jdecode(''), jdecode('%2F1246%2F36401.html'), 'true',[],'','']
	],'','']];
var siteelementCount=32;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='DCDEDC';
theSitetree.keyvisualId='6250';
theSitetree.keyvisualName='kv_6250.jpg';
theSitetree.fontsetId='11090';
theSitetree.graphicsetId='11861';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='DCDEDC';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'DCDEDC',
				keyvisualId: 	'6250',
				keyvisualName: 	'kv_6250.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11861',
				contentColor: 	'000000',
				contentBGColor: 'DCDEDC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20120116-092552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20110622-134651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17122',
internalId:  '',
customField: '20090608-121450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20110707-091300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20080530-111915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27722',
internalId:  '',
customField: '20090608-123855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27743',
internalId:  '',
customField: '20090608-124209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27764',
internalId:  '',
customField: '20090608-125124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27785',
internalId:  '',
customField: '20090608-125249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20110622-141921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20101230-125512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20090615-142246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20090609-071027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20110707-084338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20110622-141910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20090615-141914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20101230-133233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20090609-072029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20090916-091624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1162',
internalId:  '',
customField: '20110622-134651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1225',
internalId:  '',
customField: '20110126-121611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20090609-075257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36401',
internalId:  '',
customField: '20090416-132802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108458',
internalId:  '',
customField: '20120116-092821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108467',
internalId:  '',
customField: '20120116-093054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108476',
internalId:  '',
customField: '20110126-120617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108485',
internalId:  '',
customField: '20110126-120702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110120',
internalId:  '',
customField: '20110126-120927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113607',
internalId:  '',
customField: '20111213-083435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113351',
internalId:  '',
customField: '20110622-122032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113333',
internalId:  '',
customField: '20110622-121124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113342',
internalId:  '',
customField: '20110622-121906'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSY9';
var companyName   = 'Langdon+Sheet+Metal';
var htmlTitle	  = 'Langdon+Sheetmetal';
var metaKeywords  = 'sure%0D%0Aseal%0D%0Asure+seal%0D%0Asure+seal+ductwork%0D%0Anordfab%0D%0Alindab%0D%0Auni%0D%0Agasket%0D%0Auni-gasket%0D%0Aunited+mcgill%0D%0Asemco%0D%0Asafe+spiral%0D%0A';
var metaContents  = 'Sheet+Metal+ductwork+manufacturer.';
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();
};

