/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','1952',jdecode('Wer+sind+wir'),jdecode(''), jdecode('%2F1952.html'), 'true',[],'',''],
	['PAGE','5827',jdecode('Jungtierschau+Dietikon'),jdecode(''), jdecode('%2F5827.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('Organisation'),jdecode(''), jdecode('%2F5701%2Findex.html'), 'true',[ 
		['PAGE','5722',jdecode('Vorstand'),jdecode(''), jdecode('%2F5701%2F5722.html'), 'true',[],'',''],
		['PAGE','5743',jdecode('Statuten+%26+Reglement'),jdecode(''), jdecode('%2F5701%2F5743.html'), 'true',[],'',''],
		['PAGE','5301',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F5701%2F5301.html'), 'true',[],'',''],
		['PAGE','5953',jdecode('Amt+%26+Limmattal'),jdecode(''), jdecode('%2F5701%2F5953.html'), 'true',[],'',''],
		['PAGE','8601',jdecode('Felln%C3%A4hgruppe'),jdecode(''), jdecode('%2F5701%2F8601.html'), 'true',[],'','']
	],'',''],
	['PAGE','5764',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F5764.html'), 'true',[],'',''],
	['PAGE','1994',jdecode('Vereinslokal'),jdecode(''), jdecode('%2F1994.html'), 'true',[],'',''],
	['PAGE','5848',jdecode('Kleintierschau+Birmensdorf'),jdecode(''), jdecode('%2F5848%2Findex.html'), 'true',[ 
		['PAGE','5890',jdecode('Anmeldung'),jdecode(''), jdecode('%2F5848%2F5890.html'), 'true',[],'',''],
		['PAGE','5911',jdecode('Anfahrt'),jdecode(''), jdecode('%2F5848%2F5911.html'), 'true',[],'',''],
		['PAGE','5932',jdecode('Rangliste'),jdecode(''), jdecode('%2F5848%2F5932.html'), 'true',[],'','']
	],'',''],
	['PAGE','5806',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F5806.html'), 'true',[],'',''],
	['PAGE','1973',jdecode('Links'),jdecode(''), jdecode('%2F1973.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Grid';
theSitetree.paletteFamily='819ECE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16762';
theSitetree.graphicsetId='12259';
theSitetree.contentColor='4B4B4B';
theSitetree.contentBGColor='819ECE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Grid',
				paletteFamily: 	'819ECE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16762',
				graphicsetId: 	'12259',
				contentColor: 	'4B4B4B',
				contentBGColor: '819ECE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20120105-153918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20090922-205225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20111226-203110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20110830-170855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090922-203435'
};
webappMappings['7060']=webappMappings['7060-ce8892bf8257efb5b0c6272e86b304c9']={
webappId:    '7060',
documentId:  '5764',
internalId:  'ce8892bf8257efb5b0c6272e86b304c9',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-1355']={
webappId:    '7008',
documentId:  '5301',
internalId:  '1355',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20110226-084416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5722',
internalId:  '',
customField: '20111226-201609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5743',
internalId:  '',
customField: '20090922-194213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5764',
internalId:  '',
customField: '20110110-134600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5806',
internalId:  '',
customField: '20120202-105353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5827',
internalId:  '',
customField: '20120105-151303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5848',
internalId:  '',
customField: '20101220-153126'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5890',
internalId:  '',
customField: '20111117-190128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5911',
internalId:  '',
customField: '20090922-201137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5932',
internalId:  '',
customField: '20110826-162930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5953',
internalId:  '',
customField: '20110117-175540'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5911',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20110117-180036'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHP340INV5BM';
var companyName   = 'Kleintierz%C3%BCchterverein+Dietikon+und+Umgebung';
var htmlTitle	  = 'Kleintierz%C3%BCchterverein+Dietikon+und+Umgebung';
var metaKeywords  = 'Hahn%2C+Henne%2C+Hase%2C+Kaninchen%2C+Jungtierschau%2C+KTZV+Dietikon%2C+Kleintierz%C3%BCchterverein+Dietikon%2C+Sie++Er+Schau%2C+Kaninchenausstellung%2C+Gefl%C3%BCgelschau%2C+K%C3%BCcken%2C+Bibeli';
var metaContents  = 'Kleintierzucht+ein+lebendiges+Hobby%21';
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();
};

