/* [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','1901',jdecode('MBS+Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','12101',jdecode('Mercedes+Benz'),jdecode(''), jdecode('%2F12101.html'), 'true',[],'',''],
	['PAGE','63901',jdecode('Guest+Book'),jdecode(''), jdecode('%2F63901.html'), 'true',[],'',''],
	['PAGE','15001',jdecode('Photo+Book'),jdecode(''), jdecode('%2F15001.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('Service+%26+Repair+%2B'),jdecode(''), jdecode('%2F1952%2Findex.html'), 'true',[ 
		['PAGE','82223',jdecode('200K+Mile+Club'),jdecode(''), jdecode('%2F1952%2F82223.html'), 'true',[],'',''],
		['PAGE','12901',jdecode('Warranties'),jdecode(''), jdecode('%2F1952%2F12901.html'), 'true',[],'','']
	],'',''],
	['PAGE','1994',jdecode('Price+Menu+%2B'),jdecode(''), jdecode('%2F1994%2Findex.html'), 'true',[ 
		['PAGE','30901',jdecode('Extras'),jdecode(''), jdecode('%2F1994%2F30901.html'), 'true',[],'','']
	],'',''],
	['PAGE','75823',jdecode('Buy+%26+Sell+%2B'),jdecode(''), jdecode('%2F75823%2Findex.html'), 'true',[ 
		['PAGE','53701',jdecode('Buyers+Guide'),jdecode(''), jdecode('%2F75823%2F53701.html'), 'true',[],'',''],
		['PAGE','2036',jdecode('For+Sale'),jdecode(''), jdecode('%2F75823%2F2036.html'), 'true',[],'','']
	],'',''],
	['PAGE','7843',jdecode('Hours+%26+Location'),jdecode(''), jdecode('%2F7843.html'), 'true',[],'',''],
	['PAGE','12922',jdecode('Order+Parts'),jdecode(''), jdecode('%2F12922.html'), 'true',[],'',''],
	['PAGE','2162',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2162.html'), 'true',[],'',''],
	['PAGE','16101',jdecode('Our+Team'),jdecode(''), jdecode('%2F16101.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Links'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'',''],
	['PAGE','8422',jdecode('Blog'),jdecode(''), jdecode('%2F8422.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='5583CB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10349';
theSitetree.graphicsetId='10469';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='154186';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Deepcolor',
				paletteFamily: 	'5583CB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10349',
				graphicsetId: 	'10469',
				contentColor: 	'000000',
				contentBGColor: '154186',
				a_color: 		'5583CB',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120124-093848'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20120124-094632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20120124-091026'
};
webappMappings['7050']=webappMappings['7050-1713']={
webappId:    '7050',
documentId:  '8422',
internalId:  '1713',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20120110-191056'
};
webappMappings['7008']=webappMappings['7008-6896']={
webappId:    '7008',
documentId:  '2162',
internalId:  '6896',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7843',
internalId:  '',
customField: '20111207-183232'
};
webappMappings['7060']=webappMappings['7060-ebd25b2fad7cc487fa3306695dc501a6']={
webappId:    '7060',
documentId:  '15001',
internalId:  'ebd25b2fad7cc487fa3306695dc501a6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20091115-094958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20110821-205642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2162',
internalId:  '',
customField: '20110821-204408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82223',
internalId:  '',
customField: '20111110-112244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20091212-154004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20111130-192948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20101006-110139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20120111-112748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110707-175147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20110815-090824'
};
webappMappings['1501']=webappMappings['1501-14731394']={
webappId:    '1501',
documentId:  '1901',
internalId:  '14731394',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-14189']={
webappId:    '7008',
documentId:  '12922',
internalId:  '14189',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53701',
internalId:  '',
customField: '20111222-103417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75823',
internalId:  '',
customField: '20110402-141413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63901',
internalId:  '',
customField: '20120124-091500'
};
webappMappings['7008']=webappMappings['7008-20042']={
webappId:    '7008',
documentId:  '63901',
internalId:  '20042',
customField: 'language:en;country:US;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHARM';
var companyName   = 'MBS+Automotive+++++++++++++++++++++++++++++++++++847-205-9883';
var htmlTitle	  = 'MBS+Automotive+-+Mercedes+Benz+Specialists+-+Northbrook+-+Chicago+North+Shore';
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();
};

