/* [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 theSitetree=[ 
	['PAGE','4559',jdecode('Home'),jdecode(''),'/4559.html','true',[],''],
	['PAGE','55890',jdecode('todo+sin+punto'),jdecode(''),'/55890.html','true',[],''],
	['PAGE','5079',jdecode('casa+sin+punto+'),jdecode(''),'/5079.html','true',[],''],
	['PAGE','10803',jdecode('Cuartos+%2F+Rooms'),jdecode(''),'/10803.html','true',[],''],
	['PAGE','51505',jdecode('casa+sin+punto+Laguna'),jdecode(''),'/51505.html','true',[],''],
	['PAGE','10830',jdecode('A+comer+%2F+To+eat'),jdecode(''),'/10830.html','true',[],''],
	['PAGE','15641',jdecode('frutas+%2F+fruits'),jdecode(''),'/15641.html','true',[],''],
	['PAGE','10857',jdecode('Excursiones+%2F+Tours'),jdecode(''),'/10857.html','true',[],''],
	['PAGE','46805',jdecode('Fotos+de+Panam%C3%A1'),jdecode(''),'/46805.html','true',[],''],
	['PAGE','4697',jdecode('Contacto+%2F+Contact+e-mail'),jdecode(''),'/4697/index.html','true',[ 
		['PAGE','16304',jdecode('Contacto+%2F+Contact+e-mail+%28follow+up+page%29'),jdecode(''),'/4697/16304.html','false',[],'']
	],''],
	['PAGE','55594',jdecode('GuestBookAlbumdeVisitantes'),jdecode(''),'/55594/index.html','true',[ 
		['PAGE','55593',jdecode('leer+lesen+read'),jdecode(''),'/55594/55593.html','false',[],'']
	],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='40710E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='154';
theSitetree.graphicsetId='166';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCFCF4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Natural',
				paletteFamily: 	'40710E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'154',
				graphicsetId: 	'166',
				contentColor: 	'000000',
				contentBGColor: 'FCFCF4',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'40710E',
				b_color: 		'00CC00',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4559',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15641',
internalId:  '',
customField: '20080214-220913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4559',
internalId:  '',
customField: '20090320-135848'
};
webappMappings['1002']=webappMappings['1002-55594abw0x0inxlxb']={
webappId:    '1002',
documentId:  '55594',
internalId:  '55594abw0x0inxlxb',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-2402']={
webappId:    '7008',
documentId:  '4697',
internalId:  '2402',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55890',
internalId:  '',
customField: '20090314-035910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5079',
internalId:  '',
customField: '20080825-225259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10803',
internalId:  '',
customField: '20061226-223306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51505',
internalId:  '',
customField: '20060527-214654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10830',
internalId:  '',
customField: '20080315-013334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10857',
internalId:  '',
customField: '20070216-145125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46805',
internalId:  '',
customField: '20060215-185542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4697',
internalId:  '',
customField: '20060206-190932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16304',
internalId:  '',
customField: '20050114-131547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55594',
internalId:  '',
customField: '20061111-002208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55593',
internalId:  '',
customField: '20061111-003208'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXLXB';
var companyName   = 'hotel+tipo+boutique+casa+sin+punto';
var htmlTitle	  = 'casa+sin+punto+Hotel+Panama+Playa+Beach+Vacaciones+Holidays+Excursiones+Tours';
var metaKeywords  = 'casa+sin+punto+-+vacaciones+-+holidays+-+ferien+-+strand+-+playa+-+beach+-+tours+-+exursiones+-+hostal+-+panama+-+pacific+-+erlebnis+-+aventura+';
var metaContents  = 'hostal+familiar+-+casa+-+hotel+-+Zimmer+mit+Fr%C3%BChst%C3%BCck+-+hospedaje+-+desayuno+-+Strandferien+-+Regenwald+-+Ferien+-+Gem%C3%BCtllichkeit+-+pers%C3%B6nliche+Ferien+-+Holidays+beach+family+-+Kinderabenteur+-+';
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();
};
