/* [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','117301',jdecode('Aktuell'),jdecode(''),'/117301.html','false',[],'',''],
	['PAGE','91001',jdecode('Willkommen'),jdecode(''),'/91001.html','true',[],'',''],
	['PAGE','301',jdecode('Portrait'),jdecode(''),'/301/index.html','true',[ 
		['PAGE','4701',jdecode('Horn'),jdecode(''),'/301/4701.html','true',[],'',''],
		['PAGE','156201',jdecode('Trompete'),jdecode(''),'/301/156201.html','true',[],'',''],
		['PAGE','64101',jdecode('Orchesterleitung'),jdecode(''),'/301/64101.html','true',[],'',''],
		['PAGE','64122',jdecode('Management'),jdecode(''),'/301/64122.html','true',[],'','']
	],'',''],
	['PAGE','99001',jdecode('Projekte'),jdecode(''),'/99001/index.html','false',[ 
		['PAGE','153001',jdecode('Fuchsjagd%21'),jdecode(''),'/99001/153001.html','true',[],'',''],
		['PAGE','99043',jdecode('CornoPiano+a+due'),jdecode(''),'/99001/99043.html','true',[],'',''],
		['PAGE','99064',jdecode('HubertusHornQuartett'),jdecode(''),'/99001/99064.html','true',[],'','']
	],'',''],
	['PAGE','93201',jdecode('Presse'),jdecode(''),'/93201.html','false',[],'',''],
	['PAGE','20064',jdecode('Kontakt'),jdecode(''),'/20064.html','true',[],'',''],
	['PAGE','99085',jdecode('Links'),jdecode(''),'/99085.html','false',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='CC0000';
theSitetree.keyvisualId='876';
theSitetree.keyvisualName='duenen.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='188';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'CC0000',
				keyvisualId: 	'876',
				keyvisualName: 	'duenen.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'188',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '153001',
internalId:  '',
customField: '20091123-100438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91001',
internalId:  '',
customField: '20100416-233828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117301',
internalId:  '',
customField: '20100602-171243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100416-234718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100603-071813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64101',
internalId:  '',
customField: '20100417-010010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64122',
internalId:  '',
customField: '20100417-010300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99001',
internalId:  '',
customField: '20100417-010859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99043',
internalId:  '',
customField: '20091123-095038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99064',
internalId:  '',
customField: '20090724-172400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93201',
internalId:  '',
customField: '20091012-221958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20064',
internalId:  '',
customField: '20100417-011951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99085',
internalId:  '',
customField: '20090724-173513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156201',
internalId:  '',
customField: '20100602-171410'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INECG5';
var companyName   = 'Lorenz+St%C3%B6ckli+-+H%C3%B6r%C3%A4limaa';
var htmlTitle	  = 'Lorenz+St%C3%B6ckli';
var metaKeywords  = 'meta+name%3Dkeywords+content%3DLorenz%2C+St%C3%B6ckli%2C+Horn%2C+Wienerhorn%2C+Waldhorn%2C+Cor%2C+French%2C+Naturhorn%2C+Barockhorn%2C+Schulleitung%2C+Schulleiter%2C+Dirigent%2C+Brass%2C+Band%2C+ZbiSto%2C+QuintettPlus%2C+Hubertus%2C+Quartett';
var metaContents  = 'meta+name%3Ddescription+content%3DDie+Website+von+Lorenz+Stouml%3Bckli+informiert+uuml%3Bber+seine+berufliche+Tauml%3Btigkeit%2C+das+berufliche+Portfolio%2C+aktuelle+und+langfristige+Projekte+und+Termine.+Sie+enthauml%3Blt+biographische+Angaben%2C+Konzerthinweise+sowie+viele+interessante+Links+zu+Auftraggebern%2C+Arbeitsgebern%2C+Kollegen%2C+Ensembles%2C+Instrumentenbauer+usw.++meta+name%3Dtitle+content%3DHouml%3Brauml%3Blimaa+-+Mann+mit+Horn%3F%21+Die+Website+von+Lorenz+Stouml%3Bckli++meta+name%3Dauthor+content%3Dlorenzstoeckli.ch++meta+name%3Dpublisher+content%3Dlorenzstoeckli.ch++meta+name%3Dcopyright+content%3Dlorenzstoeckli.ch++meta+name%3Drevisit-after+content%3Dafter+20+days++meta+name%3Ddate+content%3D2007-12-03++meta+name%3Dpage-type+content%3DInformation++Portrait++meta+name%3Daudience+content%3Dmusiker++meta+name%3Drobots+content%3Dindex%2Cnofollow++meta+name%3Dgenerator+content%3Dhttp%3A%2F%2Fwww.lorenzstoeckli.ch++meta+name%3Dpragma+content%3Dno-cache++meta+http-equiv%3DContent-Type+content%3Dtext%2Fhtml%3B+charset%3Diso-8859-1+++++++++';
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();
};
