/* [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','2046',jdecode('Home'),jdecode(''),'/2046.html','true',[],'',''],
	['PAGE','2077',jdecode('About+the+Apartment'),jdecode(''),'/2077.html','true',[],'',''],
	['PAGE','3501',jdecode('Activities+%26+Excursions'),jdecode(''),'/3501.html','true',[],'',''],
	['PAGE','8601',jdecode('Picture+Album'),jdecode(''),'/8601.html','true',[],'',''],
	['PAGE','13601',jdecode('Useful+Information'),jdecode(''),'/13601.html','true',[],'',''],
	['PAGE','13622',jdecode('Maps+%26+Weather'),jdecode(''),'/13622.html','true',[],'',''],
	['PAGE','3522',jdecode('Rates+%26+Availability'),jdecode(''),'/3522.html','true',[],'',''],
	['PAGE','2201',jdecode('Contact+Us+%26+Bookings'),jdecode(''),'/2201.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6884';
theSitetree.keyvisualName='kv_6884.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='354B86';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6884',
				keyvisualName: 	'kv_6884.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:  '2046',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20100223-104629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13622',
internalId:  '',
customField: '20091126-171701'
};
webappMappings['7008']=webappMappings['7008-65']={
webappId:    '7008',
documentId:  '2201',
internalId:  '65',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2046',
internalId:  '',
customField: '20091126-171904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2077',
internalId:  '',
customField: '20091126-171836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20080525-113719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20091126-171758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20091126-171626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20091126-171644'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN27EZ';
var companyName   = '2+Bedroom+Apartment+-+Hisaronu+Turkey';
var htmlTitle	  = 'St+Nicholas+Gardens+Apartment%2C+Hisaronu%2C+Olu+Deniz%2C+Turkey';
var metaKeywords  = 'Turkey%2C+Turkish%2C+Turkish+Sunshine%2C+Olu+Deniz%2C+Hisaronu%2C+2+bedroom%2C+Fethiye%2C+Turquoise+Coast%2C+Scuba+Diving%2C+Boat+Trips%2C+Jeep+Safari%2C+Kayaking%2C+Water+Sports%2C+Cycling%2C+Dalaman%2C+Kayakoy%2C+Saklikent+Gorge%2C+Snorkeling%2C+Sea+Fishing%2C+Horse+Riding%2C+Calis%2C+Ovacik%2C+Paragliding%2C+Cruise%2C+Beach%2C+Blue+Lagoon%2C+Bars%2C+Clubs%2C+Restaurants%2C+swimming+pool%2C+air+conditioning%2C+self+catering%2C+Dalaman%2C+airport+transfers%2C+turkey+map%2C+Quad+bikes%2C+white+water+rafting%2C+microlighting%2C+Turkish+bath%2C+st+nicholas+gardens+apartments%2C+saint+nicholas+gardens+apartments%2C+air+conditioned%2C+pool%2C+beach%2C+rent%2C+rental%2C+let%2C+short+term%2C+holiday%2C+2+bathroom%2C+vacation%2C+hisaronu+apartment%2C+oludeniz+apartment%2C+ovacik+apartment%2C+apartment+hisaronu';
var metaContents  = 'St+Nicholas+Gardens+Apartment+Hisaronu%2C+2+Bedroom%2C+2+Bathroom%2C+Fully+Air+Conditioned+Apartment+in+Central+Hisaronu%2C+Turkey.+2+minutes+walk+from+Shops%2C+Bars%2C+Restaurants+and+Clubs.';
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();
};
