/* [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','5101',jdecode('Home'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','31501',jdecode('History'),jdecode(''), jdecode('%2F31501.html'), 'true',[],'',''],
	['PAGE','16185',jdecode('Accommodations'),jdecode(''), jdecode('%2F16185%2Findex.html'), 'true',[ 
		['PAGE','41122',jdecode('Grand+Baja+Resort'),jdecode(''), jdecode('%2F16185%2F41122.html'), 'true',[],'',''],
		['PAGE','41164',jdecode('Las+Rocas+'),jdecode(''), jdecode('%2F16185%2F41164.html'), 'true',[],'',''],
		['PAGE','41143',jdecode('Poco+Cielo'),jdecode(''), jdecode('%2F16185%2F41143.html'), 'true',[],'','']
	],'',''],
	['PAGE','16101',jdecode('Lobster+Houses'),jdecode(''), jdecode('%2F16101%2Findex.html'), 'true',[ 
		['PAGE','40001',jdecode('Puerto+Nuevo+II'),jdecode(''), jdecode('%2F16101%2F40001.html'), 'true',[],'',''],
		['PAGE','40022',jdecode('Puerto+Nuevo+I'),jdecode(''), jdecode('%2F16101%2F40022.html'), 'true',[],'',''],
		['PAGE','58513',jdecode('Villa+Ortega%26%23x27%3Bs'),jdecode(''), jdecode('%2F16101%2F58513.html'), 'true',[],'','']
	],'',''],
	['PAGE','17601',jdecode('More+Local+Eateries'),jdecode(''), jdecode('%2F17601%2Findex.html'), 'true',[ 
		['PAGE','99139',jdecode('Bahia+Cantiles'),jdecode(''), jdecode('%2F17601%2F99139.html'), 'true',[],'',''],
		['PAGE','99160',jdecode('Splash'),jdecode(''), jdecode('%2F17601%2F99160.html'), 'true',[],'','']
	],'',''],
	['PAGE','136596',jdecode('Artisan+Row'),jdecode(''), jdecode('%2F136596.html'), 'true',[],'',''],
	['PAGE','136496',jdecode('Gringo+Crawl'),jdecode(''), jdecode('%2F136496.html'), 'true',[],'',''],
	['PAGE','125563',jdecode('Road+Trips'),jdecode(''), jdecode('%2F125563.html'), 'true',[],'',''],
	['PAGE','61329',jdecode('Private+Homes'),jdecode(''), jdecode('%2F61329%2Findex.html'), 'true',[ 
		['PAGE','126563',jdecode('Baja+Sandcastle'),jdecode(''), jdecode('%2F61329%2F126563.html'), 'true',[],'','']
	],'',''],
	['PAGE','16164',jdecode('Shopping'),jdecode(''), jdecode('%2F16164.html'), 'true',[],'',''],
	['PAGE','83939',jdecode('Spas'),jdecode(''), jdecode('%2F83939%2Findex.html'), 'true',[ 
		['PAGE','84039',jdecode('Spa+Las+Rocas'),jdecode(''), jdecode('%2F83939%2F84039.html'), 'true',[],'',''],
		['PAGE','105049',jdecode('La+Vid+Spa'),jdecode(''), jdecode('%2F83939%2F105049.html'), 'true',[],'','']
	],'',''],
	['PAGE','29701',jdecode('Coupons+%26+Specials'),jdecode(''), jdecode('%2F29701.html'), 'true',[],'',''],
	['PAGE','16206',jdecode('Directions'),jdecode(''), jdecode('%2F16206.html'), 'true',[],'',''],
	['PAGE','29722',jdecode('Vehicle+Insurance+'),jdecode(''), jdecode('%2F29722.html'), 'true',[],'',''],
	['PAGE','17701',jdecode('Other+Activities'),jdecode(''), jdecode('%2F17701.html'), 'true',[],'',''],
	['PAGE','143917',jdecode('Action+%26+Adventure'),jdecode(''), jdecode('%2F143917.html'), 'true',[],'',''],
	['PAGE','125626',jdecode('Lobsterfest'),jdecode(''), jdecode('%2F125626.html'), 'true',[],'',''],
	['PAGE','16122',jdecode('Pharmacies'),jdecode(''), jdecode('%2F16122.html'), 'true',[],'',''],
	['PAGE','29764',jdecode('Safety'),jdecode(''), jdecode('%2F29764.html'), 'true',[],'',''],
	['PAGE','125163',jdecode('Medical+Services'),jdecode(''), jdecode('%2F125163.html'), 'true',[],'',''],
	['PAGE','125205',jdecode('Car+Trouble'),jdecode(''), jdecode('%2F125205.html'), 'true',[],'',''],
	['PAGE','178696',jdecode('Moving+Service'),jdecode(''), jdecode('%2F178696.html'), 'true',[],'',''],
	['PAGE','54929',jdecode('Contest+Survey'),jdecode(''), jdecode('%2F54929.html'), 'true',[],'',''],
	['PAGE','98339',jdecode('Press+Room'),jdecode(''), jdecode('%2F98339.html'), 'true',[],'',''],
	['PAGE','16269',jdecode('Contact+Us'),jdecode(''), jdecode('%2F16269.html'), 'true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Vacation';
theSitetree.paletteFamily='F2DE5F';
theSitetree.keyvisualId='11847';
theSitetree.keyvisualName='kv_11847.jpg';
theSitetree.fontsetId='33165';
theSitetree.graphicsetId='14081';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='f8f8f8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vacation',
				paletteFamily: 	'F2DE5F',
				keyvisualId: 	'11847',
				keyvisualName: 	'kv_11847.jpg',
				fontsetId: 		'33165',
				graphicsetId: 	'14081',
				contentColor: 	'000000',
				contentBGColor: 'f8f8f8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Tahoma',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100928-070614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16206',
internalId:  '',
customField: '20100703-224016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100731-144520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16122',
internalId:  '',
customField: '20100703-230618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16164',
internalId:  '',
customField: '20100714-080214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16185',
internalId:  '',
customField: '20100731-145014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20110228-073242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16269',
internalId:  '',
customField: '20110228-075700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29722',
internalId:  '',
customField: '20120113-110742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20100731-144256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20100731-141820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20091111-110733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29764',
internalId:  '',
customField: '20100928-063554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40001',
internalId:  '',
customField: '20100714-134740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40022',
internalId:  '',
customField: '20090915-073429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125563',
internalId:  '',
customField: '20101002-153925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41122',
internalId:  '',
customField: '20100108-082745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41143',
internalId:  '',
customField: '20100731-145233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41164',
internalId:  '',
customField: '20100731-143646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61329',
internalId:  '',
customField: '20110228-072842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54929',
internalId:  '',
customField: '20090726-121909'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1942']={
webappId:    '7008',
documentId:  '54929',
internalId:  '1942',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58513',
internalId:  '',
customField: '20100731-142112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83939',
internalId:  '',
customField: '20100731-145454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84039',
internalId:  '',
customField: '20100731-144032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98339',
internalId:  '',
customField: '20110228-071632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99139',
internalId:  '',
customField: '20100928-071721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99160',
internalId:  '',
customField: '20100714-113315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105049',
internalId:  '',
customField: '20091111-084255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125626',
internalId:  '',
customField: '20101012-085409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125163',
internalId:  '',
customField: '20110228-075035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125205',
internalId:  '',
customField: '20101002-093530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126563',
internalId:  '',
customField: '20101002-161958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178696',
internalId:  '',
customField: '20110119-184051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143917',
internalId:  '',
customField: '20110228-072155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136596',
internalId:  '',
customField: '20101002-160256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '136496',
internalId:  '',
customField: '20110228-072302'
};
webappMappings['1501']=webappMappings['1501-20997382']={
webappId:    '1501',
documentId:  '5101',
internalId:  '20997382',
customField: '1501'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INZPCM';
var companyName   = 'www.PuertoNuevo.com';
var htmlTitle	  = 'Puerto+Nuevo+Lobster+Village%2C+Baja%2C+Mexico';
var metaKeywords  = 'lobster%2C+puerto+nuevo%2C+baja%2C+rosarito%2C+mexico%2C+lobster%2C+lobster+village%2C+puerto+nuevo+map%2C+puerto+nuevo+restaurants%2C+surfing';
var metaContents  = '+puerto+nuevo%2C+Rosarito%2C++lobster+village%2C+baja+california%2C+cexico+just+south+of+San+Diego%2C+Baja+Real+Estate%2C+Lobster%2C+Mexico';
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();
};

