/* [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','79501',jdecode('Home'),jdecode(''), jdecode('%2F79501.html'), 'true',[],'',''],
	['PAGE','4598',jdecode('Unser+Haus'),jdecode(''), jdecode('%2F4598.html'), 'true',[],'',''],
	['PAGE','4655',jdecode('Hotel'),jdecode(''), jdecode('%2F4655%2Findex.html'), 'true',[ 
		['PAGE','26142',jdecode('Lage+'),jdecode(''), jdecode('%2F4655%2F26142.html'), 'true',[],'',''],
		['PAGE','6425',jdecode('Jobs'),jdecode(''), jdecode('%2F4655%2F6425.html'), 'true',[],'','']
	],'',''],
	['PAGE','4682',jdecode('Zimmer'),jdecode(''), jdecode('%2F4682%2Findex.html'), 'true',[ 
		['PAGE','5382',jdecode('Preise'),jdecode(''), jdecode('%2F4682%2F5382.html'), 'true',[],'',''],
		['PAGE','129401',jdecode('Vertragsbestimmungen'),jdecode(''), jdecode('%2F4682%2F129401.html'), 'true',[],'',''],
		['PAGE','12512',jdecode('Internetbooking'),jdecode(''), jdecode('%2F4682%2F12512.html'), 'true',[],'','']
	],'',''],
	['PAGE','25722',jdecode('Restaurant'),jdecode(''), jdecode('%2F25722%2Findex.html'), 'true',[ 
		['PAGE','5301',jdecode('Tagesteller'),jdecode(''), jdecode('%2F25722%2F5301.html'), 'true',[],'',''],
		['PAGE','99101',jdecode('Menukarte'),jdecode(''), jdecode('%2F25722%2F99101.html'), 'true',[],'',''],
		['PAGE','102001',jdecode('Pizza'),jdecode(''), jdecode('%2F25722%2F102001.html'), 'true',[],'',''],
		['PAGE','5328',jdecode('Menu+Gruppen'),jdecode(''), jdecode('%2F25722%2F5328.html'), 'true',[],'',''],
		['PAGE','124601',jdecode('Wildkarte'),jdecode(''), jdecode('%2F25722%2F124601.html'), 'true',[],'','']
	],'',''],
	['PAGE','96001',jdecode('Panoramasaal'),jdecode(''), jdecode('%2F96001.html'), 'true',[],'',''],
	['PAGE','4790',jdecode('Adresse+Telefon'),jdecode(''), jdecode('%2F4790.html'), 'true',[],'',''],
	['PAGE','105101',jdecode('Kontakt'),jdecode(''), jdecode('%2F105101.html'), 'true',[],'',''],
	['PAGE','104301',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F104301.html'), 'true',[],'',''],
	['PAGE','12658',jdecode('Photoalbum'),jdecode(''), jdecode('%2F12658.html'), 'true',[],'',''],
	['PAGE','26205',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F26205.html'), 'true',[],'',''],
	['PAGE','107601',jdecode('Map'),jdecode(''), jdecode('%2F107601.html'), 'true',[],'',''],
	['PAGE','26163',jdecode('Links'),jdecode(''), jdecode('%2F26163.html'), 'true',[],'',''],
	['PAGE','106301',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F106301.html'), 'true',[],'',''],
	['PAGE','111201',jdecode('Tipps+'),jdecode(''), jdecode('%2F111201.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='86862D';
theSitetree.keyvisualId='936';
theSitetree.keyvisualName='weisswein.jpg';
theSitetree.fontsetId='167';
theSitetree.graphicsetId='196';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'NewYork',
				paletteFamily: 	'86862D',
				keyvisualId: 	'936',
				keyvisualName: 	'weisswein.jpg',
				fontsetId: 		'167',
				graphicsetId: 	'196',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'86862D',
				c_color: 		'000000',
				d_color: 		'2C331B',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '79501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79501',
internalId:  '',
customField: '20070707-222213'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '106301',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['7008']=webappMappings['7008-5116']={
webappId:    '7008',
documentId:  '105101',
internalId:  '5116',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20070830-200226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5382',
internalId:  '',
customField: '20101122-194617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129401',
internalId:  '',
customField: '20090428-135346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25722',
internalId:  '',
customField: '20090428-144058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20070906-125230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20090428-143907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20070704-152642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124601',
internalId:  '',
customField: '20110810-213411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104301',
internalId:  '',
customField: '20090428-144316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12658',
internalId:  '',
customField: '20090829-212750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26205',
internalId:  '',
customField: '20110114-153128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111201',
internalId:  '',
customField: '20080317-145609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26142',
internalId:  '',
customField: '20070707-222418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6425',
internalId:  '',
customField: '20080319-155817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12512',
internalId:  '',
customField: '20070707-222503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99101',
internalId:  '',
customField: '20110114-152753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102001',
internalId:  '',
customField: '20081213-125219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5328',
internalId:  '',
customField: '20110114-134504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96001',
internalId:  '',
customField: '20070830-190517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20070707-222820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105101',
internalId:  '',
customField: '20070705-012536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107601',
internalId:  '',
customField: '20070707-212549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26163',
internalId:  '',
customField: '20080122-230209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106301',
internalId:  '',
customField: '20070705-020123'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXHAW';
var companyName   = 'Hotel+Restaurant+Reuti';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

