/* [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','1446',jdecode('Home'),jdecode(''),'/1446.html','true',[],'',''],
	['PAGE','1467',jdecode('Reservation'),jdecode(''),'/1467.html','true',[],'',''],
	['PAGE','1488',jdecode('Weitere+Fotos'),jdecode(''),'/1488.html','true',[],'',''],
	['PAGE','1509',jdecode('Mein+Blog'),jdecode(''),'/1509.html','true',[],'',''],
	['PAGE','1520',jdecode('G%C3%A4stebuch'),jdecode(''),'/1520.html','true',[],'',''],
	['PAGE','1541',jdecode('Kontakt'),jdecode(''),'/1541.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Frugality';
theSitetree.paletteFamily='4E5BBA';
theSitetree.keyvisualId='7713';
theSitetree.keyvisualName='kv_7713.jpg';
theSitetree.fontsetId='16749';
theSitetree.graphicsetId='12256';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Frugality',
				paletteFamily: 	'4E5BBA',
				keyvisualId: 	'7713',
				keyvisualName: 	'kv_7713.jpg',
				fontsetId: 		'16749',
				graphicsetId: 	'12256',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-ce291b39c9ae21127d6a7f1652f4e91f']={
webappId:    '7060',
documentId:  '1488',
internalId:  'ce291b39c9ae21127d6a7f1652f4e91f',
customField: 'language:de;country:CH;'
};
webappMappings['7050']=webappMappings['7050-176']={
webappId:    '7050',
documentId:  '1509',
internalId:  '176',
customField: 'language:de;country:CH;'
};
webappMappings['7002']=webappMappings['7002-268']={
webappId:    '7002',
documentId:  '1520',
internalId:  '268',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-315']={
webappId:    '7008',
documentId:  '1541',
internalId:  '315',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1446',
internalId:  '',
customField: '20100421-092149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1467',
internalId:  '',
customField: '20110912-162945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1488',
internalId:  '',
customField: '20081024-144140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1509',
internalId:  '',
customField: '20081024-144140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1520',
internalId:  '',
customField: '20081024-144141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1541',
internalId:  '',
customField: '20090204-172830'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1446',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2J1K';
var companyName   = 'Mieten+Sie+sich+Ferien%21+2.5+Zi+Dachwohnung+im+Chalet+DESMIN';
var htmlTitle	  = 'Ferienwohnung+Desmin+Fiesch+Fiescheralp+Wallis+Schweiz+Bettmeralp+Riederalp+Skifahren+Urlaub+Aletsch+Aletschgletscher+Eggishorn';
var metaKeywords  = 'Skiurlaub%2C+Ferien%2C+Schneesicher%2C+Fiescheralp%2C+Bettmeralp%2C+Riederalp%2C+Goms%2C+Wallis%2C+Schweiz%2C+Aletschgletscher%2C+Berge%2C+Alpen%2C+Ferien%2C+Schnee%2C+Schneeurlaub%2C+Mietwohnung%2C+Chalet%2C+Ferienwohnung%2C+Fiesch%2C+Skischule%2C+Skifahren%2C+Eggishorn%2C+Hotel%2C+Unterkunft%2C+Desmin%2C+Jungfraujoch%2C+Zermatt%2C+Matterhorn%2C+Gletscher%2C+Villa+Cassel%2C+Snowboard%2C++Erholung%2C+Wellness%2C+ebookers%2C+airberlin%2C+Lufthansa%2C+swiss%2C+Luzern%2C+Z%C3%BCrich%2C+Genf%2C+Berg%2C+Bergen%2C+Appartements%2C+Ferienappartements%2C+Skilifte%2C+Gondeln%2C+Seilbahn%2C+Gondelbahn%2C+Autofrei%2C+Luft%2C+frische+Luft%2C+Umweltschutz%2C+Weltnaturerbe%2C+Aletsch%2C+Aletschwald%2C+Skipisten%2C+Schneepisten%2C+fiescheralp.org%2C+IG+Fiescheralp%2C+Imhasly%2C+Touristen%2C+Tourismus%2C+Alpensicht%2C+Silvester%2C+Weihnachten%2C+Winterurlaub%2C+Winterferien%2C+Weihnachtsferien%2C+Open+Air%2C+Winter+Opening%2C++Alpenmusik%2C+Sommerurlaub%2C+Sommerferien%2C+Erholung%2C+Swissalps%2C+Schweizer+Alpen%2C+Schweizer+Berge%2C+Schweizer+Hotels%2C+Real+estate%2C+Swiss+real+Estate%2C+Swisshome%2C+Familienurlaub%2C+';
var metaContents  = 'Skiurlaub+Ferien+Schneesicher+Fiescheralp+Bettmeralp+Riederalp+Goms+Wallis+Schweiz+Aletschgletscher+Berge+Alpen+Ferien+Schnee+Schneeurlaub+Mietwohnung+Chalet+Ferienwohnung+Fiesch+Skischule+Skifahren+';
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();
};

