/* [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'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','594',jdecode('Products'),jdecode(''),'/594/index.html','true',[ 
		['PAGE','22342',jdecode('Headlight+Restoration'),jdecode(''),'/594/22342.html','true',[],'',''],
		['PAGE','615',jdecode('Repair+Kits'),jdecode(''),'/594/615.html','true',[],'',''],
		['PAGE','657',jdecode('Windshield+Racks'),jdecode(''),'/594/657.html','true',[],'',''],
		['PAGE','10901',jdecode('Rack+Installation'),jdecode(''),'/594/10901.html','true',[],'',''],
		['PAGE','22351',jdecode('VIN+Etch+Kit'),jdecode(''),'/594/22351.html','true',[],'',''],
		['PAGE','23574',jdecode('Glass+Polishing'),jdecode(''),'/594/23574.html','false',[],'','']
	],'',''],
	['PAGE','23583',jdecode('Supplies'),jdecode(''),'/23583/index.html','true',[ 
		['PAGE','24040',jdecode('Windshield+Repair'),jdecode(''),'/23583/24040.html','true',[],'',''],
		['PAGE','24225',jdecode('Windshield+Rack+Supplies'),jdecode(''),'/23583/24225.html','true',[],'',''],
		['PAGE','24049',jdecode('Glass+Polishing'),jdecode(''),'/23583/24049.html','false',[],'','']
	],'',''],
	['PAGE','17701',jdecode('Patents'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','17722',jdecode('MSDS+Sheets'),jdecode(''),'/17722/index.html','true',[ 
		['PAGE','17743',jdecode('Repair+%26+Pit%2FCrack+Resins'),jdecode(''),'/17722/17743.html','true',[],'',''],
		['PAGE','17764',jdecode('Suction+Cup+Lubricant'),jdecode(''),'/17722/17764.html','true',[],'',''],
		['PAGE','17806',jdecode('VIN+Etching+Cream'),jdecode(''),'/17722/17806.html','true',[],'','']
	],'',''],
	['PAGE','23878',jdecode('Warranty+Cards'),jdecode(''),'/23878/index.html','true',[ 
		['PAGE','23887',jdecode('Windshield+Racks'),jdecode(''),'/23878/23887.html','true',[],'',''],
		['PAGE','23896',jdecode('Windshield+Repair+Kits'),jdecode(''),'/23878/23896.html','true',[],'','']
	],'',''],
	['PAGE','720',jdecode('How+to+Find+Us%3F'),jdecode(''),'/720/index.html','true',[ 
		['PAGE','10101',jdecode('How+to+Find+Us%3F+%28follow+up+page%29'),jdecode(''),'/720/10101.html','false',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22351',
internalId:  '',
customField: '20100427-200147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100427-141938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100427-163113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100421-160735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22342',
internalId:  '',
customField: '20100427-195912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100421-171158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20100427-141439'
};
webappMappings['7008']=webappMappings['7008-7749']={
webappId:    '7008',
documentId:  '720',
internalId:  '7749',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23583',
internalId:  '',
customField: '20100427-194452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20100427-154745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17722',
internalId:  '',
customField: '20100427-154959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23878',
internalId:  '',
customField: '20100427-155645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20080126-213359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23574',
internalId:  '',
customField: '20100421-155847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17743',
internalId:  '',
customField: '20080126-213232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17764',
internalId:  '',
customField: '20080126-213029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17806',
internalId:  '',
customField: '20080126-212850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23887',
internalId:  '',
customField: '20100427-155312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23896',
internalId:  '',
customField: '20100427-155312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20070301-192648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24040',
internalId:  '',
customField: '20100427-210727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24049',
internalId:  '',
customField: '20100427-194300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24225',
internalId:  '',
customField: '20100430-123736'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEQMV';
var companyName   = 'Kleer-Vu%E2%84%A2+Windshield+Repair';
var htmlTitle	  = 'Kleer-Vu%C2%99+Racing';
var metaKeywords  = '';
var metaContents  = '';
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();
};
