/* [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','1801',jdecode('About+our+company'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','1852',jdecode('How+we+got+started'),jdecode(''), jdecode('%2F1852.html'), 'true',[],'',''],
	['PAGE','13101',jdecode('Chartering+a+Motorcoach%3F'),jdecode(''), jdecode('%2F13101%2Findex.html'), 'true',[ 
		['PAGE','27185',jdecode('Cost+Estimate'),jdecode(''), jdecode('%2F13101%2F27185.html'), 'true',[],'',''],
		['PAGE','19501',jdecode('DOT+regulations'),jdecode(''), jdecode('%2F13101%2F19501.html'), 'true',[],'',''],
		['PAGE','19522',jdecode('Rules+and+Guidelines'),jdecode(''), jdecode('%2F13101%2F19522.html'), 'true',[],'','']
	],'',''],
	['PAGE','2501',jdecode('Motorcoach+TOURS'),jdecode(''), jdecode('%2F2501%2Findex.html'), 'true',[ 
		['PAGE','11301',jdecode('Day+trips'),jdecode(''), jdecode('%2F2501%2F11301.html'), 'true',[],'',''],
		['PAGE','31406',jdecode('Texas+Coast'),jdecode(''), jdecode('%2F2501%2F31406.html'), 'true',[],'',''],
		['PAGE','34085',jdecode('Southern+California'),jdecode(''), jdecode('%2F2501%2F34085.html'), 'true',[],'',''],
		['PAGE','33485',jdecode('Alaska'),jdecode(''), jdecode('%2F2501%2F33485.html'), 'true',[],'',''],
		['PAGE','34106',jdecode('Mackinac+Island%2FGreat+Lakes'),jdecode(''), jdecode('%2F2501%2F34106.html'), 'true',[],'',''],
		['PAGE','31448',jdecode('Christmas+Branson'),jdecode(''), jdecode('%2F2501%2F31448.html'), 'true',[],'',''],
		['PAGE','20901',jdecode('Future+Plans'),jdecode(''), jdecode('%2F2501%2F20901.html'), 'true',[],'',''],
		['PAGE','31469',jdecode('Deposit+information'),jdecode(''), jdecode('%2F2501%2F31469.html'), 'true',[],'',''],
		['PAGE','20922',jdecode('Passport+Information'),jdecode(''), jdecode('%2F2501%2F20922.html'), 'true',[],'',''],
		['PAGE','31490',jdecode('Gift+certificates'),jdecode(''), jdecode('%2F2501%2F31490.html'), 'true',[],'','']
	],'',''],
	['PAGE','12801',jdecode('What+are+we+up+to+today%3F'),jdecode(''), jdecode('%2F12801.html'), 'true',[],'',''],
	['PAGE','1894',jdecode('Our+drivers'),jdecode(''), jdecode('%2F1894.html'), 'true',[],'',''],
	['PAGE','1873',jdecode('Our+buses'),jdecode(''), jdecode('%2F1873.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Contacting+us'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='B85454';
theSitetree.keyvisualId='11165';
theSitetree.keyvisualName='kv_11165.jpg';
theSitetree.fontsetId='32063';
theSitetree.graphicsetId='13878';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Office',
				paletteFamily: 	'B85454',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32063',
				graphicsetId: 	'13878',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110317-113408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100627-135401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090319-163427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20100627-144700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20090616-165621'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20101226-161022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090605-125524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31406',
internalId:  '',
customField: '20111205-143637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100627-135551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20090605-130611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31490',
internalId:  '',
customField: '20110122-132018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31469',
internalId:  '',
customField: '20110122-131750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34085',
internalId:  '',
customField: '20111205-143905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31448',
internalId:  '',
customField: '20111205-144533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20110228-184740'
};
webappMappings['7050']=webappMappings['7050-8425']={
webappId:    '7050',
documentId:  '12801',
internalId:  '8425',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19522',
internalId:  '',
customField: '20090605-130859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20111205-144628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20110122-131852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34106',
internalId:  '',
customField: '20111205-144109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27185',
internalId:  '',
customField: '20100627-140742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33485',
internalId:  '',
customField: '20111205-143952'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN30HK';
var companyName   = 'Have+bus%2C+will+travel';
var htmlTitle	  = 'King%27s+Highway';
var metaKeywords  = 'Motorcoach+tours+tour+mexico+alaska+copper+canyon+chistian+bluebonnet+redwoods+midwest+rushmore+DC+Amish+Pennsylvania+Washington';
var metaContents  = 'Motorcoach+transportation+and+tours+throughout+the+USA%2C+Canada%2C+Mexico+in+a+Christian+atmosphere.++';
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();
};

