/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','501',jdecode('About+us'),jdecode(''),'/501.html','true',[],''],
	['PAGE','543',jdecode('Products'),jdecode(''),'/543/index.html','true',[ 
		['PAGE','585',jdecode('Drop+Boxes'),jdecode(''),'/543/585.html','true',[],''],
		['PAGE','564',jdecode('Self+Dumping+Hoppers'),jdecode(''),'/543/564.html','true',[],''],
		['PAGE','23001',jdecode('Flatbeds'),jdecode(''),'/543/23001.html','true',[],''],
		['PAGE','606',jdecode('Stacking+Bins'),jdecode(''),'/543/606.html','true',[],''],
		['PAGE','8001',jdecode('Custom+Equipment'),jdecode(''),'/543/8001.html','true',[],''],
		['PAGE','29001',jdecode('WCC+Chain+Roll-off'),jdecode(''),'/543/29001.html','true',[],'']
	],''],
	['PAGE','627',jdecode('Contact'),jdecode(''),'/627/index.html','true',[ 
		['PAGE','669',jdecode('How+to+find+us'),jdecode(''),'/627/669.html','true',[],'']
	],''],
	['PAGE','9001',jdecode('Map'),jdecode(''),'/9001.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='BFD4ED';
theSitetree.keyvisualId='6213';
theSitetree.keyvisualName='kv_6213.jpg';
theSitetree.fontsetId='11093';
theSitetree.graphicsetId='11865';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BFD4ED';
var theTemplate={
				name: 			'Diamond',
				paletteFamily: 	'BFD4ED',
				keyvisualId: 	'6213',
				keyvisualName: 	'kv_6213.jpg',
				fontsetId: 		'11093',
				graphicsetId: 	'11865',
				contentColor: 	'000000',
				contentBGColor: 'BFD4ED',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '543',
internalId:  '',
customField: '20090304-185215'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091216-233950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20090304-185406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '585',
internalId:  '',
customField: '20090304-195826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090304-185031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '564',
internalId:  '',
customField: '20090304-190546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '606',
internalId:  '',
customField: '20081105-224334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090304-190713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '627',
internalId:  '',
customField: '20090304-190741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '669',
internalId:  '',
customField: '20090304-190808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20080924-232644'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20091217-002207'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX35U';
var companyName   = 'Western+Cascade+Container+LLC';
var htmlTitle	  = 'www.westerncascade.net';
var metaKeywords  = 'drop+box%2C+drop+boxes%2C+self+dumping+hopper%2C+self-dumping+hopper%2C+tipper%2C+bin%2C+container%2C+stack+bin%2C+stacking+bin%2C+dust+bin%2C+dust+box%2C+garbage+box%2C+garbage+container%2C+garbage+bin%2C+scrap+box%2C+recycling%2C+recycle%2C+refuse+box%2C+dumpster%2C+material+handling+equipment%2C+dewater%2C+dewatering%2C+de-water%2C+rubbish+bin%2C+roll-off%2C+hooklift%2C+hook-lift%2C+roll+off%2C+rolloff%2C+tipping+hopper%2C+dust+collection%2C+filter+box%2C+recycle+box%2C+dump+box%2C+dumpster%2C+cascade%2C+northwest%2C+nw%2C+solid+waste%2C+trash%2C+waste%2C+solid-waste%2C+equipment';
var metaContents  = 'Distributor+of+quality+material+handling+and+solid+waste+equipment.++From+Drop+Boxes+to+Self-Dumping+Hoppers%2C+we+have+a+wide+variety+of+equipment+to+help+you+better+serve+your+customers.';
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();
};
