/* [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','501',jdecode('HOME%2FCONTACT+PAGE'),jdecode(''),'/501/index.html','true',[ 
		['PAGE','6643',jdecode('Q+%26+A+Page+-+BLOG'),jdecode(''),'/501/6643.html','true',[],'','']
	],'',''],
	['PAGE','3601',jdecode('PRODUCT+SECTION'),jdecode(''),'/3601/index.html','true',[ 
		['PAGE','573',jdecode('Dirt+Elimination+Parts'),jdecode(''),'/3601/573.html','true',[],'',''],
		['PAGE','6601',jdecode('Rollers%2C+Pegs%2C+Idlers'),jdecode(''),'/3601/6601.html','true',[],'',''],
		['PAGE','6622',jdecode('Sugar+Beet+Flails'),jdecode(''),'/3601/6622.html','true',[],'','']
	],'',''],
	['PAGE','552',jdecode('ITEMS+of+INTEREST'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','201801',jdecode('DEALER+LOCATOR'),jdecode(''),'/201801.html','true',[],'',''],
	['PAGE','11401',jdecode('ABOUT+PCM+PRODUCTS'),jdecode(''),'/11401.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='86862D';
theSitetree.keyvisualId='1009';
theSitetree.keyvisualName='umzugskarre.jpg';
theSitetree.fontsetId='169';
theSitetree.graphicsetId='196';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'86862D',
				keyvisualId: 	'1009',
				keyvisualName: 	'umzugskarre.jpg',
				fontsetId: 		'169',
				graphicsetId: 	'196',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'86862D',
				c_color: 		'000000',
				d_color: 		'2C331B',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1728']={
webappId:    '7008',
documentId:  '501',
internalId:  '1728',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100528-142306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201801',
internalId:  '',
customField: '20100304-195635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100227-163700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20100224-231323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20100602-175402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100304-195327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100131-181318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100131-172826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20100131-162342'
};
webappMappings['7050']=webappMappings['7050-3779']={
webappId:    '7050',
documentId:  '6643',
internalId:  '3779',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPWK4';
var companyName   = 'Welcome+to+PCM+Products%21';
var htmlTitle	  = 'PCM+Products+-+Staples+and+Menahga%2C+MN+USA';
var metaKeywords  = 'PCM+Products+Menahga+MN%2C+Rubber+Star+Roller%2C+Finger+Rollers%2C+Flail%2C+Beet+Flails%2C+Harvest+Components%2C+Defoliator+Flails%2C+Vintage+Snowmobile+Parts%2C+Menahga%2C+MN%2C+Replacement+Agricultural+Parts%2C+Custom+Molding%2C+Molded%2C+Dirt+Elimination%2C+Bill+Paulson%2C+Manufacturing%2C+Trench+Wheels%2C+Ski-Doo%2C+Boatel%2C+Superior+Chain%2C+Stern+Industries%2C+Stern+Manufacturing';
var metaContents  = 'Star%2C+Rollers%2C+Finger+Roller%2C+Dirt+Elimination%2C+Harvest%2C+Components%2C+Vintage+Snowmobile+Parts%2C+Idler%2C+Rollers%2C+Rib+Grab+Food+Rollers%2C+Acorn+Sizing+Rollers%2C+Ski-Doo+Floor+Mats%2C+Boatel+Grand+Prix+Parts%2C+Reo%2C+Gas%2C+Engine+Grommets%2C+Agricultural+Equipment+Replacement+Parts%2C+Skid+Steer+Attachments.+Menahga+MN%2C+Bill+Paulson+Owner+%28218%29+259-8668';
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();
};
