/* [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','1801',jdecode('About+our+company'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1852',jdecode('How+we+got+started'),jdecode(''),'/1852.html','true',[],''],
	['PAGE','13101',jdecode('Chartering+a+Motorcoach%3F'),jdecode(''),'/13101/index.html','true',[ 
		['PAGE','27185',jdecode('Cost+Estimate'),jdecode(''),'/13101/27185.html','true',[],''],
		['PAGE','19501',jdecode('DOT+regulations'),jdecode(''),'/13101/19501.html','true',[],''],
		['PAGE','19522',jdecode('Rules+and+Guidelines'),jdecode(''),'/13101/19522.html','true',[],'']
	],''],
	['PAGE','2501',jdecode('Motorcoach+TOURS'),jdecode(''),'/2501/index.html','true',[ 
		['PAGE','11301',jdecode('Day+trips'),jdecode(''),'/2501/11301.html','true',[],''],
		['PAGE','20922',jdecode('Passport+Information'),jdecode(''),'/2501/20922.html','true',[],''],
		['PAGE','10501',jdecode('Mountain+National+Parks'),jdecode(''),'/2501/10501.html','true',[],''],
		['PAGE','10543',jdecode('Hawaii'),jdecode(''),'/2501/10543.html','true',[],''],
		['PAGE','10564',jdecode('Maritime+Coast'),jdecode(''),'/2501/10564.html','true',[],''],
		['PAGE','6301',jdecode('Balloon+Festival'),jdecode(''),'/2501/6301.html','true',[],''],
		['PAGE','26485',jdecode('Christmas+Branson'),jdecode(''),'/2501/26485.html','true',[],''],
		['PAGE','26506',jdecode('Christmas+San+Antonio'),jdecode(''),'/2501/26506.html','true',[],''],
		['PAGE','20901',jdecode('Future+Plans'),jdecode(''),'/2501/20901.html','true',[],'']
	],''],
	['PAGE','12801',jdecode('What+are+we+up+to+today%3F'),jdecode(''),'/12801.html','true',[],''],
	['PAGE','1894',jdecode('Our+drivers'),jdecode(''),'/1894.html','true',[],''],
	['PAGE','1873',jdecode('Our+buses'),jdecode(''),'/1873.html','true',[],''],
	['PAGE','5601',jdecode('Contacting+us'),jdecode(''),'/5601.html','true',[],'']];
var siteelementCount=20;
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 theTemplate={
				name: 			'Office',
				paletteFamily: 	'B85454',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32063',
				graphicsetId: 	'13878',
				contentColor: 	'000000',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100627-150613'
};
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: '20100430-140324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090605-125524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20091224-123718'
};
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:  '10501',
internalId:  '',
customField: '20100623-202205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26485',
internalId:  '',
customField: '20100623-202934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10543',
internalId:  '',
customField: '20100623-202239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10564',
internalId:  '',
customField: '20091224-123628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100329-101604'
};
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: '20100623-204813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20091224-123331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26506',
internalId:  '',
customField: '20100623-203706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27185',
internalId:  '',
customField: '20100627-140742'
};
var canonHostname = 'cmworker03.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();
};
