/* [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','22022',jdecode('Programm'),jdecode(''),'/22022.html','true',[],'',''],
	['PAGE','29801',jdecode('Fotos'),jdecode(''),'/29801/index.html','true',[ 
		['PAGE','28001',jdecode('Grand+Opening'),jdecode(''),'/29801/28001.html','true',[],'',''],
		['PAGE','47601',jdecode('FREAKSHOW'),jdecode(''),'/29801/47601.html','true',[],'','']
	],'',''],
	['PAGE','21101',jdecode('Bands%2FK%C3%BCnstler'),jdecode(''),'/21101.html','true',[],'',''],
	['PAGE','53801',jdecode('LESbar'),jdecode(''),'/53801.html','true',[],'',''],
	['PAGE','14601',jdecode('Infos'),jdecode(''),'/14601/index.html','true',[ 
		['PAGE','18822',jdecode('Kontakt'),jdecode(''),'/14601/18822.html','true',[],'',''],
		['PAGE','18801',jdecode('Lageplan'),jdecode(''),'/14601/18801.html','true',[],'',''],
		['PAGE','19601',jdecode('%C3%96ffnungszeiten'),jdecode(''),'/14601/19601.html','true',[],'',''],
		['PAGE','18843',jdecode('Miete+das+Coq+d%26%23x27%3BOr'),jdecode(''),'/14601/18843.html','true',[],'',''],
		['PAGE','18864',jdecode('Lass+es+raus..'),jdecode(''),'/14601/18864.html','true',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Windows';
theSitetree.paletteFamily='BF1C1C';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10455';
theSitetree.graphicsetId='10866';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Windows',
				paletteFamily: 	'BF1C1C',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10455',
				graphicsetId: 	'10866',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'C0C0C0',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18843',
internalId:  '',
customField: '20100211-023213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20100211-022554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20100518-020932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18822',
internalId:  '',
customField: '20100329-132826'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22022',
internalId:  '1006',
customField: '1006'
};
webappMappings['1003']=webappMappings['1003-abw330inei9k126006429da']={
webappId:    '1003',
documentId:  '18864',
internalId:  'abw330inei9k126006429da',
customField: 'de:CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18864',
internalId:  '',
customField: '20100211-022505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100607-140325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20100623-152126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22022',
internalId:  '',
customField: '20100825-004356'
};
webappMappings['7060']=webappMappings['7060-647417e8d5c71903e84831a66b7cc5de']={
webappId:    '7060',
documentId:  '28001',
internalId:  '647417e8d5c71903e84831a66b7cc5de',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20100208-163451'
};
webappMappings['7060']=webappMappings['7060-54c8e4dcfd66b425d2f6e35b44ac9ce0']={
webappId:    '7060',
documentId:  '29801',
internalId:  '54c8e4dcfd66b425d2f6e35b44ac9ce0',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20100208-173528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53801',
internalId:  '',
customField: '20100825-003347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20100518-020724'
};
webappMappings['7060']=webappMappings['7060-65f4a0a36fb6863273b1e8ad77af55c5']={
webappId:    '7060',
documentId:  '47601',
internalId:  '65f4a0a36fb6863273b1e8ad77af55c5',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEI9K';
var companyName   = 'COQ+D%27OR';
var htmlTitle	  = 'COQ+D%27OR+Olten';
var metaKeywords  = 'coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+Coq+d%27or+Olten%2Ccoq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+Coq+d%27Or%2C+coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+Coq+d%27or+Olten%2Ccoq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+Coq+d%27Or+Olten%2C+coq+d%27or+olten%2C+coq+d%27or+olten%2C+Coq+d%27Or%2C+coq+d+or+olten%2C+Coq+dor%2C+++coq+dor%2C+++coq+d+or%2C+++Coq+d+Or%2C+++++++++++++++++Coq+d%27Or+Olten%2C+Bar+Olten%2C+++++++++++++++++Freiraum%2C+++++++++++++++++Bahnhof+Olten%2C+++++++++++++++++Treffpunkt+Olten%2C+Caf%C3%A9+Olten%2C+Kaffee+Olten%2C+Club+Olten%2C++++++++++++++++Kultur+Olten%2C+Kunst+Olten%2C+Lesung+Olten%2C+Ausgang+Olten%2C+Konzert+Olten%2C+Rock+Olten%2C+Nightlife+Olten%2C++Nachtleben+Olten%2C+Party+Olten%2C+';
var metaContents  = 'Das+Coq+d%27Or+ist+Frei-und+Experimentier-Raum+direkt+am+Bahnhof+Olten.+Club%2C+Caf%C3%A9+und+Treffpunkt.+Wir+zeigen+Performances%2C+Konzerte%2C+Ausstellungen%2C+Lesungen%2C+Filme%2C+Theater...+Wir+suchen+Subversion%2C+Ironie%2C+Rebellion%2C+Sch%C3%B6nheit%2C+Mut+und+Ekstase.+';
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();
};
