/* [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','42',jdecode('Home'),jdecode(''),'/42.html','true',[],'',''],
	['PAGE','335',jdecode('Products'),jdecode(''),'/335/index.html','true',[ 
		['PAGE','344',jdecode('Palletizers'),jdecode(''),'/335/344.html','true',[],'',''],
		['PAGE','353',jdecode('Case+Conveyors'),jdecode(''),'/335/353.html','true',[],'',''],
		['PAGE','362',jdecode('Pallet+Conveyor'),jdecode(''),'/335/362.html','true',[],'',''],
		['PAGE','1479',jdecode('Stretchwrappers'),jdecode(''),'/335/1479.html','true',[],'',''],
		['PAGE','2829',jdecode('Other+Product+Offerings'),jdecode(''),'/335/2829.html','true',[],'',''],
		['PAGE','2817',jdecode('Product+views'),jdecode(''),'/335/2817.html','true',[],'','']
	],'',''],
	['PAGE','371',jdecode('Used+Equipment'),jdecode(''),'/371.html','true',[],'',''],
	['PAGE','389',jdecode('Contact'),jdecode(''),'/389/index.html','true',[ 
		['PAGE','763',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/389/763.html','false',[],'',''],
		['PAGE','398',jdecode('Address'),jdecode(''),'/389/398.html','true',[],'',''],
		['PAGE','926',jdecode('Directions'),jdecode(''),'/389/926.html','true',[],'','']
	],'',''],
	['PAGE','317',jdecode('About+us'),jdecode(''),'/317/index.html','true',[ 
		['PAGE','326',jdecode('Main+Departments'),jdecode(''),'/317/326.html','true',[],'',''],
		['PAGE','1117',jdecode('Customers'),jdecode(''),'/317/1117.html','true',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='F6F6E6';
theSitetree.keyvisualId='2672';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='221';
theSitetree.graphicsetId='260';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F6F6E6';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportive',
				paletteFamily: 	'F6F6E6',
				keyvisualId: 	'2672',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'221',
				graphicsetId: 	'260',
				contentColor: 	'000000',
				contentBGColor: 'F6F6E6',
				a_color: 		'F6F6E6',
				b_color: 		'CCCCC0',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '926',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-1799894']={
webappId:    '1501',
documentId:  '42',
internalId:  '1799894',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-e1376eb9d9f6b19e7a927c0ae6fbf389']={
webappId:    '7060',
documentId:  '2817',
internalId:  'e1376eb9d9f6b19e7a927c0ae6fbf389',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '335',
internalId:  '',
customField: '20071217-203336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20071228-200920'
};
webappMappings['7008']=webappMappings['7008-10237']={
webappId:    '7008',
documentId:  '389',
internalId:  '10237',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN38X3';
var companyName   = 'Material+handling+is+what+we+do%21';
var htmlTitle	  = 'ECS+-+is+your+total+material+handling+solution+provider%21';
var metaKeywords  = 'Palletizer%2C+conveyors%2C+stretch+wrappers%2C+Flexible+conveyor%2C+pallet+conveyor%2C+fall+protection%2C+safety+netting%2C+vonGAL%2C+FKI%2C+Alvey%2C+Columbia%2C+Wulftec%2C+Lantech%2C+Best';
var metaContents  = 'head++++++titleconveyor%2Ftitle++++++meta+name%3Ddescription+content%3Dsupplier+on+conveyor+systems++++++meta+name%3Dkeywords+content%3Dconveyors%2C+belts%2C+gravity%2C+powered%2C+automation++%2Fhead++++';
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();
};

