/* [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','19101',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F19101.html'), 'true',[],'',''],
	['PAGE','19215',jdecode('Erlebnishof'),jdecode(''), jdecode('%2F19215%2Findex.html'), 'true',[ 
		['PAGE','23801',jdecode('Tiere'),jdecode(''), jdecode('%2F19215%2F23801.html'), 'true',[],'',''],
		['PAGE','23843',jdecode('Ihr+Anlass'),jdecode(''), jdecode('%2F19215%2F23843.html'), 'true',[],'','']
	],'',''],
	['PAGE','19236',jdecode('Pferdepension'),jdecode(''), jdecode('%2F19236.html'), 'true',[],'',''],
	['PAGE','23864',jdecode('Pfauenziegen'),jdecode(''), jdecode('%2F23864%2Findex.html'), 'true',[ 
		['PAGE','23885',jdecode('zu+verkauf'),jdecode(''), jdecode('%2F23864%2F23885.html'), 'true',[],'',''],
		['PAGE','29501',jdecode('Werden+Sie+G%C3%B6nner'),jdecode(''), jdecode('%2F23864%2F29501.html'), 'true',[],'','']
	],'',''],
	['PAGE','19152',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F19152%2Findex.html'), 'true',[ 
		['PAGE','19173',jdecode('anstehende+Anl%C3%A4sse'),jdecode(''), jdecode('%2F19152%2F19173.html'), 'true',[],'',''],
		['PAGE','23906',jdecode('vergangene+Anl%C3%A4sse'),jdecode(''), jdecode('%2F19152%2F23906.html'), 'true',[],'','']
	],'',''],
	['PAGE','23822',jdecode('Gartenbahn+LGB'),jdecode(''), jdecode('%2F23822.html'), 'true',[],'',''],
	['PAGE','19194',jdecode('Bilder'),jdecode(''), jdecode('%2F19194.html'), 'true',[],'',''],
	['PAGE','19257',jdecode('Kontakt'),jdecode(''), jdecode('%2F19257.html'), 'true',[],'',''],
	['PAGE','19278',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F19278.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Guest';
theSitetree.paletteFamily='B1C6D8';
theSitetree.keyvisualId='11774';
theSitetree.keyvisualName='kv_11774.jpg';
theSitetree.fontsetId='33049';
theSitetree.graphicsetId='14028';
theSitetree.contentColor='003366';
theSitetree.contentBGColor='E4E9F1';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Guest',
				paletteFamily: 	'B1C6D8',
				keyvisualId: 	'11774',
				keyvisualName: 	'kv_11774.jpg',
				fontsetId: 		'33049',
				graphicsetId: 	'14028',
				contentColor: 	'003366',
				contentBGColor: 'E4E9F1',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-19278abw1x0inew0w']={
webappId:    '1002',
documentId:  '19278',
internalId:  '19278abw1x0inew0w',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20120221-135840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19152',
internalId:  '',
customField: '20110908-090037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19173',
internalId:  '',
customField: '20120221-141118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19194',
internalId:  '',
customField: '20110611-230029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19257',
internalId:  '',
customField: '20110304-210259'
};
webappMappings['7008']=webappMappings['7008-11074']={
webappId:    '7008',
documentId:  '19257',
internalId:  '11074',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19215',
internalId:  '',
customField: '20110405-212839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19236',
internalId:  '',
customField: '20101122-211520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19278',
internalId:  '',
customField: '20111207-191622'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20110106-171433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23822',
internalId:  '',
customField: '20120221-144937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23843',
internalId:  '',
customField: '20110807-212806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23864',
internalId:  '',
customField: '20110405-143437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23885',
internalId:  '',
customField: '20110521-184514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23906',
internalId:  '',
customField: '20120221-140305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29501',
internalId:  '',
customField: '20110114-215532'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INEW0W';
var companyName   = 'Erlebnishof+Wieseli';
var htmlTitle	  = 'Erlebnishof+Wieseli';
var metaKeywords  = 'Erlebnishof+Wieseli+Diegten+Hof+4457+Pferde+Hund+Hun+Katze+Ziege+Pfauenziegen+Gizi+LGB+RhB+Gartenbahn+IIm+G+Fohlen+Patrouillenritt+Geschicklichkeitsturnier+Bodenarbeit+Bodenarbeitspr%C3%BCfung+Flohmarkt+';
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();
};

