/* [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','1657',jdecode('Home'),jdecode(''), jdecode('%2F1657.html'), 'true',[],'',''],
	['PAGE','1678',jdecode('FassBrass'),jdecode(''), jdecode('%2F1678%2Findex.html'), 'true',[ 
		['PAGE','4001',jdecode('St.+Fidelis'),jdecode(''), jdecode('%2F1678%2F4001.html'), 'true',[],'',''],
		['PAGE','4022',jdecode('Petrus'),jdecode(''), jdecode('%2F1678%2F4022.html'), 'true',[],'',''],
		['PAGE','4043',jdecode('Trombonius'),jdecode(''), jdecode('%2F1678%2F4043.html'), 'true',[],'',''],
		['PAGE','4064',jdecode('FassMeister'),jdecode(''), jdecode('%2F1678%2F4064.html'), 'true',[],'','']
	],'',''],
	['PAGE','1699',jdecode('Termine'),jdecode(''), jdecode('%2F1699.html'), 'true',[],'',''],
	['PAGE','2401',jdecode('Fotos'),jdecode(''), jdecode('%2F2401%2Findex.html'), 'true',[ 
		['PAGE','4501',jdecode('Mittelmeer-Kreuzfahrt+2010'),jdecode(''), jdecode('%2F2401%2F4501.html'), 'true',[],'',''],
		['PAGE','9112',jdecode('CD'),jdecode(''), jdecode('%2F2401%2F9112.html'), 'true',[],'','']
	],'',''],
	['PAGE','3201',jdecode('T%C3%B6ne'),jdecode(''), jdecode('%2F3201%2Findex.html'), 'true',[ 
		['PAGE','5612',jdecode('CD'),jdecode(''), jdecode('%2F3201%2F5612.html'), 'true',[],'',''],
		['PAGE','6012',jdecode('H%C3%B6ren'),jdecode(''), jdecode('%2F3201%2F6012.html'), 'true',[],'',''],
		['PAGE','5633',jdecode('Video'),jdecode(''), jdecode('%2F3201%2F5633.html'), 'true',[],'','']
	],'',''],
	['PAGE','1752',jdecode('Kontakt'),jdecode(''), jdecode('%2F1752.html'), 'true',[],'',''],
	['PAGE','1731',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F1731.html'), 'true',[],'',''],
	['PAGE','5012',jdecode('Links'),jdecode(''), jdecode('%2F5012.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'webland',
  product: 'WSCSYSSSSLY0XFFS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20111017-213126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20111018-184720'
};
webappMappings['7002']=webappMappings['7002-10411']={
webappId:    '7002',
documentId:  '1731',
internalId:  '10411',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20111018-184735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1657',
internalId:  '',
customField: '20111018-184541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1678',
internalId:  '',
customField: '20111018-184624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1699',
internalId:  '',
customField: '20120129-143601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20111017-120244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1731',
internalId:  '',
customField: '20111017-120315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20111020-135129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20111018-184756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4064',
internalId:  '',
customField: '20111018-184820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5012',
internalId:  '',
customField: '20111020-103424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20111017-213618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5612',
internalId:  '',
customField: '20111017-213545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5633',
internalId:  '',
customField: '20111026-221753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6012',
internalId:  '',
customField: '20111017-213743'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1657',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9112',
internalId:  '',
customField: '20111030-223036'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010INE1LH';
var companyName   = 'FassBrass';
var htmlTitle	  = 'Willkommen+bei+FassBrass';
var metaKeywords  = 'FassBrass+Fass-Brass+Fass+Brass+Fidelis+Petrus+Trombonius+Fassmeister+Geri+Amrein+Benno+Peter+Thomas+Hauri+Norbert+Kappeler+Blaskapelle+Stegreifgruppe+Blasmusik+Quartett+';
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();
};

