/* [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','4901',jdecode('Home'),jdecode(''), jdecode('%2F4901.html'), 'true',[],'',''],
	['PAGE','46101',jdecode('Fasnacht+2012'),jdecode(''), jdecode('%2F46101.html'), 'true',[],'',''],
	['PAGE','37922',jdecode('Partys+in+Oberi+Bar'),jdecode(''), jdecode('%2F37922%2Findex.html'), 'true',[ 
		['PAGE','37964',jdecode('Party+mir+DJ'),jdecode(''), jdecode('%2F37922%2F37964.html'), 'true',[],'',''],
		['PAGE','37943',jdecode('Fondue+Plausch'),jdecode(''), jdecode('%2F37922%2F37943.html'), 'true',[],'','']
	],'',''],
	['PAGE','37901',jdecode('Live+Bands+in+Oberi+Bar'),jdecode(''), jdecode('%2F37901%2Findex.html'), 'true',[ 
		['PAGE','21501',jdecode('alte+Konzerte'),jdecode(''), jdecode('%2F37901%2F21501.html'), 'true',[],'','']
	],'',''],
	['PAGE','21522',jdecode('Specials'),jdecode(''), jdecode('%2F21522%2Findex.html'), 'true',[ 
		['PAGE','21801',jdecode('Events+ausser+Haus'),jdecode(''), jdecode('%2F21522%2F21801.html'), 'true',[],'','']
	],'',''],
	['PAGE','4973',jdecode('Location'),jdecode(''), jdecode('%2F4973%2Findex.html'), 'true',[ 
		['PAGE','5099',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F4973%2F5099.html'), 'true',[],'',''],
		['PAGE','5015',jdecode('Rauchen+in+der+Bar'),jdecode(''), jdecode('%2F4973%2F5015.html'), 'true',[],'',''],
		['PAGE','4952',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F4973%2F4952.html'), 'true',[],'',''],
		['PAGE','8601',jdecode('Unser+Team'),jdecode(''), jdecode('%2F4973%2F8601.html'), 'true',[],'','']
	],'',''],
	['PAGE','9701',jdecode('Facebook'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'',''],
	['PAGE','11701',jdecode('Veranstaltungfotos'),jdecode(''), jdecode('%2F11701%2Findex.html'), 'true',[ 
		['PAGE','12001',jdecode('Fondueabend'),jdecode(''), jdecode('%2F11701%2F12001.html'), 'true',[],'',''],
		['PAGE','12901',jdecode('Fondue+Abend+2.+Teil'),jdecode(''), jdecode('%2F11701%2F12901.html'), 'true',[],'',''],
		['PAGE','13501',jdecode('Fundue+Abend+3.+Teil'),jdecode(''), jdecode('%2F11701%2F13501.html'), 'true',[],'',''],
		['PAGE','15201',jdecode('Fundue+Abend+4.+Teil'),jdecode(''), jdecode('%2F11701%2F15201.html'), 'true',[],'',''],
		['PAGE','4994',jdecode('Miras+Geburtstag'),jdecode(''), jdecode('%2F11701%2F4994.html'), 'true',[],'','']
	],'',''],
	['PAGE','21822',jdecode('Fasnacht+2011'),jdecode(''), jdecode('%2F21822%2Findex.html'), 'true',[ 
		['PAGE','30001',jdecode('Stimmungsbilder'),jdecode(''), jdecode('%2F21822%2F30001.html'), 'true',[],'','']
	],'',''],
	['PAGE','5057',jdecode('G%C3%A4stefotos'),jdecode(''), jdecode('%2F5057.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','5036',jdecode('Kontakt'),jdecode(''), jdecode('%2F5036%2Findex.html'), 'true',[ 
		['PAGE','5120',jdecode('Impressum'),jdecode(''), jdecode('%2F5036%2F5120.html'), 'true',[],'','']
	],'',''],
	['PAGE','8501',jdecode('Links'),jdecode(''), jdecode('%2F8501.html'), 'true',[],'',''],
	['PAGE','8522',jdecode('Suche'),jdecode(''), jdecode('%2F8522.html'), 'true',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Blowout';
theSitetree.paletteFamily='DEDEDD';
theSitetree.keyvisualId='3767';
theSitetree.keyvisualName='kv_3767.jpg';
theSitetree.fontsetId='10477';
theSitetree.graphicsetId='10973';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Blowout',
				paletteFamily: 	'DEDEDD',
				keyvisualId: 	'3767',
				keyvisualName: 	'kv_3767.jpg',
				fontsetId: 		'10477',
				graphicsetId: 	'10973',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'F30E0E',
				e_color: 		'F30E0E',
				f_color: 		'F30E0E',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20120213-162556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4952',
internalId:  '',
customField: '20101031-144222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20110206-162634'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '4952',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4973',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['1002']=webappMappings['1002-6001abw330inesld']={
webappId:    '1002',
documentId:  '6001',
internalId:  '6001abw330inesld',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20110228-175657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4994',
internalId:  '',
customField: '20101216-045703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5015',
internalId:  '',
customField: '20101125-075022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20101031-164913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5057',
internalId:  '',
customField: '20101110-105944'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '8522',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5099',
internalId:  '',
customField: '20101031-110502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5036',
internalId:  '',
customField: '20101101-091742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5120',
internalId:  '',
customField: '20101101-082340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20101106-085632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20110209-090311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20101031-165026'
};
webappMappings['7008']=webappMappings['7008-10930']={
webappId:    '7008',
documentId:  '5036',
internalId:  '10930',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20110227-124530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20101216-045550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20101106-093020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20101106-091137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20101106-091357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20101110-110353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21522',
internalId:  '',
customField: '20110809-054548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20110206-162721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21822',
internalId:  '',
customField: '20110302-173341'
};
webappMappings['1501']=webappMappings['1501-32200613']={
webappId:    '1501',
documentId:  '4901',
internalId:  '32200613',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20110302-173831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20111010-054006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37922',
internalId:  '',
customField: '20110924-172205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37964',
internalId:  '',
customField: '20110927-051219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37943',
internalId:  '',
customField: '20110924-172116'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '46101',
internalId:  '-',
customField: '20120213-155624'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INESLD';
var companyName   = 'Oberi+Bar';
var htmlTitle	  = 'Oberi+Bar+Winterthur';
var metaKeywords  = '';
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();
};

