/* [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','2301',jdecode('Magic+Shuttle+Home'),jdecode(''),'/2301.html','true',[],'',''],
	['PAGE','2373',jdecode('Prices+and+Reservations'),jdecode(''),'/2373.html','true',[],'',''],
	['PAGE','7901',jdecode('Links+and+Comments'),jdecode(''),'/7901.html','true',[],'',''],
	['PAGE','17701',jdecode('Vacation+Rentals'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','14201',jdecode('Bienvenidos'),jdecode(''),'/14201.html','true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Postcards';
theSitetree.paletteFamily='B375E3';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10490';
theSitetree.graphicsetId='11061';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F8F1FC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Postcards',
				paletteFamily: 	'B375E3',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10490',
				graphicsetId: 	'11061',
				contentColor: 	'000000',
				contentBGColor: 'F8F1FC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'B375E3',
				e_color: 		'B375E3',
				f_color: 		'B375E3',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20110727-165113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20110503-081329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20091206-065600'
};
webappMappings['7008']=webappMappings['7008-1481']={
webappId:    '7008',
documentId:  '2373',
internalId:  '1481',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-7901anfi10inxppv']={
webappId:    '1002',
documentId:  '7901',
internalId:  '7901anfi10inxppv',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2373',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20110213-220334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20110307-110846'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'ANFI10INXPPV';
var companyName   = 'MAGIC+SHUTTLE';
var htmlTitle	  = 'Magic+Shuttle%2C+Orlando%27s+Taxi+and+Shuttle+Service%2C+Covering+all+Major+Attractions+and+Airports.';
var metaKeywords  = 'walt+disney+world+transportation%2Ctransportation+from+mco+to+port+canaveral%2Cshuttle+service+from+mco+to+port+canaveral%2Cshuttle+mco+to+port+canaveral%2Cshuttle+from+mco+to+port+canaveral%2Cmco+to+port+canaveral%2Cport+canaveral+cruise+shuttle%2Cmco+transportation+to+port+canaveral%2Cdisney+airport+shuttle%2Cairport+shuttle+buses%2Cairport+shuttle+services%2Cairport+shuttle+bus%2Cairport+shuttle+service%2Cairport+shuttle+to%2Cairport+shuttle%2Cshuttle+from+airport+to+disney+world%2Clocal+airport+taxis%2Cmco+shuttle%2Cmears+shuttle%2Cshuttle+services%2Cshuttle+service%2Cmco+transportation%2Cdisney+world+transportation%2Cmears+transportation%2Ccar+transportation%2Cflorida+transportation%2Ctransportation+to%2Ctransportation%2Ctaxi+service%2Ccab+service%2Ccar+service%2Csanford+transfers%2Ctaxi+airports%2Cdisney+transfers';
var metaContents  = 'MAGIC+SHUTTLE+is+centrally+located+just+15+minutes+SW+of+Disney+World.++We+provide+transportation+needs+to+and+from+all+major+attractions%2C+dinner+shows%2C+shopping+and+restaurants+as+well+as+airport+service+to+and+from+Orlando+International%2C+Orlando+Sanford+International+and+Tampa+International+Airports.';
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();
};

