/* [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','73',jdecode('Home'),jdecode(''),'/73.html','true',[],'',''],
	['PAGE','175',jdecode('Rates%2FContact+Us'),jdecode(''),'/175.html','true',[],'',''],
	['PAGE','628',jdecode('Presidential+Suites'),jdecode(''),'/628.html','true',[],'',''],
	['PAGE','94',jdecode('All-Inclusive%2FWhat%26%23x27%3Bs+included'),jdecode(''),'/94.html','true',[],'',''],
	['PAGE','583',jdecode('Double+Jacuzzi+Rm+Picture'),jdecode(''),'/583.html','true',[],'',''],
	['PAGE','592',jdecode('Moon+Sunrise%2C+Grand%2C+Nizuc'),jdecode(''),'/592.html','true',[],'',''],
	['PAGE','1318',jdecode('Moon+Palace+Photos'),jdecode(''),'/1318.html','true',[],'',''],
	['PAGE','4701',jdecode('Aventura+Cove+%28family%29'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','601',jdecode('Aventura+Spa+%28adults+only%29'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','1239',jdecode('Aventura+Photos'),jdecode(''),'/1239.html','true',[],'',''],
	['PAGE','646',jdecode('Sun+Palace+%28couples+only%29'),jdecode(''),'/646.html','true',[],'',''],
	['PAGE','637',jdecode('Beach+Palace'),jdecode(''),'/637.html','true',[],'',''],
	['PAGE','619',jdecode('Cancun+Palace'),jdecode(''),'/619.html','true',[],'',''],
	['PAGE','610',jdecode('Xpu-Ha+Palace+%28Pet+Friendly%29'),jdecode(''),'/610.html','true',[],'',''],
	['PAGE','691',jdecode('Xpu-Ha+photos'),jdecode(''),'/691.html','true',[],'',''],
	['PAGE','682',jdecode('Free+Wedding%2FHoneymoon'),jdecode(''),'/682.html','true',[],'',''],
	['PAGE','655',jdecode('Things+to+do+in+Cancun'),jdecode(''),'/655.html','true',[],'',''],
	['PAGE','664',jdecode('Kids+Club+Activities'),jdecode(''),'/664.html','true',[],'',''],
	['PAGE','673',jdecode('Cancellation%2FRefund+Policy'),jdecode(''),'/673.html','true',[],'',''],
	['PAGE','103',jdecode('About+us'),jdecode(''),'/103.html','true',[],'',''],
	['PAGE','1578',jdecode('Moon+Golf%2FPlayacar+Golf'),jdecode(''),'/1578.html','true',[],'',''],
	['PAGE','1655',jdecode('Maps+of+where+resorts+are'),jdecode(''),'/1655.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6874';
theSitetree.keyvisualName='kv_6874.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='354B86';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6874',
				keyvisualName: 	'kv_6874.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12030',
				contentColor: 	'354B86',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '73',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-434682']={
webappId:    '1501',
documentId:  '73',
internalId:  '434682',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73',
internalId:  '',
customField: '20100525-143841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94',
internalId:  '',
customField: '20091021-135521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '583',
internalId:  '',
customField: '20091021-142230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '628',
internalId:  '',
customField: '20100211-123040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '592',
internalId:  '',
customField: '20091021-142951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1318',
internalId:  '',
customField: '20080311-231059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20090224-163058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1239',
internalId:  '',
customField: '20080303-234313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '619',
internalId:  '',
customField: '20091021-143630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '637',
internalId:  '',
customField: '20091021-143520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '646',
internalId:  '',
customField: '20091021-143427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '610',
internalId:  '',
customField: '20091021-143736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '691',
internalId:  '',
customField: '20090224-163556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '682',
internalId:  '',
customField: '20090224-134252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '655',
internalId:  '',
customField: '20090224-163740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '664',
internalId:  '',
customField: '20091021-144101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20090224-164025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175',
internalId:  '',
customField: '20091021-134706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103',
internalId:  '',
customField: '20091021-144258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1578',
internalId:  '',
customField: '20090224-164421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1655',
internalId:  '',
customField: '20080326-220501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20091021-143154'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2W54';
var companyName   = 'Cancun+Vacations';
var htmlTitle	  = 'Palace+Resorts+Cancun+Vacations';
var metaKeywords  = 'Moon+Palace+++Palace+Resorts+++All-Inclusive++Cancun+Vacations++Aventura+Spa+Palace++Aventura+Cove++Cancun+Palace++Sun+Palace++Presidential+Suites++VIP+Palace+Resorts++';
var metaContents  = 'Palace+Resorts+All-Inclusive+Discounted+Rates++VIP+stay+with+all+extras+to+11+Palace+Resorts';
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();
};
