/* [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','1242',jdecode('Home'),jdecode(''),'/1242.html','true',[],'',''],
	['PAGE','1299',jdecode('Unser+Haus'),jdecode(''),'/1299/index.html','true',[ 
		['PAGE','1326',jdecode('Zimmer++++Room'),jdecode(''),'/1299/1326.html','true',[],'',''],
		['PAGE','1353',jdecode('Umgebung'),jdecode(''),'/1299/1353.html','true',[],'',''],
		['PAGE','3334',jdecode('Fuerstliche+Momente'),jdecode(''),'/1299/3334.html','true',[],'','']
	],'',''],
	['PAGE','1380',jdecode('Preise'),jdecode(''),'/1380.html','true',[],'',''],
	['PAGE','1407',jdecode('Anreise'),jdecode(''),'/1407.html','true',[],'',''],
	['PAGE','1434',jdecode('Kontakt'),jdecode(''),'/1434/index.html','true',[ 
		['PAGE','35521',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/1434/35521.html','false',[],'','']
	],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Garden';
theSitetree.paletteFamily='CBAFA5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='79';
theSitetree.graphicsetId='100';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Garden',
				paletteFamily: 	'CBAFA5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'79',
				graphicsetId: 	'100',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'CBAFA5',
				b_color: 		'DBCBC4',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1242',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1242',
internalId:  '',
customField: '20100104-191542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1380',
internalId:  '',
customField: '20100109-084449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1299',
internalId:  '',
customField: '20100109-084148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1326',
internalId:  '',
customField: '20070830-174927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1353',
internalId:  '',
customField: '20100108-161902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3334',
internalId:  '',
customField: '20090313-114427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1407',
internalId:  '',
customField: '20060830-135113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1434',
internalId:  '',
customField: '20060109-162724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35521',
internalId:  '',
customField: '20030302-062407'
};
webappMappings['7008']=webappMappings['7008-2532']={
webappId:    '7008',
documentId:  '1434',
internalId:  '2532',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXVF';
var companyName   = 'Liechtenstein%2C+Pension';
var htmlTitle	  = 'Liechtenstein%2C+Pension+Buechel';
var metaKeywords  = 'Liechtenstein%2C+Pension%2C+Buechel%2C+Zimmer%2C+Room%2C+Chambre%2C+Privatpension%2C+Unterkunft%2C+Accommodation%2C+Logement%2C+Fruehstueck%2C+Ferien%2C+Urlaub%2C+Reisen%2C+Wandern%2C+Klettern%2C+Sport%2C+Sommer%2C+Winter%2C+See%2C+schwimmen%2C+reiten%2C+Golf%2C+Tennis%2C+Erholung%2C+Fuerstentum%2C+Principality%2C+Hotel%2C+Gaestehaus%2C+Briefmarken%2C+Kunst%2C+Museum%2C+Bodensee%2C+Rheintal%2C++Schellenberg%2C+Kleinstaat%2C+Vaduz%2C+Privatvermieter%2C+Angeln%2C+Schiff%2C+Boot%2C+biken%2C+Wintersport%2C+Alpen%2C+Bergbahn%2C+Betten%2C+Natur%2C+Berge%2C+li%2C+FL%2C+ruhige%2C+Lage%2C+zentral%2C+familiaer%2C+Apartments%2C+Kinder%2C+Vermietung%2C+Tourismus%2C+Wanderferien%2C+Ski%2C+Sommerferien%2C+Winterferien';
var metaContents  = 'Willkommen+im+Fuerstentum+Liechtenstein+Pension+Buechel%2C+Privatpension+mit+4+Zimmer%2C+9+Betten.+Ruhige+zentrale+Lage+im+Herzen+der+Alpen.+Ihre+Unterkunft+fuer+Urlaub%2C+Ferien%2C+Reisen%2C+Erholung%2C+Sport.';
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();
};
