/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','752',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','2901',jdecode('Zimmer+und+Preise'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','74401',jdecode('Kontakt'),jdecode(''),'/74401.html','true',[],'',''],
	['PAGE','2922',jdecode('Speisekarte'),jdecode(''),'/2922/index.html','true',[ 
		['PAGE','20801',jdecode('Getr%C3%A4nkekarte'),jdecode(''),'/2922/20801.html','true',[],'',''],
		['PAGE','32401',jdecode('Weine'),jdecode(''),'/2922/32401.html','true',[],'','']
	],'',''],
	['PAGE','2943',jdecode('Men%C3%BCvorschl%C3%A4ge'),jdecode(''),'/2943/index.html','true',[ 
		['PAGE','20822',jdecode('F%C3%BCr+besondere+Anl%C3%A4sse'),jdecode(''),'/2943/20822.html','true',[],'','']
	],'',''],
	['PAGE','2964',jdecode('Berg-Shop+Jaunpass'),jdecode(''),'/2964.html','true',[],'',''],
	['PAGE','49501',jdecode('Jobs'),jdecode(''),'/49501.html','true',[],'',''],
	['PAGE','38201',jdecode('Sommer+Bilder'),jdecode(''),'/38201.html','true',[],'',''],
	['PAGE','38222',jdecode('Winter+Bilder'),jdecode(''),'/38222.html','true',[],'',''],
	['PAGE','20201',jdecode('Webcam+'),jdecode(''),'/20201.html','true',[],'',''],
	['PAGE','12522',jdecode('Veranstaltungen'),jdecode(''),'/12522.html','true',[],'',''],
	['PAGE','15401',jdecode('Oldtimertreffen'),jdecode(''),'/15401.html','true',[],'',''],
	['PAGE','12543',jdecode('Links'),jdecode(''),'/12543.html','true',[],'',''],
	['PAGE','13401',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/13401.html','true',[],'',''],
	['PAGE','19006',jdecode('G%C3%A4stebuch'),jdecode(''),'/19006.html','true',[],'',''],
	['PAGE','19001',jdecode('Eintr%C3%A4ge'),jdecode(''),'/19001.html','false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1740';
theSitetree.keyvisualName='delikatessen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1740',
				keyvisualName: 	'delikatessen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20100607-150315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090428-122819'
};
webappMappings['1002']=webappMappings['1002-19006abw0x0in2frl']={
webappId:    '1002',
documentId:  '19006',
internalId:  '19006abw0x0in2frl',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '13401',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74401',
internalId:  '',
customField: '20100604-140933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100604-140854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100604-140822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20100604-141441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20100604-141544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20100604-141708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20822',
internalId:  '',
customField: '20100604-141743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2964',
internalId:  '',
customField: '20100604-142144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20100604-142404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20100604-142457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38222',
internalId:  '',
customField: '20100604-142525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20100604-142627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12522',
internalId:  '',
customField: '20100604-144151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20100604-144301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12543',
internalId:  '',
customField: '20100604-144429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20100604-144517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19006',
internalId:  '',
customField: '20100604-144545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19001',
internalId:  '',
customField: '20080323-135927'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2FRL';
var companyName   = 'Hotel+Des+Alpes';
var htmlTitle	  = 'Hotel+des+Alpes+Jaunpass';
var metaKeywords  = 'Hotel+Des+Alpes%2C+Restaurant%2C+Jaunpass%2C+Th%C3%B6ni+Peter%2C+Oldtimertraktorentreffen%2C+';
var metaContents  = 'Hotel+Des+Alpes%2C+Restaurant%2C+Jaunpass+Th%C3%B6ni+Peter%2C+Oldtimertraktorentreffen%2C';
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();
};
