/* [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','2101',jdecode('Our+Home+Your+Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2152',jdecode('Hours+of+Operation'),jdecode(''),'/2152.html','true',[],''],
	['PAGE','7401',jdecode('Service'),jdecode(''),'/7401/index.html','true',[ 
		['PAGE','7422',jdecode('Domestic'),jdecode(''),'/7401/7422.html','true',[],''],
		['PAGE','7443',jdecode('Asian'),jdecode(''),'/7401/7443.html','true',[],''],
		['PAGE','7464',jdecode('European'),jdecode(''),'/7401/7464.html','true',[],'']
	],''],
	['PAGE','8701',jdecode('AirConditiong'),jdecode(''),'/8701.html','true',[],''],
	['PAGE','2173',jdecode('Motors%2C+transmissions'),jdecode(''),'/2173.html','true',[],''],
	['PAGE','2194',jdecode('Tire+service'),jdecode(''),'/2194.html','true',[],''],
	['PAGE','2215',jdecode('Windshield+glass'),jdecode(''),'/2215.html','true',[],''],
	['PAGE','2404',jdecode('Contact'),jdecode(''),'/2404.html','true',[],''],
	['PAGE','2425',jdecode('About+us'),jdecode(''),'/2425/index.html','true',[ 
		['PAGE','2446',jdecode('Repair+shop'),jdecode(''),'/2425/2446.html','true',[],'']
	],''],
	['PAGE','7485',jdecode('+Coupons'),jdecode(''),'/7485.html','true',[],''],
	['PAGE','7506',jdecode('Check+the+Weather'),jdecode(''),'/7506.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Undulate';
theSitetree.paletteFamily='413D42';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33128';
theSitetree.graphicsetId='14071';
theSitetree.contentColor='A19DA2';
theSitetree.contentBGColor='413D42';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Undulate',
				paletteFamily: 	'413D42',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33128',
				graphicsetId: 	'14071',
				contentColor: 	'A19DA2',
				contentBGColor: '413D42',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090818-122434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20090818-123153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20090818-142650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2425',
internalId:  '',
customField: '20090818-143650'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20090818-143234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20090818-143203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20090818-142252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7422',
internalId:  '',
customField: '20090818-142331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7443',
internalId:  '',
customField: '20090818-142348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7464',
internalId:  '',
customField: '20090818-142419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20090818-143846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2404',
internalId:  '',
customField: '20090818-143327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2446',
internalId:  '',
customField: '20090428-212439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7506',
internalId:  '',
customField: '20090818-143919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20090818-142222'
};
webappMappings['7008']=webappMappings['7008-7529']={
webappId:    '7008',
documentId:  '2404',
internalId:  '7529',
customField: 'language:en;country:US;'
};
webappMappings['7080']=webappMappings['7080-230']={
webappId:    '7080',
documentId:  '7506',
internalId:  '230',
customField: 'language:en;country:US;'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHJ8H';
var companyName   = 'ASHLEY+AUTOMOTIVE+SERVICE++++++++++++++++++++++972+436+%28AUTO%29+2886';
var htmlTitle	  = 'Ashley+Automotive+Repair+Lewisville';
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();
};
