/* [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 theSitetree=[ 
	['PAGE','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('About+us'),jdecode(''),'/53/index.html','true',[ 
		['PAGE','62',jdecode('Repair+shop'),jdecode(''),'/53/62.html','true',[],'']
	],''],
	['PAGE','71',jdecode('Opening+hours'),jdecode(''),'/71.html','true',[],''],
	['PAGE','80',jdecode('Accident-damaged+vehicles'),jdecode(''),'/80.html','true',[],''],
	['PAGE','89',jdecode('Our+team'),jdecode(''),'/89.html','true',[],''],
	['PAGE','107',jdecode('Towing++++24Hours+7Days'),jdecode(''),'/107/index.html','true',[ 
		['PAGE','116',jdecode('Local+and+Long+Distance+Towing'),jdecode(''),'/107/116.html','true',[],''],
		['PAGE','125',jdecode('Heavy+Duty+Towing+and+Recovery'),jdecode(''),'/107/125.html','true',[],'']
	],''],
	['PAGE','134',jdecode('++Free+Junk+Car+Removal'),jdecode(''),'/134.html','true',[],''],
	['PAGE','143',jdecode('Jobs'),jdecode(''),'/143.html','true',[],''],
	['PAGE','152',jdecode('Contact'),jdecode(''),'/152.html','true',[],''],
	['PAGE','170',jdecode('Prices%2FRates+Page+1'),jdecode(''),'/170.html','true',[],''],
	['PAGE','19601',jdecode('Prices%2FRates+Page+2'),jdecode(''),'/19601.html','true',[],''],
	['PAGE','19622',jdecode('Specialized+Rates'),jdecode(''),'/19622.html','true',[],''],
	['PAGE','179',jdecode('Current+offers'),jdecode(''),'/179.html','true',[],''],
	['PAGE','1201',jdecode('Directions'),jdecode(''),'/1201.html','true',[],''],
	['PAGE','1354',jdecode('Office'),jdecode(''),'/1354.html','true',[],''],
	['PAGE','1409',jdecode('Yard'),jdecode(''),'/1409.html','true',[],''],
	['PAGE','1690',jdecode('Photo+Gallery'),jdecode(''),'/1690.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Activate';
theSitetree.paletteFamily='1E3A6F';
theSitetree.keyvisualId='2026';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='337';
theSitetree.graphicsetId='396';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='1E3A6F';
var theTemplate={
				name: 			'Activate',
				paletteFamily: 	'1E3A6F',
				keyvisualId: 	'2026',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'337',
				graphicsetId: 	'396',
				contentColor: 	'FFFFFF',
				contentBGColor: '1E3A6F',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'1E3A6F',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1201',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-bbc9eff6a3e8017b238500dba920177c']={
webappId:    '7060',
documentId:  '1690',
internalId:  'bbc9eff6a3e8017b238500dba920177c',
customField: 'language:en;country:US;'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20080915-153233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1409',
internalId:  '',
customField: '20090914-093642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20070501-134849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20080915-153829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20080915-155307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20080915-155924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20080917-074628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20080915-114728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20080915-115417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20080903-214753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20080804-222131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143',
internalId:  '',
customField: '20080909-113729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152',
internalId:  '',
customField: '20080909-113743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170',
internalId:  '',
customField: '20091121-185105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179',
internalId:  '',
customField: '20070307-193842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20070307-200753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1354',
internalId:  '',
customField: '20080327-172440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1690',
internalId:  '',
customField: '20070313-191713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20091121-191649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19622',
internalId:  '',
customField: '20091121-191400'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN36A9';
var companyName   = 'Ridge+Towing+%26+Collision';
var htmlTitle	  = 'RidgeTransportSystems.com';
var metaKeywords  = 'Autobody%2C++Collision+Services%2C+Accident%2C+Towing%2C+Insurance+Claim%2C+Heavy+Duty+Towing%2C+Cash+for+Junk+Cars%2C+Repair+Shop%2C+Flatbed+Service%2C+Impound+Towing';
var metaContents  = 'Autobody%2C++Collision+Services%2C+Accident%2C+Towing%2C+Insurance+Claim%2C+Repair+Shop++';
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();
};
