/* [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','446',jdecode('Home'),jdecode(''),'/446/index.html','true',[ 
		['PAGE','455',jdecode('Automotive+Polishing'),jdecode(''),'/446/455.html','true',[],'',''],
		['PAGE','5801',jdecode('Rim+Polishing'),jdecode(''),'/446/5801.html','true',[],'',''],
		['PAGE','464',jdecode('Motorcycle+Polishing'),jdecode(''),'/446/464.html','true',[],'',''],
		['PAGE','473',jdecode('Furniture+Polishing'),jdecode(''),'/446/473.html','true',[],'',''],
		['PAGE','848',jdecode('Custom+Polishing+'),jdecode(''),'/446/848.html','true',[],'',''],
		['PAGE','7401',jdecode('Semi+Custom+Polishing'),jdecode(''),'/446/7401.html','true',[],'','']
	],'',''],
	['PAGE','20701',jdecode('Polishing+Vs.+Chrome'),jdecode(''),'/20701.html','true',[],'',''],
	['PAGE','34501',jdecode('Polishing+Tips'),jdecode(''),'/34501.html','true',[],'',''],
	['PAGE','8901',jdecode('Industrial%2FMetal+Fab'),jdecode(''),'/8901.html','true',[],'',''],
	['PAGE','10201',jdecode('Finishes+Available'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','54',jdecode('About+Our+Company'),jdecode(''),'/54.html','true',[],'',''],
	['PAGE','428',jdecode('Our+Polishing+Team'),jdecode(''),'/428.html','true',[],'',''],
	['PAGE','482',jdecode('Photo+Album'),jdecode(''),'/482.html','true',[],'',''],
	['PAGE','491',jdecode('Customer+Photos'),jdecode(''),'/491/index.html','true',[ 
		['PAGE','1594',jdecode('The+Bucky+Bike'),jdecode(''),'/491/1594.html','true',[],'',''],
		['PAGE','1755',jdecode('Botanical+Garden'),jdecode(''),'/491/1755.html','true',[],'','']
	],'',''],
	['PAGE','500',jdecode('Contact'),jdecode(''),'/500/index.html','true',[ 
		['PAGE','509',jdecode('How+to+find+us'),jdecode(''),'/500/509.html','true',[],'','']
	],'',''],
	['PAGE','1440',jdecode('Guestbook'),jdecode(''),'/1440/index.html','true',[ 
		['PAGE','1439',jdecode('Read+Guestbook'),jdecode(''),'/1440/1439.html','true',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='51';
theSitetree.graphicsetId='57';
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: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'51',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1003']=webappMappings['1003-ahw050in3qb912609836903']={
webappId:    '1003',
documentId:  '20701',
internalId:  'ahw050in3qb912609836903',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54',
internalId:  '',
customField: '20100607-141620'
};
webappMappings['1002']=webappMappings['1002-1440AHW050IN3QB9']={
webappId:    '1002',
documentId:  '1440',
internalId:  '1440AHW050IN3QB9',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100107-093708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '428',
internalId:  '',
customField: '20100607-141646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '446',
internalId:  '',
customField: '20100607-134150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '455',
internalId:  '',
customField: '20090414-114300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20090422-095745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '464',
internalId:  '',
customField: '20100107-093757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100607-132953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '848',
internalId:  '',
customField: '20100607-133029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '482',
internalId:  '',
customField: '20071030-180725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '491',
internalId:  '',
customField: '20100607-141727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1594',
internalId:  '',
customField: '20071115-192630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1755',
internalId:  '',
customField: '20071115-190705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '500',
internalId:  '',
customField: '20100607-141804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509',
internalId:  '',
customField: '20060217-161546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1440',
internalId:  '',
customField: '20070312-180928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1439',
internalId:  '',
customField: '20070312-180928'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24G']={
webappId:    '5003',
documentId:  '446',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24G',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090319-101029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20100607-141259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100607-133906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20100607-140740'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '446',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3QB9';
var companyName   = 'Oconto+Metal+Finishing';
var htmlTitle	  = 'Oconto+Metal+Finishing';
var metaKeywords  = 'finishing%2C+metal+finishing%2C+custom+polishing%2C+polishing%2C+grinding%2C+buffing%2C+finishing%2C+polished%2C+restore%2C+deburring%2C+chrome%2C+restoration%2C+shiny%2C+polish%2C+mirror+finish%2C+mirror%2C+mirror+polishing%2C+%238+finish%2C+buff%2C+';
var metaContents  = 'Oconto+Metal+Finishing+-+Custom+Polishing';
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();
};
