/* [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','4599',jdecode('Home'),jdecode(''),'/4599.html','true',[],'',''],
	['PAGE','19338',jdecode('Deutsch'),jdecode(''),'/19338/index.html','true',[ 
		['PAGE','4710',jdecode('Zimmer'),jdecode(''),'/19338/4710.html','true',[],'',''],
		['PAGE','84392',jdecode('Fr%C3%BChst%C3%BCck'),jdecode(''),'/19338/84392.html','true',[],'',''],
		['PAGE','4872',jdecode('Preisliste%2FProspekt'),jdecode(''),'/19338/4872.html','true',[],'',''],
		['PAGE','14472',jdecode('Angebote'),jdecode(''),'/19338/14472.html','false',[],'',''],
		['PAGE','4926',jdecode('Reservierung'),jdecode(''),'/19338/4926.html','true',[],'',''],
		['PAGE','19604',jdecode('Online-Anfragen+%28Form+followup+page%29'),jdecode(''),'/19338/19604.html','false',[],'',''],
		['PAGE','15019',jdecode('Anfahrt'),jdecode(''),'/19338/15019.html','true',[],'',''],
		['PAGE','94678',jdecode('Routenplaner'),jdecode(''),'/19338/94678.html','true',[],'',''],
		['PAGE','4845',jdecode('Links'),jdecode(''),'/19338/4845.html','true',[],'',''],
		['PAGE','94558',jdecode('Choice+Hotels'),jdecode(''),'/19338/94558.html','true',[],'','']
	],'',''],
	['PAGE','18504',jdecode('English'),jdecode(''),'/18504/index.html','true',[ 
		['PAGE','18531',jdecode('rooms'),jdecode(''),'/18504/18531.html','true',[],'',''],
		['PAGE','84419',jdecode('breakfast'),jdecode(''),'/18504/84419.html','true',[],'',''],
		['PAGE','18558',jdecode('prices%2Fhotel+brochure'),jdecode(''),'/18504/18558.html','true',[],'',''],
		['PAGE','18585',jdecode('specials'),jdecode(''),'/18504/18585.html','false',[],'',''],
		['PAGE','18612',jdecode('reservation'),jdecode(''),'/18504/18612/index.html','true',[ 
			['PAGE','72190',jdecode('request+%28Form+followup+page%29'),jdecode(''),'/18504/18612/72190.html','false',[],'','']
		],'',''],
		['PAGE','18639',jdecode('map'),jdecode(''),'/18504/18639.html','true',[],'',''],
		['PAGE','18666',jdecode('links'),jdecode(''),'/18504/18666.html','true',[],'','']
	],'',''],
	['PAGE','18693',jdecode('Italiano'),jdecode(''),'/18693/index.html','true',[ 
		['PAGE','18720',jdecode('camere'),jdecode(''),'/18693/18720.html','true',[],'',''],
		['PAGE','84446',jdecode('piccola+colazione'),jdecode(''),'/18693/84446.html','true',[],'',''],
		['PAGE','18747',jdecode('prezzi%2Fdepliant'),jdecode(''),'/18693/18747.html','true',[],'',''],
		['PAGE','18801',jdecode('offerte+speciali'),jdecode(''),'/18693/18801.html','false',[],'',''],
		['PAGE','18774',jdecode('prenotazione'),jdecode(''),'/18693/18774/index.html','true',[ 
			['PAGE','71698',jdecode('richieste+%28Form+followup+page%29'),jdecode(''),'/18693/18774/71698.html','false',[],'','']
		],'',''],
		['PAGE','18828',jdecode('cartina+di+Coira'),jdecode(''),'/18693/18828.html','true',[],'',''],
		['PAGE','18855',jdecode('links'),jdecode(''),'/18693/18855.html','true',[],'','']
	],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10829';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10829',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15019',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['1009']=webappMappings['1009-6432629']={
webappId:    '1009',
documentId:  '19604',
internalId:  '6432629',
customField: 'isFollowupPage:true;documentId:4926;'
};
webappMappings['7008']=webappMappings['7008-3560']={
webappId:    '7008',
documentId:  '18774',
internalId:  '3560',
customField: 'language:de;country:CH;'
};
webappMappings['1009']=webappMappings['1009-6456282']={
webappId:    '1009',
documentId:  '71698',
internalId:  '6456282',
customField: 'isFollowupPage:true;documentId:18774;'
};
webappMappings['7008']=webappMappings['7008-3561']={
webappId:    '7008',
documentId:  '18612',
internalId:  '3561',
customField: 'language:de;country:CH;'
};
webappMappings['1009']=webappMappings['1009-6457793']={
webappId:    '1009',
documentId:  '72190',
internalId:  '6457793',
customField: 'isFollowupPage:true;documentId:18612;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20100320-111725'
};
webappMappings['7008']=webappMappings['7008-3559']={
webappId:    '7008',
documentId:  '4926',
internalId:  '3559',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19338',
internalId:  '',
customField: '20100220-134725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20100220-134840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84392',
internalId:  '',
customField: '20080215-190423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4872',
internalId:  '',
customField: '20100320-113730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14472',
internalId:  '',
customField: '20100328-174752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4926',
internalId:  '',
customField: '20100320-111809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19604',
internalId:  '',
customField: '20060324-095041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15019',
internalId:  '',
customField: '20091117-221938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4845',
internalId:  '',
customField: '20100227-202637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18504',
internalId:  '',
customField: '20100220-135216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18531',
internalId:  '',
customField: '20100220-135100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84419',
internalId:  '',
customField: '20080210-184443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18558',
internalId:  '',
customField: '20100320-114134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18585',
internalId:  '',
customField: '20090825-114930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18612',
internalId:  '',
customField: '20090726-185100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72190',
internalId:  '',
customField: '20060327-090443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18639',
internalId:  '',
customField: '20100314-094813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18666',
internalId:  '',
customField: '20100227-202704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18693',
internalId:  '',
customField: '20100227-181304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18720',
internalId:  '',
customField: '20100227-202930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84446',
internalId:  '',
customField: '20100314-095529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18747',
internalId:  '',
customField: '20100320-114858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20090825-115008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18774',
internalId:  '',
customField: '20090726-185225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71698',
internalId:  '',
customField: '20060326-195217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18828',
internalId:  '',
customField: '20100314-095435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18855',
internalId:  '',
customField: '20100227-202825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94678',
internalId:  '',
customField: '20091127-143018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94558',
internalId:  '',
customField: '20100320-111956'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '94678',
internalId:  'routing',
customField: 'de_CH'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXE1L';
var companyName   = 'Comfort+Hotel+Post';
var htmlTitle	  = '';
var metaKeywords  = 'Hotel+Chur+%EF%BF%BDbernachtung';
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();
};
