/* [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','12401',jdecode('Home+%2F+Updates+'),jdecode(''), jdecode('%2F12401.html'), 'true',[],'',''],
	['PAGE','13901',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F13901.html'), 'true',[],'',''],
	['PAGE','14153',jdecode('Kontakt+%2F+Vorstand'),jdecode(''), jdecode('%2F14153.html'), 'true',[],'',''],
	['PAGE','13985',jdecode('Pr%C3%BCfungen+'),jdecode(''), jdecode('%2F13985.html'), 'true',[],'',''],
	['PAGE','14027',jdecode('Aktuelles+19.01.2012'),jdecode(''), jdecode('%2F14027.html'), 'true',[],'',''],
	['PAGE','14048',jdecode('%C3%9Cbungsdaten+%2F+Kurse'),jdecode(''), jdecode('%2F14048.html'), 'true',[],'',''],
	['PAGE','21301',jdecode('Nasenarbeit+'),jdecode(''), jdecode('%2F21301.html'), 'true',[],'',''],
	['PAGE','21322',jdecode('Unterordnung+'),jdecode(''), jdecode('%2F21322.html'), 'true',[],'',''],
	['PAGE','39901',jdecode('F%C3%BChrigkeit+BH+1-3'),jdecode(''), jdecode('%2F39901.html'), 'true',[],'',''],
	['PAGE','21401',jdecode('Abteilung+C+IPO%2FVPG'),jdecode(''), jdecode('%2F21401.html'), 'true',[],'',''],
	['PAGE','27301',jdecode('Mitgliederbereich'),jdecode(''), jdecode('%2F27301.html'), 'true',[],'',''],
	['PAGE','14090',jdecode('Clubh%C3%BCtte'),jdecode(''), jdecode('%2F14090.html'), 'true',[],'',''],
	['PAGE','19601',jdecode('Galerie'),jdecode(''), jdecode('%2F19601.html'), 'true',[],'',''],
	['PAGE','14132',jdecode('Links'),jdecode(''), jdecode('%2F14132.html'), 'true',[],'',''],
	['PAGE','14174',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F14174.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='F9F6BC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10614';
theSitetree.graphicsetId='10472';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FDEE91';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Deepcolor',
				paletteFamily: 	'F9F6BC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10614',
				graphicsetId: 	'10472',
				contentColor: 	'000000',
				contentBGColor: 'FDEE91',
				a_color: 		'F9F6BC',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-14174abw330inet8o']={
webappId:    '1002',
documentId:  '14174',
internalId:  '14174abw330inet8o',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20111121-172819'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12401',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-8170']={
webappId:    '7008',
documentId:  '14153',
internalId:  '8170',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20111118-104233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39901',
internalId:  '',
customField: '20100318-110408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14090',
internalId:  '',
customField: '20091208-140914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14048',
internalId:  '',
customField: '20101208-121114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14027',
internalId:  '',
customField: '20111121-174524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14153',
internalId:  '',
customField: '20110317-105932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13985',
internalId:  '',
customField: '20111019-111647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27301',
internalId:  '',
customField: '20101208-130457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20100222-175919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21322',
internalId:  '',
customField: '20100318-111447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20100507-111604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20111121-171530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14132',
internalId:  '',
customField: '20100307-141752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14174',
internalId:  '',
customField: '20091124-214033'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INET8O';
var companyName   = 'Sch%C3%A4ferhundeclub+Ortsgruppe+Winterthur';
var htmlTitle	  = 'Schweizerischer+Sch%C3%A4ferhundeclub%2C+Ortsgruppe+Winterthur';
var metaKeywords  = '';
var metaContents  = '';
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();
};

