/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2401',jdecode('About+us'),jdecode(''),'/2401/index.html','true',[ 
		['PAGE','2422',jdecode('Repair+shop'),jdecode(''),'/2401/2422.html','true',[],'',''],
		['PAGE','2443',jdecode('Our+team'),jdecode(''),'/2401/2443.html','true',[],'',''],
		['PAGE','2464',jdecode('How+to+find+us'),jdecode(''),'/2401/2464.html','true',[],'','']
	],'',''],
	['PAGE','2485',jdecode('Opening+hours'),jdecode(''),'/2485.html','true',[],'',''],
	['PAGE','2506',jdecode('Prices'),jdecode(''),'/2506.html','true',[],'',''],
	['PAGE','2527',jdecode('Contact'),jdecode(''),'/2527.html','true',[],'',''],
	['PAGE','2590',jdecode('Service'),jdecode(''),'/2590/index.html','true',[ 
		['PAGE','2611',jdecode('Used+vehicles'),jdecode(''),'/2590/2611.html','true',[],'',''],
		['PAGE','2632',jdecode('Buy+and+sell'),jdecode(''),'/2590/2632.html','true',[],'',''],
		['PAGE','2653',jdecode('Accident-damaged+vehicles'),jdecode(''),'/2590/2653.html','true',[],'',''],
		['PAGE','2674',jdecode('Motors%2C+transmissions'),jdecode(''),'/2590/2674.html','true',[],'',''],
		['PAGE','2695',jdecode('Tire+service'),jdecode(''),'/2590/2695.html','true',[],'',''],
		['PAGE','2716',jdecode('Windshield+glass'),jdecode(''),'/2590/2716.html','true',[],'',''],
		['PAGE','2737',jdecode('Self-help'),jdecode(''),'/2590/2737.html','true',[],'','']
	],'',''],
	['PAGE','2758',jdecode('Current+offers'),jdecode(''),'/2758.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Undulate';
theSitetree.paletteFamily='413D42';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33118';
theSitetree.graphicsetId='14071';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='413D42';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Undulate',
				paletteFamily: 	'413D42',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33118',
				graphicsetId: 	'14071',
				contentColor: 	'FFFFFF',
				contentBGColor: '413D42',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100224-105238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2485',
internalId:  '',
customField: '20100223-161009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2506',
internalId:  '',
customField: '20100224-105708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2527',
internalId:  '',
customField: '20100223-160803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100224-105520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2590',
internalId:  '',
customField: '20100224-105429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2632',
internalId:  '',
customField: '20100223-163501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2758',
internalId:  '',
customField: '20100223-163746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2422',
internalId:  '',
customField: '20100223-164314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20100223-164735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20100223-165024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2611',
internalId:  '',
customField: '20100223-143830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2653',
internalId:  '',
customField: '20100223-143830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2674',
internalId:  '',
customField: '20100223-143830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2695',
internalId:  '',
customField: '20100223-143830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2716',
internalId:  '',
customField: '20100223-143830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2737',
internalId:  '',
customField: '20100223-143830'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7C7EF';
var companyName   = 'The+Auto+Medic';
var htmlTitle	  = '';
var metaKeywords  = 'WE+COME+TO+YOU+TO+FIX+YOUR+CAR+OR+TRUCK.+MECHANICS%2CAUTO+REPAIR%2CPARTS+REPLACED%2C+TUNE+UPS%2C+TIMING+BELTS%2C+NO+STARTS%2C+WATER+PUMPS%2C+BRAKE+JOBS%2C+OIL+CHANGES%2C+ENGINE+REPLACEMENTS%2CANY+ELECTRICAL+OR+WIRING+PROBLEMS%2C+EMISSIONS%2C+HEATING+AND+COOLING+SYSTEMS%2CCOMPUTER+SYSTEM+DIAGNOSTICS%2C+ALTERNATORS%2C+TUNE+UPS%2CWHEEL+BEARINGS+%2CCASH+DISCOUNTS%2C+RADIATORS+FLUSH+AND+FILLS%2C90+DAY+WARRANTY+ON+LABOR%2CLIFETIME+WARRANTY+ON+PARTS%2CWE+BUY+UNWANTED+JUNK+CARS%2CJUNK+VANS%2CJUNK+TRUCKS%2CFUEL+INJECTIONS%2C+A%2FC++WORK+ON+FOREIGN+AND+DOMESTIC+CARS%2CUSED+CAR+INSPECTIONS%2C';
var metaContents  = 'WE+COME+TO+YOU+TO+FIX+YOUR+CAR+OR+TRUCK.+MECHANICS%2CAUTO+REPAIR%2CPARTS+REPLACED%2C+TUNE+UPS%2C+TIMING+BELTS%2C+NO+STARTS%2C+WATER+PUMPS%2C+BRAKE+JOBS%2C+OIL+CHANGES%2C+ENGINE+REPLACEMENTS%2CANY+ELECTRICAL+OR+WIRING+PROBLEMS%2C+EMISSIONS%2C+HEATING+AND+COOLING+SYSTEMS%2CCOMPUTER+SYSTEM+DIAGNOSTICS%2C+ALTERNATORS%2C+TUNE+UPS%2CWHEEL+BEARINGS+%2CCASH+DISCOUNTS%2C+RADIATORS+FLUSH+AND+FILLS%2C90+DAY+WARRANTY+ON+LABOR%2CLIFETIME+WARRANTY+ON+PARTS%2CWE+BUY+UNWANTED+JUNK+CARS%2CJUNK+VANS%2CJUNK+TRUCKS%2CFUEL+INJECTIONS%2C+A%2FC++WORK+ON+FOREIGN+AND+DOMESTIC+CARS%2CUSED+CAR+INSPECTIONS%2C';
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();
};

