/* [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','5439',jdecode('Home'),jdecode(''),'/5439.html','true',[],'',''],
	['PAGE','5490',jdecode('Paint+Services'),jdecode(''),'/5490.html','true',[],'',''],
	['PAGE','6439',jdecode('Body+Work'),jdecode(''),'/6439.html','true',[],'',''],
	['PAGE','5939',jdecode('Parts'),jdecode(''),'/5939.html','true',[],'',''],
	['PAGE','6460',jdecode('Warranty'),jdecode(''),'/6460.html','true',[],'',''],
	['PAGE','11039',jdecode('For+Sale'),jdecode(''),'/11039.html','true',[],'',''],
	['PAGE','6481',jdecode('Insurance+work'),jdecode(''),'/6481.html','true',[],'',''],
	['PAGE','15439',jdecode('Guestbook'),jdecode(''),'/15439.html','true',[],'',''],
	['PAGE','6502',jdecode('Location+Map'),jdecode(''),'/6502.html','true',[],'',''],
	['PAGE','8739',jdecode('hidden+spider'),jdecode(''),'/8739.html','false',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2469';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='459';
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: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2469',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'406',
				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: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5439',
internalId:  '',
customField: '20100910-160432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5490',
internalId:  '',
customField: '20100805-192913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5939',
internalId:  '',
customField: '20100909-153152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6439',
internalId:  '',
customField: '20100805-185421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6460',
internalId:  '',
customField: '20100806-131732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6481',
internalId:  '',
customField: '20100806-130609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6502',
internalId:  '',
customField: '20100812-171727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8739',
internalId:  '',
customField: '20100807-115033'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5439',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11039',
internalId:  '',
customField: '20101216-191454'
};
webappMappings['1002']=webappMappings['1002-15439ahw050inzeka']={
webappId:    '1002',
documentId:  '15439',
internalId:  '15439ahw050inzeka',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15439',
internalId:  '',
customField: '20100811-105747'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZEKA';
var companyName   = 'All+Better+Auto+Painting';
var htmlTitle	  = '';
var metaKeywords  = 'cheap+paint%2C+shitty+paint%2C+maaco%2C+earl+scheib%2C+one-day+auto+paint%2C+sherwin+williams%2C+finishmaster%2C+body+shop%2C+lowest+cost%2C+automotive+paint%2C+du+pont%2C+production+paint%2C+bondo%2C+welding%2C+frame+straightening%2C+collision+repair%2C+car+wreck%2C+tow+truck%2C+metallic+paint%2C+single+stage%2C+acrylic+enamel%2C+paint+booth%2C+primer%2C+masking+tape%2C+fast+paint+job%2C+nason%2C+color+matching%2C+base+coat+clear+coat%2C+car+restoration%2C+tucson+paint+shop%2C+sand+paper%2C+insurance+claim%2C+salvage+title%2C+total+vechical%2C+car+crash%2C+car+repair%2C+window+replacement%2C+insurance+adjuster%2C+buff%2C+mirror%2C+sparkle%2C+shine%2C+last%2C+gloss%2C+durable%2C+thick+flakes%2C+metal%2C+finish%2C+sand%2C+filler%2C+rough%2C+urethane%2C+lacquer%2C+laquer%2C+two+coats%2C+spot%2C+chromabase%2C+ultra+7000%2C+color+match%2C+automotive%2C+parts%2C+custom%2C+antique%2C+graphix%2C+pin+stripe%2C+moulding%2C+tail+lights%2C+wing%2C+spoiler%2C+head+lights%2C+hood%2C+trunk%2C+doors%2C+fenders+quarter+panel%2C+rocker%2C+roof%2C+air+bags%2C+refurbish%2C+air+conditioning%2C+tires+%2C+a%2Fc%2C+ac%2C+bumper%2C+fog+lights%2C+wheels+plastic%2C+fiberglass%2C+show+car%2C+chrome%2C+reinforcement%2C+srs%2C+seat+belts%2C+interrior%2C+exterrior%2C+carpet+seats%2C+color%2C+red%2C+blue%2C+green%2C+purple%2C+orange%2C+black%2C+flat+black%2C+yellow%2C+pink%2C+white%2C+cream%2C+G4%2C+compound%2C+santari%2C+detail%2C+rubber%2C+bed+liner%2C+accesories%2C+polish%2C+smooth%2C+adhesive%2C+flattner%2C+coating%2C+ac+charging%2C+1971+Chevy+truck%2C+1996+mustang%2C+2000+galant%2C+1997+explorer%2C+clark+forklift%2C+rotary+air+compressor%2C+honda%2C+toyota%2C+nissian%2C+ford%2C+earl+scheib%2C+maaco%2C+one+day%2C+911+colision.+dent+busters%2Cbig+sky+auto+body%2C+creative+concepts%2C+desert+enterprises+body+and+frame%2C+formula+1+automotive+arts%2C+frank+johnson+automotive+refininshing%2C+hi-speed+rods+%26+customs%2C+national+auto+collision+centers%2C+precision+auto+body%2C+dan%27s+paint+and+body%2C+smith+martin+autobody%2Cchampion%2C+1+day%2C+jim+click%2C+jim+click+auto+mall+collision%2C+jim+click+automotive%2C+affortable+auto+cosmetics%2C+affordable+auto+painting%2C+all+auto+body+%26+frame%2C+center+attractions%2C+family+auto+body+and+refinishing%2C+holmes+tuttle+collision+center%2C';
var metaContents  = 'Lowest+cost+auto+paint+in+the+country.++Paint+your+car+for+as+little+as+%24149.+We+have+hundreds+of+colors+for+less+than+%24249+to+paint+the+entire+exterrior+of+your+car.++We+do+low+cost++body+work+and+structural+repair.+Come+by+for+a+free+estimate.';
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();
};

