/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],''],
	['PAGE','108458',jdecode('Sure-Seal+Spiral%E2%84%A2'),jdecode(''),'/108458.html','true',[],''],
	['PAGE','108467',jdecode('Sure-Clamp+Spiral%E2%84%A2'),jdecode(''),'/108467.html','true',[],''],
	['PAGE','110120',jdecode('Sure-Clamp+Double+Wall+Spiral%E2%84%A2'),jdecode(''),'/110120.html','true',[],''],
	['PAGE','108485',jdecode('Sure-Clamp+Take+Off%E2%84%A2'),jdecode(''),'/108485.html','true',[],''],
	['PAGE','108476',jdecode('Sure-Flange+Spiral%E2%84%A2'),jdecode(''),'/108476.html','true',[],''],
	['PAGE','17122',jdecode('Stainless+Steel+Cladding'),jdecode(''),'/17122.html','true',[],''],
	['PAGE','1204',jdecode('Specialty+Work+%2F+Weld'),jdecode(''),'/1204.html','true',[],''],
	['PAGE','27701',jdecode('Welded+Duct+%2F+Fittings'),jdecode(''),'/27701/index.html','true',[ 
		['PAGE','27722',jdecode('Galvanized'),jdecode(''),'/27701/27722.html','true',[],''],
		['PAGE','27743',jdecode('Carbon+Steel'),jdecode(''),'/27701/27743.html','true',[],''],
		['PAGE','27764',jdecode('Stainless+Steel'),jdecode(''),'/27701/27764.html','true',[],''],
		['PAGE','27785',jdecode('Aluminum'),jdecode(''),'/27701/27785.html','true',[],'']
	],''],
	['PAGE','952',jdecode('Spiral+%2F+Round+Ductwork'),jdecode(''),'/952/index.html','true',[ 
		['PAGE','973',jdecode('Galvanized%2FGalvanneal'),jdecode(''),'/952/973.html','true',[],''],
		['PAGE','994',jdecode('Stainless+Steel'),jdecode(''),'/952/994.html','true',[],''],
		['PAGE','1015',jdecode('Aluminum'),jdecode(''),'/952/1015.html','true',[],''],
		['PAGE','5701',jdecode('PCD+%2F+Underground'),jdecode(''),'/952/5701.html','true',[],''],
		['PAGE','110218',jdecode('Specifications'),jdecode(''),'/952/110218.html','true',[],'']
	],''],
	['PAGE','1036',jdecode('Rectangular+Ductwork'),jdecode(''),'/1036/index.html','true',[ 
		['PAGE','1057',jdecode('Galvanized%2FGalvanneal'),jdecode(''),'/1036/1057.html','true',[],''],
		['PAGE','1078',jdecode('Stainless+Steel'),jdecode(''),'/1036/1078.html','true',[],''],
		['PAGE','1099',jdecode('Aluminum'),jdecode(''),'/1036/1099.html','true',[],''],
		['PAGE','5722',jdecode('PCD+%2F+Underground'),jdecode(''),'/1036/5722.html','true',[],''],
		['PAGE','110227',jdecode('Specifications'),jdecode(''),'/1036/110227.html','true',[],'']
	],''],
	['PAGE','1162',jdecode('Oval+Duct+%2F+Fittings'),jdecode(''),'/1162/index.html','true',[ 
		['PAGE','110236',jdecode('Specifications'),jdecode(''),'/1162/110236.html','true',[],'']
	],''],
	['PAGE','1183',jdecode('Double+Wall+Ductwork'),jdecode(''),'/1183/index.html','true',[ 
		['PAGE','110245',jdecode('Specifications'),jdecode(''),'/1183/110245.html','true',[],'']
	],''],
	['PAGE','1225',jdecode('Catalog'),jdecode(''),'/1225.html','true',[],''],
	['PAGE','1246',jdecode('Our+Facility+%2F+Directions'),jdecode(''),'/1246/index.html','true',[ 
		['PAGE','36401',jdecode('Automated+Processes'),jdecode(''),'/1246/36401.html','true',[],'']
	],'']];
var siteelementCount=32;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4D4CD2';
theSitetree.keyvisualId='594';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='124';
theSitetree.graphicsetId='140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Kreis',
				paletteFamily: 	'4D4CD2',
				keyvisualId: 	'594',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'124',
				graphicsetId: 	'140',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'4D4CD2',
				b_color: 		'7794F8',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-7103']={
webappId:    '1501',
documentId:  '901',
internalId:  '7103',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20090211-143749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20090609-074257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17122',
internalId:  '',
customField: '20090608-121450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20091006-140732'
};
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: '20090615-140833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20090615-141412'
};
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: '20090922-072950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20090604-103518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20090615-141914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20090609-071926'
};
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: '20090609-073213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1225',
internalId:  '',
customField: '20090611-133121'
};
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: '20090922-075326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108467',
internalId:  '',
customField: '20100216-102736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108476',
internalId:  '',
customField: '20090609-065614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108485',
internalId:  '',
customField: '20090609-065559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110120',
internalId:  '',
customField: '20090609-065543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110236',
internalId:  '',
customField: '20090604-100934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110218',
internalId:  '',
customField: '20090604-100641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110227',
internalId:  '',
customField: '20090604-100836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110245',
internalId:  '',
customField: '20090604-112015'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSY9';
var companyName   = 'Langdon+Sheet+Metal';
var htmlTitle	  = 'Langdon+Sheetmetal';
var metaKeywords  = '';
var metaContents  = 'Nordfab';
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();
};
