/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','48413',jdecode('Repair+shop'),jdecode(''), jdecode('%2F48413.html'), 'true',[],'',''],
	['PAGE','37669',jdecode('Current+Offers'),jdecode(''), jdecode('%2F37669.html'), 'true',[],'',''],
	['PAGE','38042',jdecode('Amsoil++Dealer'),jdecode(''), jdecode('%2F38042.html'), 'true',[],'',''],
	['PAGE','48392',jdecode('Self-help'),jdecode(''), jdecode('%2F48392.html'), 'true',[],'',''],
	['PAGE','32401',jdecode('Contact'),jdecode(''), jdecode('%2F32401%2Findex.html'), 'true',[ 
		['PAGE','35301',jdecode('Contact+%28follow+up+page%29'),jdecode(''), jdecode('%2F32401%2F35301.html'), 'true',[],'','']
	],'',''],
	['PAGE','38118',jdecode('+Motors%2C+Trans'),jdecode(''), jdecode('%2F38118.html'), 'true',[],'',''],
	['PAGE','38985',jdecode('Opening+hours'),jdecode(''), jdecode('%2F38985.html'), 'true',[],'',''],
	['PAGE','56292',jdecode('Organic+Fertilizer'),jdecode(''), jdecode('%2F56292.html'), 'true',[],'',''],
	['PAGE','14001',jdecode('Map'),jdecode(''), jdecode('%2F14001.html'), 'true',[],'',''],
	['PAGE','52192',jdecode('Links'),jdecode(''), jdecode('%2F52192.html'), 'true',[],'',''],
	['PAGE','51392',jdecode('Privacy+Notice'),jdecode(''), jdecode('%2F51392.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2469';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2469',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				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:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48392',
internalId:  '',
customField: '20110618-075321'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '14001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-1105587']={
webappId:    '1501',
documentId:  '2201',
internalId:  '1105587',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48413',
internalId:  '',
customField: '20110501-065745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20120121-184356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37669',
internalId:  '',
customField: '20120110-054250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38042',
internalId:  '',
customField: '20110212-143217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20071012-083143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20081106-214526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20081102-192141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38118',
internalId:  '',
customField: '20100102-221545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38985',
internalId:  '',
customField: '20090212-053453'
};
webappMappings['7008']=webappMappings['7008-8978']={
webappId:    '7008',
documentId:  '32401',
internalId:  '8978',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51392',
internalId:  '',
customField: '20110302-120807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52192',
internalId:  '',
customField: '20110303-140055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56292',
internalId:  '',
customField: '20110501-071856'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INETQL';
var companyName   = 'Dave%27s+Auto+Sevice%2C+Inc.';
var htmlTitle	  = 'Dave%27s+Auto+Service';
var metaKeywords  = 'amsoil%2Cauto+repair%2C+engines%2C+transmissions%2C+brake+repair%2C+suspension%2C+TRANSMISSION+FLUSH%2CCOOLANT+FLUSH%2CORGANIC+FERTILIZER%2CASA%2CIATN';
var metaContents  = 'amsoil%2Cauto+repair%2Cbrake+repair%2C+auto+service%2C+mechanic%2Ccar+repair%2CDIAGNOSTICS%2CORGANIC+FERTILIZER%2CASA%2CIATN';
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();
};

