/* [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','5201',jdecode('Home'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','10864',jdecode('Services+Offered'),jdecode(''), jdecode('%2F10864.html'), 'true',[],'',''],
	['PAGE','10927',jdecode('Towing'),jdecode(''), jdecode('%2F10927.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('Location+and+Directions'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','29912',jdecode('Contact'),jdecode(''), jdecode('%2F29912.html'), 'true',[],'',''],
	['PAGE','17601',jdecode('Drop-Off+Form'),jdecode(''), jdecode('%2F17601.html'), 'true',[],'',''],
	['PAGE','10843',jdecode('Labor+Rates'),jdecode(''), jdecode('%2F10843.html'), 'true',[],'',''],
	['PAGE','10801',jdecode('Hours'),jdecode(''), jdecode('%2F10801.html'), 'true',[],'',''],
	['PAGE','10948',jdecode('Warranty+Information'),jdecode(''), jdecode('%2F10948.html'), 'true',[],'',''],
	['PAGE','10990',jdecode('About+Us'),jdecode(''), jdecode('%2F10990.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='330099';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='475';
theSitetree.contentColor='006633';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Card',
				paletteFamily: 	'330099',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'475',
				contentColor: 	'006633',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100126-163538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10864',
internalId:  '',
customField: '20090501-153610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10927',
internalId:  '',
customField: '20100123-123332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10843',
internalId:  '',
customField: '20091226-095411'
};
webappMappings['1501']=webappMappings['1501-4893912']={
webappId:    '1501',
documentId:  '5201',
internalId:  '4893912',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100123-124046'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '5201',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '13901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20090501-150952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10948',
internalId:  '',
customField: '20090501-110846'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10990',
internalId:  '',
customField: '20090513-085114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20100123-123716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29912',
internalId:  '',
customField: '20111207-130828'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLN0F';
var companyName   = '++++++++++++++++++++++++A+AAFFORDABLE++AUTO++SERVICE+++L.L.C.';
var htmlTitle	  = 'AAFFORDABLE+AUTO+SERVICE';
var metaKeywords  = '%28aaffordable+auto+service+in+gr+mi+%29auto+automotive+repair+service+parts+affordable+fleet+brakes+tune+ups+used+car+dealer+heating+cooling+air+conditioning+vehicle+inspections+steering+suspensions+custom+engines+transmission+exhaust+streetrod+hotrod+mechanic+technician+mlive+wagenborg+pomorski+michiganworks+adamantium+dudentart+kentwood+michigan+mi+wyoming+grand+rapids+godwin+kellogsville+201121+public+schools+ckeck+engine+lights+byronbank+national+boomsheka+36inc+hydroponics+groco+growco+marijuana+seeds+dope+medical+caregiver+buddah+ricks+mobile+wash+austin+jorden+bryces+expert+division+muffler+realproauto+jobs+deere++.com+.net+.org+.biz+.gov+mobilehome+for+sale+woodtv+abc+cbs+fox+highlights+104.5+wsnx+puddin+playhouse+eobtv+towing+elite+customs+finnie+world+poker+iphone+apps+online+itunes+sprint+chrome+audio+electronics+alignment+alpha+romeo+164l+auctions+cruises+sears+walmart+utube+youtube+redtube+porntube+pornhub+ask.com+ebay+google+yahoo+myspace+facebook+tagged+craigslist+gmail+ebony+latina+moneytalks+jobsearch+pizza+unemployment+boobs+ass+pussy+pornclips+sublime+blonde+fisting+2girls1cup+news+rent+own+shopkey+snap-on+leland+kardashian+american+idol+bestbuy+hottdigg+haunted+comcast+jamie+foxx+nude+naked+celbs+hollywood+att+%2Fdownload+highspeed+tmz+access+top+1+2+3+4+5+6+7+8+9+10+100+jenny+craig+people+oprah+obama+michelle+inmatelookup+giraud+piano+miss+california+breast+implants+mtv+what+is+the+of+best+worst+book+records+drag+strip+sdba+ase+bbb+sos+secratery+of+state+sexting+biggest+ugly+betty+who+was+19+2000+2008+2009+2010+1999+1998+1997+1996+chevy+ford+chrysler+audi+pontiac+gm+olds+350+cc+moped+scooter+benz+dodge+truck+car+van+power+se+le+rx+minivan+windows+charts+most+in+many+vw+grand+prix+zzperformance+44+36+54+60+th+will+smith+usher+lowryder+autoflowering+5170+complete+homedepot+menards+carpet+live+newsroom+steaknshake+sonic+menu+bentley+bugatti+wii+games+gamespot+gamefly+swine+flu+crybabyleland+naterisagod+holst+freeland+chad+country+goatropinassrapinbastards+UIA';
var metaContents  = 'auto+repair+in+grand+rapids+mi.+Aaffordable+Auto+Service+LLC+ONE+STOP+FULL+SERVICE+AUTOMOTIVE+REPAIR+SHOP+5170+S.+Division+Kentwood%2C+MI+49548+616-570-0821+M-F+8-6++Sat+by+appt+Honest%2C+Dependable%2C+Affordable.+%2429+oil+changes+with+72+point+inspection+%2F+walk-ins+welcome';
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();
};

