/* [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','4506',jdecode('Home'),jdecode(''), jdecode('%2F4506.html'), 'true',[],'',''],
	['PAGE','4698',jdecode('Jagdmusik'),jdecode(''), jdecode('%2F4698%2Findex.html'), 'true',[ 
		['PAGE','4725',jdecode('Die+Geschichte'),jdecode(''), jdecode('%2F4698%2F4725.html'), 'true',[],'',''],
		['PAGE','23790',jdecode('Die+Jagdh%C3%B6rner'),jdecode(''), jdecode('%2F4698%2F23790.html'), 'true',[],'',''],
		['PAGE','24068',jdecode('Die+Jagdmusik'),jdecode(''), jdecode('%2F4698%2F24068.html'), 'true',[],'','']
	],'',''],
	['PAGE','151101',jdecode('Meine+Jagdmusik'),jdecode(''), jdecode('%2F151101%2Findex.html'), 'true',[ 
		['PAGE','20601',jdecode('Meine+Kompositionen'),jdecode(''), jdecode('%2F151101%2F20601.html'), 'true',[],'',''],
		['PAGE','4779',jdecode('Musiknoten+bestellen'),jdecode(''), jdecode('%2F151101%2F4779.html'), 'true',[],'','']
	],'',''],
	['PAGE','4968',jdecode('Jagdhornbl.+Hallwyl'),jdecode(''), jdecode('%2F4968%2Findex.html'), 'true',[ 
		['PAGE','5022',jdecode('Die+Mitglieder'),jdecode(''), jdecode('%2F4968%2F5022.html'), 'true',[],'',''],
		['PAGE','143101',jdecode('Fotos+2007'),jdecode(''), jdecode('%2F4968%2F143101.html'), 'true',[],'',''],
		['PAGE','24629',jdecode('Fotos+2008'),jdecode(''), jdecode('%2F4968%2F24629.html'), 'true',[],'',''],
		['PAGE','143122',jdecode('Fotos+2009'),jdecode(''), jdecode('%2F4968%2F143122.html'), 'true',[],'',''],
		['PAGE','142801',jdecode('Fotos+2010'),jdecode(''), jdecode('%2F4968%2F142801.html'), 'true',[],'',''],
		['PAGE','147801',jdecode('Fotos+2011'),jdecode(''), jdecode('%2F4968%2F147801.html'), 'true',[],'',''],
		['PAGE','23373',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F4968%2F23373.html'), 'true',[],'',''],
		['PAGE','23646',jdecode('Probenplan'),jdecode(''), jdecode('%2F4968%2F23646.html'), 'true',[],'',''],
		['PAGE','23382',jdecode('Kontakte'),jdecode(''), jdecode('%2F4968%2F23382.html'), 'true',[],'','']
	],'',''],
	['PAGE','5157',jdecode('Links'),jdecode(''), jdecode('%2F5157.html'), 'true',[],'',''],
	['PAGE','25150',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F25150%2Findex.html'), 'true',[ 
		['PAGE','25149',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F25150%2F25149.html'), 'false',[],'','']
	],'',''],
	['PAGE','36601',jdecode('Kontakt'),jdecode(''), jdecode('%2F36601.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Draft';
theSitetree.paletteFamily='2E5D32';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10619';
theSitetree.graphicsetId='10612';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2E5D32';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Draft',
				paletteFamily: 	'2E5D32',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10619',
				graphicsetId: 	'10612',
				contentColor: 	'FFFFFF',
				contentBGColor: '2E5D32',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'92BD96',
				e_color: 		'BFA45F',
				f_color: 		'BFA45F',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1251']={
webappId:    '7008',
documentId:  '4779',
internalId:  '1251',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4506',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-25150abw0x0inx3bh']={
webappId:    '1002',
documentId:  '25150',
internalId:  '25150abw0x0inx3bh',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4506',
internalId:  '',
customField: '20120119-093531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4698',
internalId:  '',
customField: '20080509-080856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4725',
internalId:  '',
customField: '20080508-083320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23790',
internalId:  '',
customField: '20080508-083415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24068',
internalId:  '',
customField: '20080508-085019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20111205-132505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4779',
internalId:  '',
customField: '20080507-145041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4968',
internalId:  '',
customField: '20090526-114641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20111205-131838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151101',
internalId:  '',
customField: '20111205-132628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24629',
internalId:  '',
customField: '20100623-121625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23373',
internalId:  '',
customField: '20120119-094835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23646',
internalId:  '',
customField: '20120119-094700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23382',
internalId:  '',
customField: '20110531-074130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5157',
internalId:  '',
customField: '20100607-185352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25150',
internalId:  '',
customField: '20080509-080938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25149',
internalId:  '',
customField: '20080509-081018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36601',
internalId:  '',
customField: '20090526-105612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142801',
internalId:  '',
customField: '20100623-130551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143101',
internalId:  '',
customField: '20100623-130633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143122',
internalId:  '',
customField: '20100623-130528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147801',
internalId:  '',
customField: '20110315-174053'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX3BH';
var companyName   = 'Hansj%C3%B6rg%27s+Jagdhornmusik';
var htmlTitle	  = 'Jagdmusik';
var metaKeywords  = 'Jagdhornmusik%2C+Jagdhorn%2C+Jagdmusik%2C+Musik%2C+Musiknoten%2C+Noten';
var metaContents  = 'Jagdhornmusik%2C+Jagdmusik%2C+Musiknoten';
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();
};

