/* [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','4596',jdecode('Home+%2F+wer+sind+wir++'),jdecode(''), jdecode('%2F4596.html'), 'true',[],'',''],
	['PAGE','5563',jdecode('New%26%23x27%3Bs'),jdecode(''), jdecode('%2F5563.html'), 'true',[],'',''],
	['PAGE','88414',jdecode('Wiona+v.+Guggisbergerl%C3%A4ndli'),jdecode(''), jdecode('%2F88414.html'), 'true',[],'',''],
	['PAGE','171801',jdecode('Garon+vom+V%C3%B6gele+Hof'),jdecode(''), jdecode('%2F171801.html'), 'true',[],'',''],
	['PAGE','5509',jdecode('in+lieber+Erinnerung++'),jdecode(''), jdecode('%2F5509.html'), 'true',[],'',''],
	['PAGE','5482',jdecode('Ronja-Kandy+v.d.Isiranch'),jdecode(''), jdecode('%2F5482.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('Joshua%2FCliff+v.Tanzb%C3%BChl+'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','5428',jdecode('Joshua%26%23x27%3Bs+Nachkommen'),jdecode(''), jdecode('%2F5428.html'), 'true',[],'',''],
	['PAGE','59097',jdecode('Ausstellungen%2BPr%C3%BCfungen+'),jdecode(''), jdecode('%2F59097.html'), 'true',[],'',''],
	['PAGE','6966',jdecode('Gallerie+Freizeit+und+Freunde+'),jdecode(''), jdecode('%2F6966.html'), 'true',[],'',''],
	['PAGE','238901',jdecode('Gallerie+Wanderungen'),jdecode(''), jdecode('%2F238901.html'), 'true',[],'',''],
	['PAGE','5536',jdecode('Ferien-Erinnerungen+'),jdecode(''), jdecode('%2F5536.html'), 'true',[],'',''],
	['PAGE','5902',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5902%2Findex.html'), 'true',[ 
		['PAGE','5903',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5902%2F5903.html'), 'false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='DB7A7A';
theSitetree.keyvisualId='1963';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='386';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Stylus',
				paletteFamily: 	'DB7A7A',
				keyvisualId: 	'1963',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'386',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'DB7A7A',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171801',
internalId:  '',
customField: '20120122-140513'
};
webappMappings['1002']=webappMappings['1002-5902ABW0X0INXXSX']={
webappId:    '1002',
documentId:  '5902',
internalId:  '5902ABW0X0INXXSX',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4596',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4596',
internalId:  '',
customField: '20120122-144003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88414',
internalId:  '',
customField: '20120122-143027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5482',
internalId:  '',
customField: '20120113-161155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5563',
internalId:  '',
customField: '20120113-160008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20091027-230136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5428',
internalId:  '',
customField: '20100513-141057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5509',
internalId:  '',
customField: '20120122-144628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59097',
internalId:  '',
customField: '20100513-135317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6966',
internalId:  '',
customField: '20101031-140129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20100704-114234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5902',
internalId:  '',
customField: '20050115-150724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5903',
internalId:  '',
customField: '20050115-150724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '238901',
internalId:  '',
customField: '20101031-135926'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXSX';
var companyName   = 'Aus+Liebe+und+Freude+zum+Tier';
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();
};

