var ForumFramework=Class.create();Object.extend(ForumFramework.prototype,AppFramework.prototype);Object.extend(ForumFramework.prototype,{isEditorOpened:false,savePost:function(C,A,F,B){Editor.populate("body_content");Editor.disable("body_content",true);Form.disable(C);this.prePost();var E=Form.getArray(C);var D=new Wait(C);D.show();Object.extend(E,{threadId:F,forumId:A,postId:B});this.sendRequest("savePost",E,function(H){D.hide();this.updateChildCount(F,H.count);if(H.updated){if(H.added){Element.replace("Post_"+B,H.html);$("Post_"+B).show();Element.show("Post_"+B,H.html);var G=$("Post_edit_"+B);if(G){Element.remove(G)}}else{$("Post_edit_"+B).update(H.html)}}else{if(H.added){F?this.effectNewPost(A,F,H):this.effectNewThread(A,F,H)}else{C.remove();var J=F?F:A;$(this.appid+"AddPost_"+J).update('<div id="Post_edit_'+H.id+'"> '+H.html+"</div>");var I=document.getElementsByClassName("error","Form_"+H.id);if(I.length>0){Field.select(I[0])}}}}.bind(this),function(){C.remove();D.hide();this.cancelPost(F?F:A)}.bind(this));this.isEditorOpened=false;return false},prePost:function(){},effectNewThread:function(A,C,B){new Insertion.Top($("Forum_"+A),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A,A)},effectNewPost:function(A,C,B){new Insertion.Bottom($("Forum_"+A),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A,A)},effectDelPost:function(A){new Effect.BlindUp($("Post_"+A),{afterFinish:function(){Element.replace($("Post_"+A),"")}})},addPost:function(A,B){if(!this.isEditorOpened){this.sendRequest("addNewPost",{threadId:B,forumId:A},function(C){this.addPostAction(A);var D=B?B:A;if(C.updated){Element.replace($("Post_"+C.id),C.html)}else{Element.update($(this.appid+"AddPost_"+D),'<div id="Post_edit_'+C.id+'"> '+C.html+"</div>")}Field.select(B?$("Form_"+C.id).body:$("Form_"+C.id).subject);this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},alertBlockedEditor:function(){this.showLightBoxStatic("multieditor_alert",'<div style="margin-top : 20px; text-align : center;">'+Lang.multieditorAlert+"</div>");return false},editPost:function(A,C,B){if(!this.isEditorOpened){this.sendRequest("editPost",{threadId:C,forumId:A,postId:B},function(D){var E=C?C:A;Element.hide($("Post_"+B));new Insertion.After($("Post_"+B),'<div id="Post_edit_'+B+'"> '+D.html+"</div>");this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},addPostAction:function(A){if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").hide()}},cancelPost:function(D,A){var C=$(this.appid+"AddPost_"+D);if(C){C.update("").show();Effect.BlindUp(C,{duration:0.2,afterFinish:function(){C.update("").show()}})}var B=$("Post_edit_"+D);if(B){Element.remove(B);if($("Post_"+D)){Element.show($("Post_"+D))}}if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").show()}Editor.cancel();this.isEditorOpened=false;return false},delPost:function(B,A){this.sendRequest("deletePost",{postId:B,jump:A},function(C){if(typeof C.location!="undefined"){window.location=C.location;return }this.updateChildCount(C.threadId,C.count);if(C.postDelated){this.effectDelPost(B)}}.bind(this),null,true);return false},updateChildCount:function(B,A){if(typeof A!="undefined"&&$(this.appid+"Comments_"+B)){Element.update($(this.appid+"Comments_"+B),A)}}});var Calendar=Class.create();Object.extend(Calendar.prototype,AppFramework.prototype);Object.extend(Calendar.prototype,{appid:"Calendar",startAutoSuggest:function(){new AutoSuggest("place","placeSuggest",{appid:"Calendar",action:"getPlacesForPrefix",minChars:2})},input:function(A){},jump:function(D,A){var B="calW"+D;var C=$(D);if(C){C.value=A;if(C.id=="start"){this.updateHour()}if($(B).hasClassName("calWhidden")){this.hide("calW"+D)}else{this.showMyEvents(A)}}},initializeCalWidget:function(A){},showMyEvents:function(A){this.sendRequest("showMyEvents",{date:A},function(B){Element.update($("CalendarData"),B.html)});return false},spy:function(B,A){if(A==true){this.sendRequest("spyEvent",{"spied_id":B},function(C){if(C.status==1){$("calendar-spy").hide();$("calendar-unspy").show()}})}else{this.sendRequest("unspyEvent",{"spied_id":B},function(C){if(C.status==1){$("calendar-unspy").hide();$("calendar-spy").show()}})}}});Event.onDOMReady(function(){calendar=new Calendar()});Object.extend(Calendar.prototype,ForumFramework.prototype);Object.extend(Calendar.prototype,{appid:"Calendar",wait:null,bindedCloseWidget:null,scrollSpeed:30,addEventBox:function(A){this.showLightBox("addEventBox","addEventForm",{forumId:typeof A=="undefined"?"":A},{width:530,height:370},function(B){this.startAutoSuggest()}.bind(this))},addUser:function(A,B){this.sendRequest("addUserToEvent",{forumId:A},function(C){this.scrollUpdate(C.html,C.scrollEnd);$("memberCount").update(C.count);$A([$("joinEvent"),$("unJoinEvent")]).each(function(D){D.toggle()})}.bind(this));return false},effectNewPost:function(A,C,B){new Insertion.Before($(this.appid+"AddPost_"+C),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A)},effectDelPost:function(A){if($("BlogCounterPosts")!==null){$("BlogCounterPosts").innerHTML--}new Effect.BlindUp($("Post_"+A),{afterFinish:function(){Element.replace($("Post_"+A),"")}})},show:function(A,C,E,B){A=$(A);var D="calW"+A.id;this.sendRequest("showCalendarWidget",{date:C,id:A.id,start:E?E:0,mygen:B},function(H){if(H.html){var G=$(D);if(G){G.update(H.html);var I=Position.positionedOffset(A);G.style.top=(I[1]+18)+"px";G.style.left=(I[0]-75)+"px";G.style.zIndex="100";G.show()}else{new Insertion.After(A,'<div class="calWhidden" id="'+D+'">'+H.html+"</div>")}if(!this.bindedCloseWidget){this.bindedCloseWidget=this.hideWidget.bindAsEventListener(this)}Event.observe(document,"click",this.bindedCloseWidget)}var F=$("CalendarEventForm");if(F&&document.all){$A(F.getElementsByClassName("hideSelect"+A.id)).each(Element.hide)}}.bind(this))},hideWidget:function(B){var C=document.getElementsByClassName("calWhidden");for(var A=0;A<C.length;A++){if(!$(Event.element(B)).descendantOf(C[A])){this.hide(C[A].id)}}Event.stopObserving(document,"click",this.bindedCloseWidget)},hide:function(A){var B=$("CalendarEventForm");if($(A)){if($(A).hasClassName("calWhidden")&&$(A).visible()){$(A).hide();if(B){$A(B.getElementsByClassName("hideSelectend")).each(Element.show);$A(B.getElementsByClassName("hideSelectstart")).each(Element.show)}}}},changeCategory:function(C,B,A){this.sendRequest("viewByCategories",{forumId:C,threadId:B,category:A},function(D){if(D.html){$("calendar-listing").update(D.html);var E=$$("#calendar-listing-nav li.selected").find(function(F){return F.visible()});if(A==1){E.hide().removeClassName("selected");E.addClassName("not-selected-first")}else{E.hide().removeClassName("selected");E.addClassName("not-selected")}E.nextSiblings()[0].show();$("cat_inactiv_"+A).show().addClassName("selected");$("cat_activ_"+A).hide()}}.bind(this));return false},updateHour:function(){var F=$("start_hour");var D=$("end_hour");if(null==F||null==D){return }if(F.selectedIndex<F.options.length-1){D.selectedIndex=F.selectedIndex+1;$("end").value=$("start").value}else{var C=$("start").value.split("-");if(C.length!=3){return }var B=new Date(new Date(C[2]*1,C[1]*1-1,C[0]*1).getTime()+86400000);var A=B.getMonth(),E=B.getDate();if(A<10){A="0"+A}if(E<10){E="0"+E}$("end").value=E+"-"+A+"-"+B.getFullYear();D.selectedIndex=0}}});Object.extend(Calendar.prototype,{addEventBox:function(A){this.showLightBox("addEventBox","addEventForm",{forumId:typeof A=="undefined"?"":A},{width:530,height:370},function(B){this.startAutoSuggest()}.bind(this))},saveAddEventBox:function(){var A=$("CalendarEventForm");Editor.populate("EventBody_content");A.submit();setTimeout(function(){try{Form.disable(A)}catch(B){}},10);this.wait=new Wait($("addEventBox_row2"));this.wait.show()},saveEventFinished:function(A){return this.getIFramePage(A,function(B){this.wait.hide();if(B.result==this.RESPONSE_RESULT_OK){this.cancelAddEventBox();if(B.location){document.location=B.location}}else{$("addEventBox_content").update(B.html);this.startAutoSuggest()}}.bind(this),function(){this.wait.hide()}.bind(this))},cancelAddEventBox:function(){AppFramework.hideLightBox("addEventBox")},showAdd:function(){var C=$("add-toggle-on"),A=$("add-toggle-off"),B=$("additional-options");B.show();C.hide();A.show();setTimeout(function(){if($("EventBody_content").visible()){new Editor("EventBody_content")}},0);return false},hideAdd:function(){var C=$("add-toggle-on"),A=$("add-toggle-off"),B=$("additional-options");B.hide();C.show();A.hide();return false},toggleWholeDay:function(){var A=$("wholeDay");var C=A.checked;var B=$("end_field");if(C){B.hide()}else{B.show()}return true},toggleFree:function(C){var B=C.value,A=$("priceInput");if(C.value=="1"){A.hide();$("price").value=""}else{A.show();$("price").focus()}return false}});if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject