/* [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','6501',jdecode('Home'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','35701',jdecode('Our+services'),jdecode(''), jdecode('%2F35701%2Findex.html'), 'true',[ 
		['PAGE','35722',jdecode('Financing'),jdecode(''), jdecode('%2F35701%2F35722.html'), 'true',[],'',''],
		['PAGE','35743',jdecode('Leasing'),jdecode(''), jdecode('%2F35701%2F35743.html'), 'true',[],'',''],
		['PAGE','35764',jdecode('Logistics'),jdecode(''), jdecode('%2F35701%2F35764.html'), 'true',[],'',''],
		['PAGE','35785',jdecode('24+%2F+7+%2F+365++Maintenance'),jdecode(''), jdecode('%2F35701%2F35785.html'), 'true',[],'',''],
		['PAGE','35806',jdecode('50+State+Tag+Title+Services'),jdecode(''), jdecode('%2F35701%2F35806.html'), 'true',[],'',''],
		['PAGE','35827',jdecode('Test+drive'),jdecode(''), jdecode('%2F35701%2F35827.html'), 'true',[],'','']
	],'',''],
	['PAGE','35848',jdecode('About+us'),jdecode(''), jdecode('%2F35848%2Findex.html'), 'true',[ 
		['PAGE','35869',jdecode('Our+partner'),jdecode(''), jdecode('%2F35848%2F35869.html'), 'true',[],'',''],
		['PAGE','35890',jdecode('Our+team'),jdecode(''), jdecode('%2F35848%2F35890.html'), 'true',[],'',''],
		['PAGE','35911',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F35848%2F35911.html'), 'true',[],'','']
	],'',''],
	['PAGE','35932',jdecode('Contact'),jdecode(''), jdecode('%2F35932.html'), 'true',[],'',''],
	['PAGE','35953',jdecode('Our+offer'),jdecode(''), jdecode('%2F35953%2Findex.html'), 'true',[ 
		['PAGE','35974',jdecode('New+cars'),jdecode(''), jdecode('%2F35953%2F35974.html'), 'true',[],'',''],
		['PAGE','35995',jdecode('New+Trucks'),jdecode(''), jdecode('%2F35953%2F35995.html'), 'true',[],'',''],
		['PAGE','36016',jdecode('Used+cars'),jdecode(''), jdecode('%2F35953%2F36016.html'), 'true',[],'','']
	],'',''],
	['PAGE','17201',jdecode('We+Recommend'),jdecode(''), jdecode('%2F17201%2Findex.html'), 'true',[ 
		['PAGE','15701',jdecode('2012+Transit+Connect'),jdecode(''), jdecode('%2F17201%2F15701.html'), 'true',[],'',''],
		['PAGE','17222',jdecode('2012+Ford+Fusion++'),jdecode(''), jdecode('%2F17201%2F17222.html'), 'true',[],'',''],
		['PAGE','37001',jdecode('2012+Toyota+Camry'),jdecode(''), jdecode('%2F17201%2F37001.html'), 'true',[],'',''],
		['PAGE','17243',jdecode('2012+Winning+Team'),jdecode(''), jdecode('%2F17201%2F17243.html'), 'true',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2487';
theSitetree.keyvisualName='seminar.jpg';
theSitetree.fontsetId='418';
theSitetree.graphicsetId='463';
theSitetree.contentColor='020E66';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2487',
				keyvisualName: 	'seminar.jpg',
				fontsetId: 		'418',
				graphicsetId: 	'463',
				contentColor: 	'020E66',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20100530-143917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15701',
internalId:  '',
customField: '20100724-190437'
};
webappMappings['1501']=webappMappings['1501-7318097']={
webappId:    '1501',
documentId:  '6501',
internalId:  '7318097',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20100724-190347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17222',
internalId:  '',
customField: '20100724-190609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17243',
internalId:  '',
customField: '20100724-185818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20110508-120617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35722',
internalId:  '',
customField: '20110508-120617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35848',
internalId:  '',
customField: '20110508-120617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35953',
internalId:  '',
customField: '20110508-120617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20111119-160841'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLJDD';
var companyName   = 'Boca+Leasing+Center';
var htmlTitle	  = 'Commercial+Vehicle+Leasing';
var metaKeywords  = 'vehicle+leasing%2C+commercial+vehicle+financing%2C+commercial+vehicle+leasing%2C+unlimited+mileage+leasing%2C+no+mileage+penalty+leasing%2C+';
var metaContents  = 'vehicle+leasing%2C+commercial+vehicle+financing%2C+commercial+vehicle+leasing%2C+unlimited+mileage+leasing%2C+no+mileage+penalty+leasing%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();
};

