/* [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','1901',jdecode('Villa+Eleni'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','22701',jdecode('More+of+Eleni'),jdecode(''),'/22701.html','true',[],'',''],
	['PAGE','1952',jdecode('Agia+Galini'),jdecode(''),'/1952.html','true',[],'',''],
	['PAGE','1978',jdecode('Local+beaches'),jdecode(''),'/1978.html','true',[],'',''],
	['PAGE','2004',jdecode('Sightseeing+%3C60+mins'),jdecode(''),'/2004.html','true',[],'',''],
	['PAGE','2030',jdecode('Sightseeing+%3E60+mins'),jdecode(''),'/2030.html','true',[],'',''],
	['PAGE','2056',jdecode('Getting+there'),jdecode(''),'/2056.html','true',[],'',''],
	['PAGE','2134',jdecode('Rental+Information'),jdecode(''),'/2134.html','true',[],'',''],
	['PAGE','2108',jdecode('Contact+Us'),jdecode(''),'/2108.html','true',[],'',''],
	['PAGE','2160',jdecode('Links'),jdecode(''),'/2160.html','true',[],'',''],
	['PAGE','2186',jdecode('Guestbook'),jdecode(''),'/2186.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Travel';
theSitetree.paletteFamily='4060B8';
theSitetree.keyvisualId='6963';
theSitetree.keyvisualName='kv_6963.jpg';
theSitetree.fontsetId='13627';
theSitetree.graphicsetId='12072';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4060B8';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Travel',
				paletteFamily: 	'4060B8',
				keyvisualId: 	'6963',
				keyvisualName: 	'kv_6963.jpg',
				fontsetId: 		'13627',
				graphicsetId: 	'12072',
				contentColor: 	'FFFFFF',
				contentBGColor: '4060B8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9DB0E2',
				e_color: 		'9DB0E2',
				f_color: 		'9DB0E2',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-ae6cd01b25fff352111371c8e52e400c']={
webappId:    '7060',
documentId:  '1952',
internalId:  'ae6cd01b25fff352111371c8e52e400c',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-2372']={
webappId:    '7008',
documentId:  '2108',
internalId:  '2372',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100425-121425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20091124-171054'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-7316137']={
webappId:    '1501',
documentId:  '1901',
internalId:  '7316137',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20091124-170759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2004',
internalId:  '',
customField: '20100302-123737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2030',
internalId:  '',
customField: '20080903-223357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2056',
internalId:  '',
customField: '20100307-223908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100425-121546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2108',
internalId:  '',
customField: '20080903-113818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2134',
internalId:  '',
customField: '20100425-113323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2160',
internalId:  '',
customField: '20100307-224015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2186',
internalId:  '',
customField: '20100425-112554'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE5HF';
var companyName   = 'Villa+Eleni+-+in+beautiful+Agia+Galini%2C+South+Crete';
var htmlTitle	  = 'Welcome+to+Villa+Eleni';
var metaKeywords  = 'Villa%2C+Crete%2C+Ag+GAlini%2C+Eleni%2C+holiday%2C+self+catering%2C+swimming+pool%2C+secluded.';
var metaContents  = 'Villa+Eleni+is+in+Ag+Galini+in+South+crete.+More+secluded+than+the+tourist+areas+of+the+north%2C+this+is+an+ideal+location+to+get+away+and+relax.+Several+nice+beaches+are+nearby+as+is+the+beautiful+harbor+town+of+Agia+GAlini%2C+home+of+the+story+of+Icarus+and+Daedelus.';
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();
};
