/* [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','9101',jdecode('Home'),jdecode(''), jdecode('%2F9101.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('Gallery+1'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'',''],
	['PAGE','16912',jdecode('Gallery+2'),jdecode(''), jdecode('%2F16912.html'), 'true',[],'',''],
	['PAGE','15222',jdecode('Why+Boracay%3F'),jdecode(''), jdecode('%2F15222.html'), 'true',[],'',''],
	['PAGE','15243',jdecode('Price'),jdecode(''), jdecode('%2F15243.html'), 'true',[],'',''],
	['PAGE','15264',jdecode('Contact+us'),jdecode(''), jdecode('%2F15264.html'), 'true',[],'',''],
	['PAGE','15285',jdecode('Summary'),jdecode(''), jdecode('%2F15285.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1267';
theSitetree.keyvisualName='alte_moebel.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'powweb',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1267',
				keyvisualName: 	'alte_moebel.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'228',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20120102-021854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20120102-024059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15222',
internalId:  '',
customField: '20120102-022903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15264',
internalId:  '',
customField: '20090816-015136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15243',
internalId:  '',
customField: '20090816-012023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15285',
internalId:  '',
customField: '20090117-031709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16912',
internalId:  '',
customField: '20100205-014759'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9101',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INE28T';
var companyName   = 'BlueBird+Villa+is+For+Sale';
var htmlTitle	  = 'BORACAY+REAL+ESTATE+%2C+HOUSE%2C+VILLA%2C+SALE%2C+BLUEBIRD';
var metaKeywords  = 'Boracay+Real+Estate%2C+Boracay+island+Real+Estate%2C+Boracay+House+For+Sale%2C+Boracay+Island+House+For+Sale%2C++house+for+sale+Boracay%2C+Boracay+Villa+For+Sale%2CVilla+for+sale+Boracay%2C+Boracay+waterfront+villa+for+sale%2C+sea+view%2C+waterfront%2C+private+home%2C+vacation+home%2C+investment%2C+luxury%2C+villa%2C+real+estate%2C+windsurfing%2C+kite+surfing%2C+kiting%2C+tropical%2C+Philippines%2C+Boracay%2C+Asia%2C+South-East+Asia%2C+Holiday+destination%2C+paradise%2C+philippines+real+estate%2C+Philippines%2C+Nigi+Nigi%2C+villa%2CAccess%2CAccommodation%2CAccommodations%2CApartments%2CApartments+with-swimming+pool%2CApartments+with+view%2CApartments+with+Beach%2CBeach+Front%2CBeach+Homes%2CBeach+House%2CBeach+Houses%2CBeach+House+and+Lot%2C+Beach+Houses+Boracay%2CBeach+Houses+for+rent%2CBeach+Lots%2CBeach+Villas%2CBoracay%2CBoracay+Apartments%2CBoracay+Beach+House%2CBoracay+Homes%2CBoracay+investments%2CBoracay+Island+Boracay%2CBoracay+Island%2CBoracay+Land%2CBoracay+Real+Estate%2CBoracay+Villas%2CIsland+Golf+Boracay%2CFamily%2CFamily+Accommodation%2CFamily+House%2CFamily+Vacation+House+For+Sale%2CGolf+Rental%2CFamily+Reservation%2CGolf%2CGolf+Accommodation%2CGolf+Reservation%2CGolf+Shares%2CHoliday+Apartments+Holiday+Beach+House%2CHoliday+Homes%2CHoliday+Houses%2CHoliday+Villas%2CHome+Investments%2CHotel+Apartments%2CHouse+and+Lot+for+Sale%2CHouse+and+Lot+with-%2CIsland+Accommodations%2C+Island+Apartments%2C+Island+Beach+House%2CIsland+Golf%2CIsland+Homes%2CIsland+Houses%2C+Island+Investments%2CIsland+Property%2CIsland+Real+Estate%2CIsland+Villas%2CLand+for+Sale%2CLand+Investments%2CLand+with+ocean+view%2CLuxury%2C+Luxury+Golf%2CLuxury+Homes%2CLuxury+House+and+Lot%2CLuxury+Villas%2COcean+View+Golf%2COcean+View+Villas%2CParadise%2C+Paradise+Apartments%2C+Paradise+Beach+house%2CParadise+Golf%2CParadise+Homes%2CParadise+House+and+Lot%2CParadise+Land%2CParadise+Property%2CProperty+for+Sale%2C+Real+Estate%2CReal+Estate+Investments%2CRealtor%2C+Realty%2CReservation%2C+Reservations%2CResorts%2CResort+Golf%2CSPR+Inc+real+estate%2CTropical+Apartments%2CTropicana+Ocean-+Apartments%2CTropicana+Ocean+Villas%2CTropical+Beach+Houses%2CTropical+Homes%2CTropical+House+and+Lot%2CTropical+Land%2CTropical+Paradise%2CTropical+Resort+Island%2CTropical+Villas%2CUndeveloped+Land%2CVacation+Apartments%2CVacation+Homes%2CVacation+Houses%2C+Vacation+House+and+lot-+for+Sale%2CVacant+Land%2C+Villa%2CVillas%2CVilla+Accommodations%2CVillas+for+Sale%2CVilla+Reservations%2CVillas+for+rent%2C+White+beach%2C+Philippines+land%2CPhilippines+Rental%2CPhilippines+Beach+Rental%2CPhilippines+Investment%2CPhilippines+Real+Estate%2CRobinson+Beach+House%2CVilla+Kaloo%2CDiniwid+Beach%2CTete+A+Tete+Beach+House+Boracay+Island%2C+Boracay+Philippines%2C+Boracay+Beach%2C+Philippine+Tourism%2C+Boracay+Resort%2C+Boracay+Hotel%2C+Boracay+Accommodations%2C+Boracay+Scuba+Diving%2C+Boracay+Sports%2C+Boracay+Nightlife%2C+Borocay+Island%2C+Philippine+Scuba+Diving%2C+Philippine+Travel+Agency%2C+Philippine+Tours%2C+Philippine+Vacation%2C+Philippine+Beach%2C+Boracay+map%2C+Philippine+beach%2C+Philippine+Golf%2C+Boracay+tour%2C+Boracay+real+estate%2C+Boracay+wind+surfing%2C+Philippine+Sailing+';
var metaContents  = 'BORACAY+REAL+ESTATE+VILLA+FOR+SALE+WITH+STUNNING+VIEW.550+SQUARE+METERS%2C++4+BEDROOMS%2C+4+BATHROOMS%2C+FURNISHED';
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();
};

