"mololo".namespace();
mololo.ContextFactory={create:function(A){var B=new mololo.Context();
B.setRootPath(A.rootPath);
B.setImagesPath(A.rootPath+"/new-resources/images/");
B.setMaxContentPath(A.rootPath+"/preview/");
B.setSearchPath(A.rootPath+"/search.html");
B.setRefreshRandomEventsPath(A.rootPath+"/refreshRandomEvents.html");
B.setSearchCityPath(A.rootPath+"/citySearch.html");
B.setMaxNewEventContentPath(A.rootPath+"/rejestruj.html?openPreview=");
B.setNoSelectionValue(A.noSelectionValue);
B.setLogLevel(A.logLevel);
B.setInitialEvent(A.initialEvent);
B.setActivation(A.activation);
B.setSponsor(A.sponsor);
B.setUser(A.user);
B.setDefaultEventTab(A.defaultEventTab);
B.setSelectedTopEventTab("DAY");
B.setSelectedMostCommentedEventTab("CURRENT");
B.setSelectedForumTab("DISTRICT");
B.setSelectedRecentlyAddedEventTab("POLAND");
return B
}};
mololo.ArrayUtils={convertToArrayIfSingleElement:function(A){if(A.length==undefined){var B=A;
A=[];
A.push(B)
}return A
}};
mololo.ImageUtils={waitUntilImageIsLoaded:function(C,B,A){var D=1;
var F=(arguments.length>3)?arguments[3]:undefined;
var E=setInterval(function(){if(parseInt(C.width)>0){if(F!=undefined){F()
}clearInterval(E)
}else{D++;
if(D>B){clearInterval(E)
}}},A)
}};
mololo.DateUtils={parseDate_yyyyMMdd:function(A){return Date.parseDate(A,"Ymd")
},isToday:function(B){var A=new Date();
return B.getYear()==A.getYear()&&B.getMonth()==A.getMonth()&&B.getDate()==A.getDate()
},resetToNight:function(B){var A=new Date(B);
A.setHours(23);
A.setMinutes(59);
A.setSeconds(59);
A.setMilliseconds(999);
return A
},resetToMidnight:function(B){var A=new Date(B);
A.setHours(0);
A.setMinutes(0);
A.setSeconds(0);
A.setMilliseconds(0);
return A
}};
mololo.AjaxUtils={AJAX_UPDATER_CALLBACKS:{on401:function(){mololo.WindowUtils.openLoginWindow()
},on403:function(A){if(Prototype.Browser.Opera&&A.statusText=="Unauthorized"){mololo.WindowUtils.openLoginWindow()
}},onFailure:function(){mololo.HtmlUtils.hideLoading()
}},synchUrlRequest:function(A){var B=GXmlHttp.create();
B.open("GET",(A.startsWith("http://"))?A:mololo.UrlUtils.getMololoAbsoluteUrl(A),false);
B.send(null);
if(B.status==401){mololo.WindowUtils.openLoginWindow()
}else{if(B.status==403){if(Prototype.Browser.Opera&&B.statusText=="Unauthorized"){mololo.WindowUtils.openLoginWindow()
}}}return B
},asynchUrlRequest:function(A,B){GDownloadUrl(A,function(C,D){if(D!=200){return 
}else{if(D==401){mololo.WindowUtils.openLoginWindow();
return 
}}if(B!=undefined){B(C)
}})
},loadLogo:function(B){var A=$(B);
if(A==null){return 
}var C={method:"get",asynchronous:true,evalScripts:true};
var D=new Ajax.Updater(B,mololo.UrlUtils.getMololoAbsoluteUrl("/logo.html"),C)
},loadMiniForum:function(I,F){var C=F.getMap().getBounds();
var H=F.getMap().getZoom();
var G=C.getSouthWest().lat();
var L=C.getSouthWest().lng();
var E=C.getNorthEast().lat();
var K=C.getNorthEast().lng();
var D=$(I);
if(D==null){return 
}var B={method:"get",asynchronous:true,evalScripts:true};
var J="/my_forum.html?mapZoomLevel="+H+"&forumtab=ALL_FORUMS&x1="+G.toString()+"&y1="+L.toString()+"&x2="+E.toString()+"&y2="+K.toString();
log.debug(J);
var A=new Ajax.Updater(I,mololo.UrlUtils.getMololoAbsoluteUrl(J),B)
},loadMiniForumCoords:function(F,E,I,C,H){var D=$(F);
if(D==null){return 
}var B={method:"get",asynchronous:true,evalScripts:true};
var G="/my_forum.html?forumtab=ALL_FORUMS&x1="+E.toString()+"&y1="+I.toString()+"&x2="+C.toString()+"&y2="+H.toString();
log.debug(G);
var A=new Ajax.Updater(F,mololo.UrlUtils.getMololoAbsoluteUrl(G),B)
},loadMiniForumPosts:function(F,A,C){var B=$(C);
if(B==null){return 
}var D={method:"get",asynchronous:true,evalScripts:true};
var E=new Ajax.Updater(C,mololo.UrlUtils.getMololoAbsoluteUrl("/my_forum.html?strCity="+A+"&forumtab=CHOOSEN_FORUM&forumid="+F),D)
},loadBanner:function(C,B){var A=$(B);
if(A==null){return 
}var D={method:"get",asynchronous:true,evalScripts:true};
var E=new Ajax.Updater(B,mololo.UrlUtils.getMololoAbsoluteUrl("/banner.html?index="+C+"&"+mololo.RandomUtils.randomInt()),D)
},loadContent:function(D,F,H){mololo.HtmlUtils.showLoading();
var E=$(F);
var G=E.innerHTML;
var B={method:"get",asynchronous:true,evalScripts:true,onSuccess:function(J){mololo.globals.DISPATCHER.sendEvent(mololo.Action.CONTENT_CHANGED_ACTION,new mololo.content.ContentChangeEvent(mololo.UrlUtils.removeGetParametersFromUrl(D)));
mololo.HtmlUtils.hideLoading()
},onComplete:function(){mololo.HtmlUtils.hideLoading()
}};
Object.extend(B,this.AJAX_UPDATER_CALLBACKS);
if(H!=undefined){if(!Object.isUndefined(H.onSuccess)&&(Object.isUndefined(H.overrideOnSuccess)||!H.overrideOnSuccess)&&Object.isFunction(H.onSuccess)){var C=H.onSuccess;
var I=B.onSuccess;
H.onSuccess=function(){C();
I()
}
}Object.extend(B,H)
}var A=new Ajax.Updater({success:F,failure:null},mololo.UrlUtils.getMololoAbsoluteUrl(D),B)
},updateContainer:function(C,B,A){if(Object.isUndefined(A)){A={}
}A.overrideOnSuccess=true;
if(Object.isUndefined(A.onSuccess)){A.onSuccess=function(){}
}this.loadContent(C,B,A)
},stripesSubmit:function(D,A,F,C){var E=$(D);
for(i=3;
i<arguments.length;
i++){var B=$(arguments[i]);
if(B!=undefined){B.disable()
}}E.onsubmit=function(){return false
};
var G=Form.serialize(E);
if(F!=undefined){G=F+"=submit&"+G
}new Ajax.Updater(A,E.action,{method:"post",postBody:G})
},disableFormFields:function(C,A){var D=$(C);
for(i=1;
i<arguments.length;
i++){var B=$(arguments[i]);
if(B!=undefined){B.disable()
}}},synchJKLRequest:function(B){var A=new JKL.ParseXML(B);
return A.parse()
},asyncJKLRequest:function(B,C){var A=new JKL.ParseXML(B);
A.async(C);
A.parse()
},updateLiner:function(){mololo.AjaxUtils.asynchUrlRequest(new mololo.LinerSearchCriteria($("searchDates").value).toUrl(),function(A){$$("div.liner")[0].innerHTML=A;
initMarquee()
})
}};
mololo.XMLUtils={convertToJson:function(C){var A=GXml.parse(C);
var B=mololo.XMLUtils._convertToJson(A.firstChild);
return B
},_convertToJson:function(C){var B={};
for(var A=0;
A<C.attributes.length;
A++){B[C.attributes[A].name]=C.attributes[A].value
}for(var A=0;
A<C.children.length;
A++){if(B[C.children[A].nodeName]==undefined){B[C.children[A].nodeName]=[]
}B[C.children[A].nodeName].push(mololo.XMLUtils._convertToJson(C.children[A]))
}return B
}};
mololo.RandomUtils={randomInt:function(){return parseInt(Math.random()*100000000000)
}};
mololo.HtmlUtils={disableElement:function(C,D){var A,B=0;
if(A=C.childNodes){while(oFld=A.item(B++)){if(oFld.disabled!=undefined){oFld.disabled=D
}if(oFld.childNodes!=undefined&&oFld.childNodes.length>0){mololo.HtmlUtils.disableElement(oFld,D)
}}}},invokeOnClick:function(A){var B=$(A);
if(typeof B.onclick=="function"){B.onclick.apply(B)
}},retrieveBrowserViewPort:function(){var B;
var A;
if(typeof window.innerWidth!="undefined"){B=window.innerWidth,A=window.innerHeight
}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){B=document.documentElement.clientWidth,A=document.documentElement.clientHeight
}else{B=document.getElementsByTagName("body")[0].clientWidth,A=document.getElementsByTagName("body")[0].clientHeight
}}return{width:B,height:A}
},refreshMenuButtons:function(B,A){$("menuButton1").src=$("menuButton1").getAttribute("origSrc");
$("menuButton2").src=$("menuButton2").getAttribute("origSrc");
$("menuButton3").src=$("menuButton3").getAttribute("origSrc");
B.src=B.getAttribute("active")
},showLoading:function(){var A=$("loading-overlay");
A.show()
},hideLoading:function(){$("loading-overlay").hide()
}};
mololo.UrlUtils={getMololoAbsoluteUrl:function(A){return A.startsWith("http")?(A):(mololo.globals.CONTEXT.getRootPath()+(!A.startsWith("/")?"/":"")+A)
},removeGetParametersFromUrl:function(A){return A.substring(0,A.indexOf("?"))
},json2Url:function(C){var B=C.getAction();
var D=true;
var A=C.getUrlParams();
for(var E in A){if(!E.startsWith("hashCode")&&typeof A[E]!="function"&&A[E]!=null&&A[E]!=undefined){B+=(D)?("?"):"&";
B+=E+"="+A[E].toString();
D=false
}}if(log.isDebugEnabled()){log.debug("Generated url :"+B)
}return encodeURI(B)
},generateMaxInfoMakerUrl:function(A){return(A.isNewEventMarker())?mololo.globals.CONTEXT.getMaxNewEventContentPath():mololo.globals.CONTEXT.getMaxContentPath()+A.getId()
}};
mololo.WindowUtils={openSeparateWindow:function(G,A,C,I,F,B){var D={className:"window_2",title:'<img src="'+G+'"/>',draggable:false,id:B,width:C,height:I,url:mololo.UrlUtils.getMololoAbsoluteUrl(A),zIndex:10000,destroyOnClose:true};
if(F!=undefined){for(var H in F){if(H.startsWith("on")&&typeof F[H]=="function"){D[H]=F[H]
}}}var E=new Window(D);
E.showCenter();
E.show(true);
return E
},openWindow:function(B,D,A,C){this.closeWindow();
if(C==null){C="mololo"
}WindowCloseKey.init(Event.KEY_ESC);
Dialog.info({url:mololo.UrlUtils.getMololoAbsoluteUrl(B),options:{method:"get"}},{className:C,width:D,height:A,closable:true,zIndex:10000,destroyOnClose:true})
},openIFrameWindow:function(D,C,A,B){this.closeWindow();
if(B==null){B="mololo"
}WindowCloseKey.init(Event.KEY_ESC);
Dialog.info('<iframe src="'+mololo.UrlUtils.getMololoAbsoluteUrl(D)+'" width="'+C*0.9+'px" height="'+A*0.9+'px"> </iframe>',{className:B,width:C,height:A,closable:true,zIndex:10000,destroyOnClose:true})
},alert:function(B,A){Dialog.alert(B,{className:"mololo",width:300,height:100,okLabel:mololo.msg.okButton,ok:A,zIndex:10000,destroyOnClose:true})
},confirm:function(F,C,E,B,G,A,D){Dialog.confirm(F,{className:"mololo",width:C,okLabel:E,cancelLabel:B,id:G,cancel:A,ok:D,zIndex:10000,destroyOnClose:true})
},closeWindow:function(){Windows.closeAll()
},openLoginWindow:function(){mololo.WindowUtils.openWindow("login.html",380,197,"window_tb")
}};
mololo.PlaceholderUtils={extractPlaceholdersFromInput:function(A){return A.match(/\${1}\{{1}\w{1,}\}{1}/gm)
},extractPlaceholderName:function(A){return A.substring(2,A.length-1)
},convert:function(D,E){var A=this.extractPlaceholdersFromInput(D);
var C=new Set();
var B=D;
A.forEach(function(G){if(!C.contains(G)){C.add(G);
var F=this.extractPlaceholderName(G);
if(E[F]!=undefined){B=B.replaceAll(G,E[F])
}else{B=this.specialConversion(B,G,F,E)
}}},this);
B=B.replaceAll("${imagesPath}",mololo.globals.CONTEXT.getImagesPath());
B=B.replaceAll("${root}",mololo.globals.CONTEXT.getRootPath());
B=B.replaceAll("${defaultThumbImg}",mololo.globals.CONTEXT.getImagesPath(true)+"extwindow/default_image_thumb.jpg");
return B.replaceAll("${sponsorImagesPath}",mololo.globals.CONTEXT.getImagesPath(true))
},specialConversion:function(F,H,A,J){if(A=="iconPath"){return F.replaceAll(H,mololo.content.ContentUtils.createPosterThumbUrl(J.uId,J.hId,J.it))
}else{if(A=="when"){if(J.pt!=null&&J.pt=="Y"){if(J.dow!=null){var E=J.dow;
var D='<span class="criteria" id="criteria_open">Dni otwarcia: </span><br/><span id="openDays">'+this.parseDaysOfWeek(E)+"</span>";
return F.replaceAll(H,D)
}else{return F.replaceAll(H,"-")
}}else{var C=J.sd;
C=C.substring(6,8)+"."+C.substring(4,6)+"."+C.substring(2,4);
var B='<span class="criteria" id="criteria_from">od: </span><span id="fromDate">'+C+"</span><br/>";
var I=J.ed;
I=I.substring(6,8)+"."+I.substring(4,6)+"."+I.substring(2,4);
var G='<span class="criteria" id="criteria_to">do: </span><span id="dateTo">'+I+"</span>";
return F.replaceAll(H,B+G)
}}}return F
},parseDaysOfWeek:function(E){var F=["pon","wt","śr","czw","pt","sob","nie"];
var B=[1,2,4,8,16,32,64];
var C="";
var A=false;
for(var D=0;
D<B.length;
D++){if(E&B[D]){if(A){C+=","
}C+=F[D];
A=true
}}return C
}},mololo.StringUtils={getMaxLenString:function(B,A){if(B!=null){return(B.length>A)?B.substring(0,A)+"...":B
}return""
},isBlank:function(A){return A==null||A.blank()
},isNotBlank:function(A){return !this.isBlank(A)
}};
mololo.FCKEditorUtils={retrieveEditorContent:function(B){var A=FCKeditorAPI.GetInstance(B);
return A.GetXHTML(true)
}};
mololo.MessageBox={message:function(A){mololo.globals.MESSAGE_CONTROL.message(A)
}};
mololo.LayoutUtils={initialized:0,count:0,criteriaChanged:function(){if(this.count==0&&this.initialized==1){this.count=1;
this.showRefreshButton();
return 
}},showSearchButton:function(){$("searchContainerRefreshButton").hide();
$("searchContainerSearchButton").show();
this.count=0
},showRefreshButton:function(){$("searchContainerRefreshButton").show();
$("searchContainerSearchButton").hide()
},setInitialized:function(){this.initialized=1
}};
mololo.FlashUtils={flashVersionSupported:null,isFlashVersionSupported:function(){if(this.flashVersionSupported==null){this.flashVersionSupported=DetectFlashVer(9,0,0)
}return this.flashVersionSupported
},displayCalendar:function(A){if(this.isFlashVersionSupported()){AC_FL_RunContent("src",A,"width","547","height","56","wmode","transparent","align","middle","id","detectionExample","quality","high","bgcolor","#FFFFFF","name","detectionExample","allowScriptAccess","true","type","application/x-shockwave-flash","codebase","http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage","http://www.adobe.com/go/getflashplayer")
}else{document.write(mololo.msg.flashVersionNotSupported)
}},displayBanner:function(B,D){if(arguments.length>1){var C=arguments[2]+"";
var A=arguments[3]+""
}else{var C="547";
var A="56"
}if(this.isFlashVersionSupported()){AC_FL_RunContent("src",B,"width",C,"height",A,"wmode","transparent","align","middle","id","detectionExample","quality","high","bgcolor","#FFFFFF","name","detectionExample","allowScriptAccess","true","type","application/x-shockwave-flash","codebase","http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage","http://www.adobe.com/go/getflashplayer","htmlElementIdToPaste",D)
}else{document.write(mololo.msg.flashVersionNotSupported)
}},displayCategories:function(A){if(this.isFlashVersionSupported()){AC_FL_RunContent("src",A,"width","1002","height","480","wmode","transparent","align","middle","id","categoriesMenu2","quality","high","bgcolor","#FFFFFF","name","categoriesMenu2","allowScriptAccess","true","scale","noScale","menu","false","type","application/x-shockwave-flash","codebase","http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage","http://www.adobe.com/go/getflashplayer")
}else{document.write(mololo.msg.flashVersionNotSupported)
}},displayPromotion:function(B,A){if(this.isFlashVersionSupported()){AC_FL_RunContent("src",B,"width","142","height","117","wmode","transparent","align","middle","id","detectionExample","quality","high","bgcolor","#FFFFFF","name","detectionExample","allowScriptAccess","true","scale","noScale","menu","false","type","application/x-shockwave-flash","codebase","http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage","http://www.adobe.com/go/getflashplayer")
}else{document.write('<img src="'+A+'"/>')
}},displayFlashBanner:function(C,D,B,A){if(this.isFlashVersionSupported()){AC_FL_RunContent("src",C,"width",B,"height",A,"wmode","transparent","align","middle","id","detectionExample","quality","high","bgcolor","#FFFFFF","name","detectionExample","allowScriptAccess","true","scale","noScale","menu","false","type","application/x-shockwave-flash","codebase","http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab","pluginspage","http://www.adobe.com/go/getflashplayer")
}else{document.write('<img src="'+D+'"/>')
}}};