/* [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','4518',jdecode('Startseite'),jdecode(''),'/4518/index.html','true',[ 
		['PAGE','15691',jdecode('Kontakte+%2F+Links'),jdecode(''),'/4518/15691.html','true',[],'',''],
		['PAGE','14834',jdecode('Eintr%C3%A4ge'),jdecode(''),'/4518/14834.html','false',[],'','']
	],'',''],
	['PAGE','14882',jdecode('Linda+Tellington-Jones'),jdecode(''),'/14882/index.html','true',[ 
		['PAGE','14873',jdecode('Tellington-TTouches'),jdecode(''),'/14882/14873.html','true',[],'','']
	],'',''],
	['PAGE','15636',jdecode('Lucky+und+Pyla'),jdecode(''),'/15636/index.html','true',[ 
		['PAGE','39412',jdecode('Ferien+auf+Borkum'),jdecode(''),'/15636/39412.html','true',[],'',''],
		['PAGE','54012',jdecode('Ferien+in+Breskens'),jdecode(''),'/15636/54012.html','true',[],'','']
	],'',''],
	['PAGE','58433',jdecode('Workshops+%2F+Turniere'),jdecode(''),'/58433/index.html','true',[ 
		['PAGE','58412',jdecode('Dogdance'),jdecode(''),'/58433/58412.html','true',[],'','']
	],'',''],
	['PAGE','14835',jdecode('G%C3%A4stebuch'),jdecode(''),'/14835.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Animal';
theSitetree.paletteFamily='7E7E7F';
theSitetree.keyvisualId='4308';
theSitetree.keyvisualName='kv_4308.jpg';
theSitetree.fontsetId='10791';
theSitetree.graphicsetId='11212';
theSitetree.contentColor='AA0000';
theSitetree.contentBGColor='DFDFDF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Animal',
				paletteFamily: 	'7E7E7F',
				keyvisualId: 	'4308',
				keyvisualName: 	'kv_4308.jpg',
				fontsetId: 		'10791',
				graphicsetId: 	'11212',
				contentColor: 	'AA0000',
				contentBGColor: 'DFDFDF',
				a_color: 		'7E7E7F',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'7E7E7F',
				e_color: 		'7E7E7F',
				f_color: 		'7E7E7F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4518',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14873',
internalId:  '',
customField: '20090113-164235'
};
webappMappings['1002']=webappMappings['1002-14835abw0x0inxpdk']={
webappId:    '1002',
documentId:  '14835',
internalId:  '14835abw0x0inxpdk',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4518',
internalId:  '',
customField: '20090611-195653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14882',
internalId:  '',
customField: '20090114-212948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15636',
internalId:  '',
customField: '20090609-131031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15691',
internalId:  '',
customField: '20090330-190348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14835',
internalId:  '',
customField: '20090119-125933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14834',
internalId:  '',
customField: '20090112-184455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54012',
internalId:  '',
customField: '20100617-161506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39412',
internalId:  '',
customField: '20090617-101816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58433',
internalId:  '',
customField: '20100809-073635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58412',
internalId:  '',
customField: '20100712-074526'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXPDK';
var companyName   = 'lucky-dog';
var htmlTitle	  = 'lucky-dog';
var metaKeywords  = '%C3%A4ngstlicherHund%3BProblemhund%3BLeinenzerren%3BHundeschule%3BLinda-Tellington-Jones%3BDogdance%3BAgility%3BFerien+mit+dem+Hund%3BKurse%3BBodenarbeit%3Bgl%C3%BCcklicher+Hund%3BClicker%3BKombi-Workshop%3BDoris+Vaterlaus%3BChristine+Szakacs';
var metaContents  = 'lucky+dog+-+gluecklicher+Hund';
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();
};
