/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','7201',jdecode('Service'),jdecode(''),'/7201/index.html','true',[ 
		['PAGE','22494',jdecode('Regularly+Scheduled'),jdecode(''),'/7201/22494.html','true',[],'',''],
		['PAGE','25431',jdecode('Office+Relocation'),jdecode(''),'/7201/25431.html','true',[],'',''],
		['PAGE','22515',jdecode('One-Time+Purge'),jdecode(''),'/7201/22515.html','true',[],'',''],
		['PAGE','22557',jdecode('Residential'),jdecode(''),'/7201/22557.html','true',[],'','']
	],'',''],
	['PAGE','46725',jdecode('Upcoming+Shred+Event'),jdecode(''),'/46725.html','true',[],'',''],
	['PAGE','22473',jdecode('What+To+Shred'),jdecode(''),'/22473.html','true',[],'',''],
	['PAGE','22452',jdecode('Why+Shred'),jdecode(''),'/22452/index.html','true',[ 
		['PAGE','22578',jdecode('Corporate+Security'),jdecode(''),'/22452/22578.html','true',[],'',''],
		['PAGE','22599',jdecode('Identity+Theft'),jdecode(''),'/22452/22599.html','true',[],'',''],
		['PAGE','22620',jdecode('It%26%23x27%3Bs+The+Law'),jdecode(''),'/22452/22620.html','true',[],'',''],
		['PAGE','22641',jdecode('Cost+Effectiveness'),jdecode(''),'/22452/22641.html','true',[],'',''],
		['PAGE','22662',jdecode('Internal+Security'),jdecode(''),'/22452/22662.html','true',[],'','']
	],'',''],
	['PAGE','7285',jdecode('About+us'),jdecode(''),'/7285.html','true',[],'',''],
	['PAGE','7264',jdecode('Contact'),jdecode(''),'/7264.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='006666';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='49';
theSitetree.graphicsetId='53';
theSitetree.contentColor='006633';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easy',
				paletteFamily: 	'006666',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'49',
				graphicsetId: 	'53',
				contentColor: 	'006633',
				contentBGColor: 'FFFFFF',
				a_color: 		'006666',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24M']={
webappId:    '5003',
documentId:  '301',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24M',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100518-141604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20090709-182943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22452',
internalId:  '',
customField: '20100518-100903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7264',
internalId:  '',
customField: '20100211-150900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7285',
internalId:  '',
customField: '20100518-101141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22578',
internalId:  '',
customField: '20090709-210208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22473',
internalId:  '',
customField: '20090709-210115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22494',
internalId:  '',
customField: '20090325-230939'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22515',
internalId:  '',
customField: '20090325-230751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22557',
internalId:  '',
customField: '20100518-100619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22599',
internalId:  '',
customField: '20090325-231750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25431',
internalId:  '',
customField: '20090325-230826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22620',
internalId:  '',
customField: '20090325-232144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22641',
internalId:  '',
customField: '20090326-213902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22662',
internalId:  '',
customField: '20090709-183102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46725',
internalId:  '',
customField: '20100721-170309'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN306A';
var companyName   = '360-676-5594+%2F+info%40a-1shred.com';
var htmlTitle	  = 'On-site+Paper+Shredding+and+Document+Destruction+Service';
var metaKeywords  = 'Paper+shredding%2C+Paper+shredding+service%2C+shredding+service%2C+document+shredding%2C+document+destruction+service%2C+data+destruction%2C+mobile+shredding+service%2C+paper+recycling%2C+shredder';
var metaContents  = 'On-site+paper+shredding+and+document+destruction+company+services+Bellingham%2C+Ferndale%2C+Lynden%2C+Blaine%2C+Burlington%2C+Mount+Vernon%2C+Sedro-Woolley%2C+Anacortes+and+Oak+Harbor+';
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();
};
