/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','22301',jdecode('Testimonials'),jdecode(''),'/22301.html','true',[],''],
	['PAGE','652',jdecode('About+us'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','694',jdecode('Repair+shop'),jdecode(''),'/652/694.html','true',[],''],
		['PAGE','715',jdecode('Our+team'),jdecode(''),'/652/715.html','true',[],'']
	],''],
	['PAGE','925',jdecode('Services'),jdecode(''),'/925/index.html','true',[ 
		['PAGE','967',jdecode('Fleet+Vehicles'),jdecode(''),'/925/967.html','true',[],'']
	],''],
	['PAGE','6801',jdecode('Amenities'),jdecode(''),'/6801.html','true',[],''],
	['PAGE','8201',jdecode('Schedule+Appointment'),jdecode(''),'/8201.html','true',[],''],
	['PAGE','14201',jdecode('Mechanics+Corner'),jdecode(''),'/14201.html','true',[],''],
	['PAGE','1156',jdecode('Online+Specials'),jdecode(''),'/1156.html','true',[],''],
	['PAGE','3001',jdecode('Driving+Directions'),jdecode(''),'/3001.html','true',[],''],
	['PAGE','904',jdecode('Hours+Of+Operation'),jdecode(''),'/904.html','true',[],''],
	['PAGE','841',jdecode('Contact+DMA'),jdecode(''),'/841.html','true',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Valiant';
theSitetree.paletteFamily='5252B6';
theSitetree.keyvisualId='9814';
theSitetree.keyvisualName='kv_9814.jpg';
theSitetree.fontsetId='17631';
theSitetree.graphicsetId='13032';
theSitetree.contentColor='646464';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Valiant',
				paletteFamily: 	'5252B6',
				keyvisualId: 	'9814',
				keyvisualName: 	'kv_9814.jpg',
				fontsetId: 		'17631',
				graphicsetId: 	'13032',
				contentColor: 	'646464',
				contentBGColor: 'FFFFFF',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3001',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-13093323']={
webappId:    '1501',
documentId:  '601',
internalId:  '13093323',
customField: '1501'
};
webappMappings['1003']=webappMappings['1003-aendu0inerw811d47d81bd3']={
webappId:    '1003',
documentId:  '14201',
internalId:  'aendu0inerw811d47d81bd3',
customField: 'en:US:'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20091208-235910'
};
webappMappings['7008']=webappMappings['7008-16627']={
webappId:    '7008',
documentId:  '8201',
internalId:  '16627',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20070725-221526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20070725-221538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20070725-221547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20080327-222627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '925',
internalId:  '',
customField: '20070920-214249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '967',
internalId:  '',
customField: '20061225-101238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20061111-085527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20061225-100839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20070725-221637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1156',
internalId:  '',
customField: '20070926-204616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20091214-160232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '904',
internalId:  '',
customField: '20070725-221715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '841',
internalId:  '',
customField: '20091209-001216'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INERW8';
var companyName   = 'DMA+Automotive';
var htmlTitle	  = 'DMA+Automotive-Auto+repairs+%7C+Duluth+Suwanee+Auto+Repairs+%7C+Foreign+Domestic+Auto+Repairs+%7C+Garage+%7C+Mechanic+%7C+Duluth+Suwanee+%7C';
var metaKeywords  = 'Auto+Repair%2C+Acura%2C+Buick%2C+Cadillac%2C+Chevrolet%2C+Chrysler%2C+Dodge%2C+Eagle%2C+Ford%2C+Geo%2C+GMC%2C+Honda%2C+Hyundai%2C+Infiniti%2C+Isuzu%2C+Jeep%2C+Kia%2C+Lexus%2C+Lincoln%2C+Mazda%2C+Mercury%2C+Mitsubishi%2C+Nissan%2C+Oldsmobile%2C+Plymouth%2C+Pontiac%2C+Saturn%2C+Suzuki%2C+Toyota%2C+Suwanee%2C+Buford%2C+Alpharetta%2C+Duluth%2C+Roswell%2C+Cumming%2C+Atlanta%2C+Lawrenceville';
var metaContents  = 'Auto+Repairs+and+Mechanic+%7C+domestic+foreign+%7C+Duluth+Suwanee+Atlanta+%7C+Repair+%7C+Maintenance+%7C+Isuzu%2C+Honda%2C+Acura%2C+Infinity%2C+Toyota%2C+Nissan%2C+Lexus+and+Domestic%2C+Alpharetta%2C+duluth%2C+lawrenceville%2C+Atlanta';
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();
};
