/* [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(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','752',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F752.html'), 'true',[],'',''],
	['PAGE','2901',jdecode('Zimmer+und+Preise'),jdecode(''), jdecode('%2F2901.html'), 'true',[],'',''],
	['PAGE','74401',jdecode('Kontakt'),jdecode(''), jdecode('%2F74401.html'), 'true',[],'',''],
	['PAGE','2922',jdecode('Speisekarte'),jdecode(''), jdecode('%2F2922%2Findex.html'), 'true',[ 
		['PAGE','89601',jdecode('Wildspezialit%C3%A4ten'),jdecode(''), jdecode('%2F2922%2F89601.html'), 'true',[],'',''],
		['PAGE','20801',jdecode('Getr%C3%A4nkekarte'),jdecode(''), jdecode('%2F2922%2F20801.html'), 'true',[],'',''],
		['PAGE','32401',jdecode('Weine'),jdecode(''), jdecode('%2F2922%2F32401.html'), 'true',[],'','']
	],'',''],
	['PAGE','2943',jdecode('Men%C3%BCvorschl%C3%A4ge'),jdecode(''), jdecode('%2F2943%2Findex.html'), 'true',[ 
		['PAGE','20822',jdecode('F%C3%BCr+besondere+Anl%C3%A4sse'),jdecode(''), jdecode('%2F2943%2F20822.html'), 'true',[],'','']
	],'',''],
	['PAGE','2964',jdecode('Berg-Shop+Jaunpass'),jdecode(''), jdecode('%2F2964.html'), 'true',[],'',''],
	['PAGE','82901',jdecode('Bruch-Baragge'),jdecode(''), jdecode('%2F82901.html'), 'true',[],'',''],
	['PAGE','90901',jdecode('Langlauf'),jdecode(''), jdecode('%2F90901.html'), 'true',[],'',''],
	['PAGE','49501',jdecode('Jobs'),jdecode(''), jdecode('%2F49501.html'), 'true',[],'',''],
	['PAGE','38201',jdecode('Sommer+Bilder'),jdecode(''), jdecode('%2F38201.html'), 'true',[],'',''],
	['PAGE','38222',jdecode('Winter+Bilder'),jdecode(''), jdecode('%2F38222.html'), 'true',[],'',''],
	['PAGE','20201',jdecode('Webcam+'),jdecode(''), jdecode('%2F20201.html'), 'true',[],'',''],
	['PAGE','12522',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F12522%2Findex.html'), 'true',[ 
		['PAGE','84801',jdecode('Veranstaltungen+Des+Alpes'),jdecode(''), jdecode('%2F12522%2F84801.html'), 'true',[],'','']
	],'',''],
	['PAGE','15401',jdecode('Oldtimertreffen'),jdecode(''), jdecode('%2F15401.html'), 'true',[],'',''],
	['PAGE','12543',jdecode('Links'),jdecode(''), jdecode('%2F12543.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'',''],
	['PAGE','19006',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F19006.html'), 'true',[],'',''],
	['PAGE','19001',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F19001.html'), 'false',[],'','']];
var siteelementCount=24;
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 prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
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: '20111222-231615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20111125-155739'
};
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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74401',
internalId:  '',
customField: '20100604-140933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20110919-123354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100604-140822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20101221-150835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20101221-143224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20110222-095657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20822',
internalId:  '',
customField: '20100604-141743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2964',
internalId:  '',
customField: '20101206-193059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49501',
internalId:  '',
customField: '20110516-120317'
};
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: '20111110-150102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20110223-115710'
};
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'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82901',
internalId:  '',
customField: '20101214-165844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84801',
internalId:  '',
customField: '20111222-224452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89601',
internalId:  '',
customField: '20110919-151722'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '90901',
internalId:  '-',
customField: '20111115-102401'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.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();
};

