/* [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','301',jdecode('Home'),jdecode(''), jdecode('%2F301%2Findex.html'), 'true',[ 
		['PAGE','142201',jdecode('Warum%3F'),jdecode(''), jdecode('%2F301%2F142201.html'), 'true',[],'',''],
		['PAGE','117501',jdecode('Haltung'),jdecode(''), jdecode('%2F301%2F117501.html'), 'true',[],'','']
	],'',''],
	['PAGE','5001',jdecode('News'),jdecode(''), jdecode('%2F5001%2Findex.html'), 'true',[ 
		['PAGE','142222',jdecode('%C3%84nderungen'),jdecode(''), jdecode('%2F5001%2F142222.html'), 'true',[],'','']
	],'',''],
	['PAGE','5043',jdecode('Unsere++Tiere'),jdecode(''), jdecode('%2F5043%2Findex.html'), 'true',[ 
		['PAGE','5064',jdecode('Malouc'),jdecode(''), jdecode('%2F5043%2F5064.html'), 'true',[],'',''],
		['PAGE','5085',jdecode('Nayeli'),jdecode(''), jdecode('%2F5043%2F5085.html'), 'true',[],'',''],
		['PAGE','78101',jdecode('Hope'),jdecode(''), jdecode('%2F5043%2F78101.html'), 'true',[],'',''],
		['PAGE','172601',jdecode('Sam'),jdecode(''), jdecode('%2F5043%2F172601.html'), 'true',[],'',''],
		['PAGE','119201',jdecode('Unsere+Katzen'),jdecode(''), jdecode('%2F5043%2F119201.html'), 'true',[],'','']
	],'',''],
	['PAGE','173201',jdecode('kids+%26+malamutes'),jdecode(''), jdecode('%2F173201%2Findex.html'), 'true',[ 
		['PAGE','178501',jdecode('Impressionen'),jdecode(''), jdecode('%2F173201%2F178501.html'), 'true',[],'',''],
		['PAGE','189301',jdecode('TgI+%26+Heilp%C3%A4dagogik'),jdecode(''), jdecode('%2F173201%2F189301.html'), 'true',[],'',''],
		['PAGE','173885',jdecode('Projekte'),jdecode(''), jdecode('%2F173201%2F173885.html'), 'true',[],'',''],
		['PAGE','173822',jdecode('Erkl%C3%A4rungsans%C3%A4tze'),jdecode(''), jdecode('%2F173201%2F173822.html'), 'true',[],'','']
	],'',''],
	['PAGE','5106',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F5106%2Findex.html'), 'true',[ 
		['PAGE','31301',jdecode('Action'),jdecode(''), jdecode('%2F5106%2F31301.html'), 'true',[],'',''],
		['PAGE','31322',jdecode('Sozialspiel'),jdecode(''), jdecode('%2F5106%2F31322.html'), 'true',[],'',''],
		['PAGE','31343',jdecode('Diverses+'),jdecode(''), jdecode('%2F5106%2F31343.html'), 'true',[],'','']
	],'',''],
	['PAGE','5127',jdecode('Aktivit%C3%A4ten+%26+Sport'),jdecode(''), jdecode('%2F5127%2Findex.html'), 'true',[ 
		['PAGE','143201',jdecode('Denksport'),jdecode(''), jdecode('%2F5127%2F143201.html'), 'true',[],'',''],
		['PAGE','29201',jdecode('Trainings'),jdecode(''), jdecode('%2F5127%2F29201.html'), 'true',[],'',''],
		['PAGE','29243',jdecode('Rennen'),jdecode(''), jdecode('%2F5127%2F29243.html'), 'true',[],'',''],
		['PAGE','74001',jdecode('Wanderungen'),jdecode(''), jdecode('%2F5127%2F74001.html'), 'true',[],'','']
	],'',''],
	['PAGE','5148',jdecode('Ern%C3%A4hrung'),jdecode(''), jdecode('%2F5148%2Findex.html'), 'true',[ 
		['PAGE','67701',jdecode('BARF'),jdecode(''), jdecode('%2F5148%2F67701.html'), 'true',[],'','']
	],'',''],
	['PAGE','5169',jdecode('Zucht'),jdecode(''), jdecode('%2F5169%2Findex.html'), 'false',[ 
		['PAGE','29264',jdecode('Zuchtethik'),jdecode(''), jdecode('%2F5169%2F29264.html'), 'true',[],'',''],
		['PAGE','68601',jdecode('Rassestandart'),jdecode(''), jdecode('%2F5169%2F68601.html'), 'true',[],'','']
	],'',''],
	['PAGE','5211',jdecode('Literatur'),jdecode(''), jdecode('%2F5211.html'), 'true',[],'',''],
	['PAGE','132801',jdecode('Tierschutz'),jdecode(''), jdecode('%2F132801%2Findex.html'), 'true',[ 
		['PAGE','133901',jdecode('Andere+Projekte'),jdecode(''), jdecode('%2F132801%2F133901.html'), 'true',[],'','']
	],'',''],
	['PAGE','5232',jdecode('Links'),jdecode(''), jdecode('%2F5232.html'), 'true',[],'',''],
	['PAGE','15206',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F15206.html'), 'true',[],'',''],
	['PAGE','18101',jdecode('Anfahrt'),jdecode(''), jdecode('%2F18101%2Findex.html'), 'true',[ 
		['PAGE','62801',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F18101%2F62801.html'), 'true',[],'','']
	],'','']];
var siteelementCount=37;
theSitetree.topTemplateName='Comedy';
theSitetree.paletteFamily='98814F';
theSitetree.keyvisualId='2805';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='10601';
theSitetree.graphicsetId='10720';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B19B69';
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: 			'Comedy',
				paletteFamily: 	'98814F',
				keyvisualId: 	'2805',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'10601',
				graphicsetId: 	'10720',
				contentColor: 	'000000',
				contentBGColor: 'B19B69',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'705F3A',
				e_color: 		'705F3A',
				f_color: 		'705F3A',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-15206abw1x0inejv6']={
webappId:    '1002',
documentId:  '15206',
internalId:  '15206abw1x0inejv6',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20110718-063502'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '18101',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '62801',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117501',
internalId:  '',
customField: '20090221-121028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20111223-091647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5043',
internalId:  '',
customField: '20110718-075748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5064',
internalId:  '',
customField: '20111223-094223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5085',
internalId:  '',
customField: '20100908-151651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78101',
internalId:  '',
customField: '20111223-094426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119201',
internalId:  '',
customField: '20090928-203753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5106',
internalId:  '',
customField: '20080905-201333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20101008-155516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31322',
internalId:  '',
customField: '20101222-145941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31343',
internalId:  '',
customField: '20101008-155347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5127',
internalId:  '',
customField: '20100930-145551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20081015-102411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29243',
internalId:  '',
customField: '20110307-121037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132801',
internalId:  '',
customField: '20090223-150550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74001',
internalId:  '',
customField: '20090216-121102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5148',
internalId:  '',
customField: '20090108-123946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67701',
internalId:  '',
customField: '20091110-074746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5169',
internalId:  '',
customField: '20090503-132320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29264',
internalId:  '',
customField: '20080921-162130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68601',
internalId:  '',
customField: '20081014-174105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5211',
internalId:  '',
customField: '20111119-062655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5232',
internalId:  '',
customField: '20111223-090408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15206',
internalId:  '',
customField: '20090216-081202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142201',
internalId:  '',
customField: '20091115-213533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20080827-092822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20080913-090103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172601',
internalId:  '',
customField: '20111223-094656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133901',
internalId:  '',
customField: '20100131-180447'
};
webappMappings['7008']=webappMappings['7008-10587']={
webappId:    '7008',
documentId:  '173201',
internalId:  '10587',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142222',
internalId:  '',
customField: '20111223-092034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143201',
internalId:  '',
customField: '20090522-204950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '189301',
internalId:  '',
customField: '20110204-210208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173201',
internalId:  '',
customField: '20110206-115223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173822',
internalId:  '',
customField: '20101220-145606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173885',
internalId:  '',
customField: '20110105-145948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178501',
internalId:  '',
customField: '20101013-131153'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INEJV6';
var companyName   = 'Baerg+111+-+Malamuten';
var htmlTitle	  = 'www.baerg111-malamuten.ch';
var metaKeywords  = 'Alaskan+Malamute%2C+Baerg+111s';
var metaContents  = 'Alaskan+Malamute%2C+Baerg+111s';
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();
};

