/* [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','13601',jdecode('Home'),jdecode(''),'/13601.html','true',[],'',''],
	['PAGE','16001',jdecode('%C3%BCber+mich'),jdecode(''),'/16001.html','true',[],'',''],
	['PAGE','15501',jdecode('Betreuung'),jdecode(''),'/15501.html','true',[],'',''],
	['PAGE','16701',jdecode('Betreute+Region'),jdecode(''),'/16701.html','true',[],'',''],
	['PAGE','15522',jdecode('G%C3%A4stebuch+'),jdecode(''),'/15522.html','true',[],'',''],
	['PAGE','15543',jdecode('Preise'),jdecode(''),'/15543.html','true',[],'',''],
	['PAGE','15564',jdecode('Kunden'),jdecode(''),'/15564.html','true',[],'',''],
	['PAGE','29901',jdecode('Partner'),jdecode(''),'/29901.html','true',[],'',''],
	['PAGE','33901',jdecode('Hundeschule'),jdecode(''),'/33901.html','true',[],'',''],
	['PAGE','28501',jdecode('Links'),jdecode(''),'/28501.html','true',[],'',''],
	['PAGE','15585',jdecode('Kontakt'),jdecode(''),'/15585.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Pixelportal';
theSitetree.paletteFamily='FE8800';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10729';
theSitetree.graphicsetId='10538';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pixelportal',
				paletteFamily: 	'FE8800',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10729',
				graphicsetId: 	'10538',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20100408-111911'
};
webappMappings['1002']=webappMappings['1002-15522abw330inei84']={
webappId:    '1002',
documentId:  '15522',
internalId:  '15522abw330inei84',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-de67e61506c2eeb3702a12685e6951a7']={
webappId:    '7060',
documentId:  '15564',
internalId:  'de67e61506c2eeb3702a12685e6951a7',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-8760']={
webappId:    '7008',
documentId:  '15585',
internalId:  '8760',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20100601-231920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15543',
internalId:  '',
customField: '20100819-214019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20100202-111321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15522',
internalId:  '',
customField: '20100126-001641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15585',
internalId:  '',
customField: '20100126-001531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20100408-115326'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '13601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15564',
internalId:  '',
customField: '20100129-111157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28501',
internalId:  '',
customField: '20100316-220954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29901',
internalId:  '',
customField: '20100309-234923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20100408-115504'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEI84';
var companyName   = 'Mobile-Tierbetreuung';
var htmlTitle	  = '';
var metaKeywords  = 'Haustierbetreuung+Riggisberg%2C+Haustierbetreuung+Bern+und+Umgebung%2C+Tierbetreuung+Riggisberg%2C+Tierbetreuung+Bern+und+Umgebung%2C+Hundespazierdienst+Riggisberg%2C+Hundespazierdienst+Bern+und+Umgebung%2C+Hundesitter+Riggisberg%2C+Hundesitter+Bern+und+Umgebung%2C+Mobile+Tierbetreuung+Riggisberg+Bern+und+Umgebung%2C+Betreuung+von+Katzen+Riggisberg%2C+Betreuung+von+Katzen+Bern+und+Umgebung%2C+Betreuung+von+Nager+Riggisberg%2C+Betreuung+von+Nager+Bern+und+Umgebung%2C+Betreuung+von+V%C3%B6gel+Riggsiberg%2C+Betreuung+von+V%C3%B6gel+Bern+und+Umgebung%2C+Betreuung+von+Kleintieren+Riggisberg%2C+Betreuung+von+Kleintieren+Bern+und+Umgebung';
var metaContents  = 'Vom+Vogel+bis+zum+Hund+-+Wir+betreuen+ihre+Lieblinge+fachgerecht+und+nach+ihren+W%C3%BCnschen.';
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();
};
