/* [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','9401',jdecode('Begr%C3%BCssungsfilm'),jdecode(''),'/9401.html','true',[],'',''],
	['PAGE','9494',jdecode('Hits'),jdecode(''),'/9494.html','true',[],'',''],
	['PAGE','30312',jdecode('Monats+-+Aktionen'),jdecode(''),'/30312.html','true',[],'',''],
	['PAGE','18601',jdecode('Aus+unserer+K%C3%BCche'),jdecode(''),'/18601.html','true',[],'',''],
	['PAGE','27512',jdecode('Aktuell'),jdecode(''),'/27512.html','true',[],'',''],
	['PAGE','13001',jdecode('Ausflugsziel'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','31412',jdecode('Flugtage+Film%3A'),jdecode(''),'/31412.html','true',[],'',''],
	['PAGE','20001',jdecode('Demn%C3%A4chst'),jdecode(''),'/20001.html','true',[],'',''],
	['PAGE','9452',jdecode('%C3%96ffnungszeiten'),jdecode(''),'/9452.html','true',[],'',''],
	['PAGE','28712',jdecode('Wegbeschreibung'),jdecode(''),'/28712.html','true',[],'',''],
	['PAGE','10401',jdecode('Kontakt'),jdecode(''),'/10401.html','true',[],'',''],
	['PAGE','20912',jdecode('Jobs'),jdecode(''),'/20912.html','true',[],'',''],
	['PAGE','26612',jdecode('Webcam+Schupfart'),jdecode(''),'/26612.html','true',[],'',''],
	['PAGE','30112',jdecode('Das+Gl%C3%BCcksrad'),jdecode(''),'/30112.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='C9DFEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10432';
theSitetree.graphicsetId='10771';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F0F2F4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'C9DFEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10432',
				graphicsetId: 	'10771',
				contentColor: 	'692643',
				contentBGColor: 'F0F2F4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100612-161022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27512',
internalId:  '',
customField: '20100613-093606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20100613-093523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9452',
internalId:  '',
customField: '20100612-172937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9494',
internalId:  '',
customField: '20100612-161540'
};
webappMappings['7008']=webappMappings['7008-2737']={
webappId:    '7008',
documentId:  '10401',
internalId:  '2737',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20100328-201114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20100402-222331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20100720-170447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20912',
internalId:  '',
customField: '20100612-162553'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26612',
internalId:  '',
customField: '20100328-205457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28712',
internalId:  '',
customField: '20100420-225959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30312',
internalId:  '',
customField: '20100729-131552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31412',
internalId:  '',
customField: '20100730-154642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30112',
internalId:  '',
customField: '20100612-162814'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHP340INVN6K';
var companyName   = 'Restaurant+Airpick+in+Schupfart+%28AG%29';
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();
};
