/* [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','10501',jdecode('Startseite'),jdecode(''),'/10501.html','true',[],'',''],
	['PAGE','22701',jdecode('Welpen+NEWS'),jdecode(''),'/22701.html','true',[],'',''],
	['PAGE','71312',jdecode('Wissenswerte+Infos'),jdecode(''),'/71312.html','true',[],'',''],
	['PAGE','4718',jdecode('Bilder'),jdecode(''),'/4718.html','true',[],'',''],
	['PAGE','4745',jdecode('unsere+Zuchtst%C3%A4tte'),jdecode(''),'/4745.html','true',[],'',''],
	['PAGE','63812',jdecode('Zuchtr%C3%BCden'),jdecode(''),'/63812.html','true',[],'',''],
	['PAGE','5001',jdecode('Geschichte'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','27922',jdecode('Ausstellungen'),jdecode(''),'/27922.html','true',[],'',''],
	['PAGE','86212',jdecode('Havaneserpflege'),jdecode(''),'/86212.html','true',[],'',''],
	['PAGE','4691',jdecode('Pflegetipps'),jdecode(''),'/4691.html','true',[],'',''],
	['PAGE','10552',jdecode('Kontakt'),jdecode(''),'/10552.html','true',[],'',''],
	['PAGE','58012',jdecode('Regenbogenbr%C3%BCcke'),jdecode(''),'/58012.html','true',[],'',''],
	['PAGE','46012',jdecode('neues+G%C3%A4stebuch'),jdecode(''),'/46012.html','true',[],'',''],
	['PAGE','22785',jdecode('Links++++'),jdecode(''),'/22785.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Vegas';
theSitetree.paletteFamily='861A1A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16928';
theSitetree.graphicsetId='12332';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='861A1A';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				name: 			'Vegas',
				paletteFamily: 	'861A1A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16928',
				graphicsetId: 	'12332',
				contentColor: 	'FFFFFF',
				contentBGColor: '861A1A',
				a_color: 		'861A1A',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22785',
internalId:  '',
customField: '20100825-213624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20100825-213048'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71312',
internalId:  '',
customField: '20100420-140544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20090816-125425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4718',
internalId:  '',
customField: '20100825-212331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4745',
internalId:  '',
customField: '20100404-193024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100825-213402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27922',
internalId:  '',
customField: '20100420-140824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4691',
internalId:  '',
customField: '20100402-172317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10552',
internalId:  '',
customField: '20081009-220724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46012',
internalId:  '',
customField: '20090715-110306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86212',
internalId:  '',
customField: '20100420-135632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58012',
internalId:  '',
customField: '20100323-000046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63812',
internalId:  '',
customField: '20100428-094540'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2KAD';
var companyName   = 'Havaneser-Zucht+vom+Burgweiher';
var htmlTitle	  = 'Die+Havaneser+Zucht+vom+Burgweiher';
var metaKeywords  = 'havaneser+havaneserzucht+zwerghunde+herkunft+pflege+bolonka+bichon+havanais+welpen+havaneserwelpen+stammbaum+hundesalon+groomer+havaneserclub+silk+dog+zucht+fellpflege+hundeschule+welpenspielgruppe+joya+verein+havaneserz%C3%BCchter+gesundheit+pflege+skn+kurse+cuba+Info+weiterbildung';
var metaContents  = 'havaneser+zwerghunde+hunde+bichon+havanais+pflege+havaneserzucht+havaneserclub+langhaarhunde+havaneserwelpen+stammbaum+verein+hundesalon+groomer+silk+dog+zucht+fellpflege+hundeschule+welpenspielgruppe+joya+havaneserz%C3%BCchter+verein+skn+kurse';
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();
};
