/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','58101',jdecode('Our+Fleet'),jdecode(''),'/58101/index.html','true',[ 
		['PAGE','24801',jdecode('18+Passenger+Escalade'),jdecode(''),'/58101/24801.html','true',[],''],
		['PAGE','25664',jdecode('26+Passenger+Excursion'),jdecode(''),'/58101/25664.html','true',[],''],
		['PAGE','25622',jdecode('20+Passenger+Excursion'),jdecode(''),'/58101/25622.html','true',[],''],
		['PAGE','25643',jdecode('22+Passenger+Excursion'),jdecode(''),'/58101/25643.html','true',[],''],
		['PAGE','25601',jdecode('14+Passenger+Excursion'),jdecode(''),'/58101/25601.html','true',[],'']
	],''],
	['PAGE','68207',jdecode('+++32+Pass.+PARTY+BUS'),jdecode(''),'/68207.html','true',[],''],
	['PAGE','24990',jdecode('Info%2CQuotes+%26+Reservations'),jdecode(''),'/24990/index.html','true',[ 
		['PAGE','25011',jdecode('Quotes'),jdecode(''),'/24990/25011/index.html','true',[ 
			['PAGE','30801',jdecode('Quotes+%28follow+up+page%29'),jdecode(''),'/24990/25011/30801.html','false',[],'']
		],'']
	],''],
	['PAGE','24969',jdecode('Links+for+Local+Events'),jdecode(''),'/24969.html','true',[],''],
	['PAGE','24822',jdecode('About+us'),jdecode(''),'/24822.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4D4CD2';
theSitetree.keyvisualId='573';
theSitetree.keyvisualName='party.jpg';
theSitetree.fontsetId='125';
theSitetree.graphicsetId='140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Kreis',
				paletteFamily: 	'4D4CD2',
				keyvisualId: 	'573',
				keyvisualName: 	'party.jpg',
				fontsetId: 		'125',
				graphicsetId: 	'140',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'4D4CD2',
				b_color: 		'7794F8',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1001']=webappMappings['1001-ahw050ineabb7c2b0eae09b5986']={
webappId:    '1001',
documentId:  '25011',
internalId:  'ahw050ineabb7c2b0eae09b5986',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050ineabb7c2b0eae09b5986']={
webappId:    '1001',
documentId:  '30801',
internalId:  'ahw050ineabb7c2b0eae09b5986',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20080115-203435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68207',
internalId:  '',
customField: '20090318-204759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58101',
internalId:  '',
customField: '20070910-144825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25664',
internalId:  '',
customField: '20070703-181209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20070703-125531'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INEABB';
var companyName   = 'California+Limousine+Charters+Inc.';
var htmlTitle	  = 'CLC-California+Limousine+Charters-+SUV+limos+for+Fresno%2CBakersfield%2CVisalia%2C+Hanford%2C+Lemoore%2C+Porterville%2CTulare+and+surrounding+areas.';
var metaKeywords  = '+limousine%2Climo%2Climousines%2Ccentral+california+limo%2Ccentral+california+limousine%2Cfresno+limo%2Cporterville+limo%2Cbakersfield+limo%2Clindsay+limo%2Cterra+bella+limo';
var metaContents  = 'Limosine+service+for+Fresno%2C+Bakersfield%2C+Porterville%2C+Exeter%2C+Tulare%2CVisalia%2C+Lemoore%2C+Tulare+county%2C+Kings+county.++limousine%2Climo%2Climousines%2Ccentral+california+limo%2Ccentral+california+limousine%2Cfresno+limo%2Cporterville+limo%2Cbakersfield+limo%2Clindsay+limo%2Cterra+bella+limo';
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();
};

