/* [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','4607',jdecode('Home'),jdecode(''),'/4607.html','true',[],'',''],
	['PAGE','4664',jdecode('Langlauf'),jdecode(''),'/4664.html','true',[],'',''],
	['PAGE','4691',jdecode('Schneeschuhwandern'),jdecode(''),'/4691.html','true',[],'',''],
	['PAGE','7001',jdecode('Nordic+Walking'),jdecode(''),'/7001.html','true',[],'',''],
	['PAGE','53135',jdecode('Incentive%2FEvent'),jdecode(''),'/53135.html','true',[],'',''],
	['PAGE','53735',jdecode('Touren'),jdecode(''),'/53735.html','true',[],'',''],
	['PAGE','4718',jdecode('Bekleidung'),jdecode(''),'/4718.html','true',[],'',''],
	['PAGE','58444',jdecode('Klettersteig'),jdecode(''),'/58444.html','true',[],'',''],
	['PAGE','10701',jdecode('Anfahrt'),jdecode(''),'/10701.html','true',[],'',''],
	['PAGE','10972',jdecode('Kontakt'),jdecode(''),'/10972.html','true',[],'',''],
	['PAGE','9992',jdecode('G%C3%A4stebuch'),jdecode(''),'/9992/index.html','true',[ 
		['PAGE','9993',jdecode('Eintr%C3%A4ge'),jdecode(''),'/9992/9993.html','false',[],'','']
	],'',''],
	['PAGE','49804',jdecode('Jobs'),jdecode(''),'/49804.html','true',[],'',''],
	['PAGE','4799',jdecode('Links'),jdecode(''),'/4799.html','true',[],'',''],
	['PAGE','6701',jdecode('Fe+Wohnung+%2F+Fe+Haus'),jdecode(''),'/6701/index.html','true',[ 
		['PAGE','9607',jdecode('Orchis+2+Zi.+Wohnung'),jdecode(''),'/6701/9607.html','true',[],'',''],
		['PAGE','9634',jdecode('Orchis+Studio'),jdecode(''),'/6701/9634.html','true',[],'',''],
		['PAGE','20697',jdecode('Chalet+St.+Hubertus'),jdecode(''),'/6701/20697.html','true',[],'','']
	],'',''],
	['PAGE','82542',jdecode('Fotoalbum'),jdecode(''),'/82542.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1280';
theSitetree.keyvisualName='feder.jpg';
theSitetree.fontsetId='191';
theSitetree.graphicsetId='232';
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: 			'Profile',
				paletteFamily: 	'990000',
				keyvisualId: 	'1280',
				keyvisualName: 	'feder.jpg',
				fontsetId: 		'191',
				graphicsetId: 	'232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10701',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4607',
internalId:  '',
customField: '20100805-134353'
};
webappMappings['1002']=webappMappings['1002-9992ahp010inenp9']={
webappId:    '1002',
documentId:  '9992',
internalId:  '9992ahp010inenp9',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4607',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-f7d3abfc2aa5a660565dc2dd6f6c2e54']={
webappId:    '7060',
documentId:  '82542',
internalId:  'f7d3abfc2aa5a660565dc2dd6f6c2e54',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4664',
internalId:  '',
customField: '20100805-134719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4691',
internalId:  '',
customField: '20100805-135117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20090910-092500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53135',
internalId:  '',
customField: '20081230-173026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53735',
internalId:  '',
customField: '20090827-180505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4718',
internalId:  '',
customField: '20070326-203809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58444',
internalId:  '',
customField: '20080728-115347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20060725-170840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10972',
internalId:  '',
customField: '20091207-211301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9992',
internalId:  '',
customField: '20060529-180938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9993',
internalId:  '',
customField: '20060529-180938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49804',
internalId:  '',
customField: '20061217-173740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4799',
internalId:  '',
customField: '20100213-132058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20071112-211959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9607',
internalId:  '',
customField: '20090930-205223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9634',
internalId:  '',
customField: '20091001-191101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20697',
internalId:  '',
customField: '20091121-083753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82542',
internalId:  '',
customField: '20070720-170545'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INENP9';
var companyName   = 'Langlauf+und+Schneeschuhzentrum+Geeser+Arosa';
var htmlTitle	  = 'Geeser+Arosa';
var metaKeywords  = 'Langlauf%3B+Schneeschuh%3B+Schule%3B+Kurse%3B+Vermietung+%3BVerkauf%3B+Wintersport+Maran%3B+Geeser%3B+Arosa+%3BIncentive%3B+Ferienwohnung%3BFerienhaus%3BSchneeschuhtouren%3B+Swiss+nordic+School%3BKlettersteig%3BChalet%3BPirigen%3B+Langwies%3B+Telemark%3BTelemarkski%3B';
var metaContents  = 'Langlauf+und+Schneeschuh+Schule+Geeser+in+Maran+Arosa%2C+Mieten+und+Kaufen+aller+Ausr%C3%BCstungen+%3BFerienwohnung+%3BFerienhaus+%3B+Incentive%3BLanglaufschule%3Bswiss+nordic+school%3BKlettersteig%3BChalet%3BPirigen%3B+Langwies%3BTelemark%3BTelemarkski%3B';
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();
};
