/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','2152',jdecode('Katzenst%C3%BCbli'),jdecode(''),'/2152/index.html','true',[ 
		['PAGE','79501',jdecode('Bedingungen'),jdecode(''),'/2152/79501.html','true',[],'',''],
		['PAGE','79701',jdecode('Fotogalerie'),jdecode(''),'/2152/79701.html','true',[],'',''],
		['PAGE','79901',jdecode('Die+Wohnungskatze'),jdecode(''),'/2152/79901.html','true',[],'','']
	],'',''],
	['PAGE','80401',jdecode('Unser+Laden'),jdecode(''),'/80401.html','true',[],'',''],
	['PAGE','80601',jdecode('Online-Shop'),jdecode(''),'/80601.html','true',[],'',''],
	['PAGE','8501',jdecode('Ern%C3%A4hrung+allgem.'),jdecode(''),'/8501/index.html','true',[ 
		['PAGE','15101',jdecode('Ern%C3%A4hrung+der+Katze'),jdecode(''),'/8501/15101.html','true',[],'',''],
		['PAGE','40301',jdecode('Fressgewohnheiten+Katze'),jdecode(''),'/8501/40301.html','true',[],'',''],
		['PAGE','17701',jdecode('Fleisch'),jdecode(''),'/8501/17701.html','true',[],'','']
	],'',''],
	['PAGE','61601',jdecode('Katzenverhalten'),jdecode(''),'/61601.html','true',[],'',''],
	['PAGE','63901',jdecode('Hundeverhalten'),jdecode(''),'/63901.html','true',[],'',''],
	['PAGE','4201',jdecode('Themen+und+Infos'),jdecode(''),'/4201/index.html','true',[ 
		['PAGE','4222',jdecode('Immer+mehr...'),jdecode(''),'/4201/4222.html','true',[],'',''],
		['PAGE','4401',jdecode('Kennen+Sie+das%3F'),jdecode(''),'/4201/4401.html','true',[],'',''],
		['PAGE','41301',jdecode('Katzenschnupfen'),jdecode(''),'/4201/41301.html','false',[],'',''],
		['PAGE','40801',jdecode('Katzenseuche'),jdecode(''),'/4201/40801.html','false',[],'','']
	],'',''],
	['PAGE','3690',jdecode('AGB'),jdecode(''),'/3690.html','true',[],'',''],
	['PAGE','2173',jdecode('Impressum'),jdecode(''),'/2173.html','true',[],'',''],
	['PAGE','2194',jdecode('Interessante+Links'),jdecode(''),'/2194.html','true',[],'',''],
	['PAGE','9701',jdecode('Literaturverzeichnis'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','80201',jdecode('G%C3%A4stebuch'),jdecode(''),'/80201.html','true',[],'',''],
	['PAGE','61101',jdecode('Kontaktformular'),jdecode(''),'/61101.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='325349';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='155';
theSitetree.graphicsetId='180';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FCFCF4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Natural',
				paletteFamily: 	'325349',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'155',
				graphicsetId: 	'180',
				contentColor: 	'000066',
				contentBGColor: 'FCFCF4',
				a_color: 		'325349',
				b_color: 		'689183',
				c_color: 		'000000',
				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:  '2101',
internalId:  '',
customField: '20101013-200240'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20101030-193925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20101118-172032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20101110-182838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20090822-165852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4222',
internalId:  '',
customField: '20101013-213630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20090718-125849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79501',
internalId:  '',
customField: '20101030-194306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79701',
internalId:  '',
customField: '20101030-195721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79901',
internalId:  '',
customField: '20101030-194900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3690',
internalId:  '',
customField: '20101030-201353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20101030-201946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20101030-200857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090927-162759'
};
webappMappings['1002']=webappMappings['1002-80201abw330ine85o']={
webappId:    '1002',
documentId:  '80201',
internalId:  '80201abw330ine85o',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20090719-165628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20090822-170341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40301',
internalId:  '',
customField: '20090829-221308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090820-084722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41301',
internalId:  '',
customField: '20090820-090139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80201',
internalId:  '',
customField: '20101030-201905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80401',
internalId:  '',
customField: '20101118-173708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80601',
internalId:  '',
customField: '20101118-172426'
};
webappMappings['7008']=webappMappings['7008-7255']={
webappId:    '7008',
documentId:  '61101',
internalId:  '7255',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61601',
internalId:  '',
customField: '20101030-201058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63901',
internalId:  '',
customField: '20101013-213326'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INE85O';
var companyName   = '4+Pfoten+Futter-Shop+%2F+Katzenst%C3%BCbli';
var htmlTitle	  = 'tiertherapien.ch+-+Ern%C3%A4hrung+von+Hund+und+Katze';
var metaKeywords  = 'Hundefutter%2C+Katzenfutter%2C+Tierfutter%2C+Katzenst%C3%BCbli%2C+Katzenpension%2C+Katzenhotel';
var metaContents  = 'Informationen+zur+Ern%C3%A4hrung+von+Hunden+und+Katzen';
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();
};

