/* [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','4499',jdecode('Home'),jdecode(''),'/4499.html','true',[],'',''],
	['PAGE','4556',jdecode('Moserbros%26%23x27%3B+Angebote'),jdecode(''),'/4556/index.html','true',[ 
		['PAGE','9801',jdecode('Eventmanagement'),jdecode(''),'/4556/9801.html','true',[],'',''],
		['PAGE','9882',jdecode('Casa+Moser+Party'),jdecode(''),'/4556/9882.html','true',[],'','']
	],'',''],
	['PAGE','29018',jdecode('Simon%26%23x27%3Bs+Angebote'),jdecode(''),'/29018/index.html','true',[ 
		['PAGE','20818',jdecode('Simon%26%23x27%3Bs+Podcast+World'),jdecode(''),'/29018/20818.html','true',[],'',''],
		['PAGE','24318',jdecode('Moderation%2F+DJ'),jdecode(''),'/29018/24318.html','true',[],'','']
	],'',''],
	['PAGE','29039',jdecode('P%C3%A4di%26%23x27%3Bs+Angebote'),jdecode(''),'/29039/index.html','true',[ 
		['PAGE','27618',jdecode('Grappa+Turbo'),jdecode(''),'/29039/27618.html','true',[],'','']
	],'',''],
	['PAGE','4583',jdecode('Termine'),jdecode(''),'/4583.html','true',[],'',''],
	['PAGE','20860',jdecode('Das+Unternehmen'),jdecode(''),'/20860.html','true',[],'',''],
	['PAGE','20881',jdecode('Unser+Team'),jdecode(''),'/20881.html','true',[],'',''],
	['PAGE','4691',jdecode('Kontakt'),jdecode(''),'/4691.html','true',[],'',''],
	['PAGE','16301',jdecode('Newsletter+bestellen'),jdecode(''),'/16301.html','true',[],'',''],
	['PAGE','4718',jdecode('Links'),jdecode(''),'/4718.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='666633';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17363';
theSitetree.graphicsetId='12761';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'666633',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17363',
				graphicsetId: 	'12761',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-172']={
webappId:    '7008',
documentId:  '16301',
internalId:  '172',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-173']={
webappId:    '7008',
documentId:  '4556',
internalId:  '173',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4499',
internalId:  '',
customField: '20090802-214505'
};
webappMappings['1501']=webappMappings['1501-3958781']={
webappId:    '1501',
documentId:  '4499',
internalId:  '3958781',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20090719-233740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20090706-230357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9882',
internalId:  '',
customField: '20090802-215311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29018',
internalId:  '',
customField: '20090802-215317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20818',
internalId:  '',
customField: '20090724-172010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24318',
internalId:  '',
customField: '20090710-173539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29039',
internalId:  '',
customField: '20090802-215353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27618',
internalId:  '',
customField: '20090719-233722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4583',
internalId:  '',
customField: '20090831-223502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20860',
internalId:  '',
customField: '20090802-215450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20881',
internalId:  '',
customField: '20090724-171857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4691',
internalId:  '',
customField: '20090713-143115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20090706-230951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4718',
internalId:  '',
customField: '20090706-231319'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4499',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INEJ95';
var companyName   = 'Moserbros.+Entertainment';
var htmlTitle	  = 'Moserbros+Entertainment';
var metaKeywords  = 'Bern%2C+bagatello%2C+Beratung%2C+Party%2C+Partyorganisation%2C+Patrick+Moser%2C+P%C3%A4di%2C+Events%2C+Moderation%2C+bagatelo%2C+Paddy%2C+Podcast%2C+Simu%2C+Radio+BE1%2C+Moserbros%2C+Casamoser%2C+Casa+Moser+Party%2C+Simus+Stammtisch%2C+Podcast+World%2C+Eventmanagement';
var metaContents  = 'Moserbros%2C+Partyorganisation%2C+Eventorganisation%2C+Moderation%2C+Events%2C+DJ%2C+Podcast';
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();
};

