var lsVote;var lsVoteClass=new Class({Implements:Options,options:{classes_action:{voted:"voted",plus:"plus",minus:"minus",positive:"positive",negative:"negative",quest:"quest"},classes_element:{voting:"voting",count:"count",total:"total",plus:"plus",minus:"minus"}},typeVote:{topic_comment:{url:DIR_WEB_ROOT+"/include/ajax/voteComment.php",targetName:"idComment"},topic:{url:DIR_WEB_ROOT+"/include/ajax/voteTopic.php",targetName:"idTopic"},blog:{url:DIR_WEB_ROOT+"/include/ajax/voteBlog.php",targetName:"idBlog"},user:{url:DIR_WEB_ROOT+"/include/ajax/voteUser.php",targetName:"idUser"},place:{url:DIR_WEB_ROOT+"/include/ajax/place_vote.php",targetName:"idPlace"},event_comment:{url:DIR_WEB_ROOT+"/include/ajax/bill_voteComment.php?act=event",targetName:"idEvent"},place_comment:{url:DIR_WEB_ROOT+"/include/ajax/bill_voteComment.php?act=place",targetName:"idPlace"}},initialize:function(a){this.setOptions(a)},vote:function(d,c,b,a){if(!this.typeVote[a]){return false}this.idTarget=d;this.objVote=$(c);this.value=b;this.type=a;thisObj=this;var e=new Hash();e["value"]=b;e[this.typeVote[a].targetName]=d;JsHttpRequest.query(this.typeVote[a].url,e,function(f,g){thisObj.onVote(f,g,thisObj)},true)},onVote:function(a,f,e){if(!a){msgErrorBox.alert("Error","Please try again later")}if(a.bStateError){msgErrorBox.alert(a.sMsgTitle,a.sMsg)}else{msgNoticeBox.alert(a.sMsgTitle,a.sMsg);if(e.type=="place"){return ls_Place.Rating_voted(a)}var d=e.objVote.getParent("."+e.options.classes_element.voting);d.addClass(e.options.classes_action.voted);if(this.value>0){d.addClass(e.options.classes_action.plus)}if(this.value<0){d.addClass(e.options.classes_action.minus)}var c=d.getChildren("."+e.options.classes_element.count);if(c&&c[0]){c.set("text",a.iCountVote)}var b=d.getChildren("."+e.options.classes_element.total);a.iRating=parseFloat(a.iRating);d.removeClass(e.options.classes_action.negative);d.removeClass(e.options.classes_action.positive);if(a.iRating>0){d.addClass(e.options.classes_action.positive);b.set("text","+"+a.iRating)}if(a.iRating<0){d.addClass(e.options.classes_action.negative);b.set("text",a.iRating)}if(a.iRating==0){b.set("text","0")}if(e.type=="user"&&$("user_skill_"+e.idTarget)){$("user_skill_"+e.idTarget).set("text",a.iSkill)}}}});window.addEvent("domready",function(){lsVote=new lsVoteClass()});var lsFavourite;var lsFavouriteClass=new Class({Implements:Options,options:{classes_action:{active:"active",quest:"quest"},classes_element:{favorite:"favorite"}},typeFavourite:{topic:{url:DIR_WEB_ROOT+"/include/ajax/topicFavourite.php",targetName:"idTopic"}},initialize:function(a){this.setOptions(a)},toggle:function(d,a,b){if(!this.typeFavourite[b]){return false}this.idTarget=d;this.objFavourite=$(a);this.value=c;this.type=b;thisObj=this;var c=1;if(this.objFavourite.getParent("."+this.options.classes_element.favorite).hasClass(this.options.classes_action.active)){c=0}var e=new Hash();e["type"]=c;e[this.typeFavourite[b].targetName]=d;JsHttpRequest.query(this.typeFavourite[b].url,e,function(f,g){thisObj.onToggle(f,g,thisObj)},true)},onToggle:function(a,d,c){if(!a){msgErrorBox.alert("Error","Please try again later")}if(a.bStateError){msgErrorBox.alert(a.sMsgTitle,a.sMsg)}else{msgNoticeBox.alert(a.sMsgTitle,a.sMsg);var b=c.objFavourite.getParent("."+c.options.classes_element.favorite);b.removeClass(c.options.classes_action.active);if(a.bState){b.addClass(c.options.classes_action.active)}}}});window.addEvent("domready",function(){lsFavourite=new lsFavouriteClass()});function ajaxQuestionVote(b,a){JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/questionVote.php",{idTopic:b,idAnswer:a},function(c,d){if(!c){msgErrorBox.alert("Error","Please try again later")}if(c.bStateError){msgErrorBox.alert(c.sMsgTitle,c.sMsg)}else{msgNoticeBox.alert(c.sMsgTitle,c.sMsg);if($("topic_question_area_"+b)){$("topic_question_area_"+b).set("html",c.sText)}}},true)}var lsBlockLoaderClass=new Class({Implements:Options,options:{classes_nav:{nav:"block-nav",content:"block-content",active:"active"}},type:{comment_stream:{url:DIR_WEB_ROOT+"/include/ajax/stream_comment.php"},topic_stream:{url:DIR_WEB_ROOT+"/include/ajax/stream_topic.php"},blogs_top:{url:DIR_WEB_ROOT+"/include/ajax/blogs_top.php"},blogs_join:{url:DIR_WEB_ROOT+"/include/ajax/blogs_join.php"},blogs_self:{url:DIR_WEB_ROOT+"/include/ajax/blogs_self.php"},place_block_PlacesByRating:{url:DIR_WEB_ROOT+"/include/ajax/place_block_places.php?sortby=rating"},place_block_PlacesByVisitors:{url:DIR_WEB_ROOT+"/include/ajax/place_block_places.php?sortby=visitors"}},initialize:function(a){this.setOptions(a)},toggle:function(f,d,g){if(!this.type[d]){return false}thisObj=this;this.obj=$(f);var c=thisObj.obj.getParent("li");var e=c.getParent("ul."+thisObj.options.classes_nav.nav);var a=e.getChildren("li");a.each(function(h,j){h.removeClass(thisObj.options.classes_nav.active)});c.addClass(this.options.classes_nav.active);var b=e.getParent("div").getChildren("div."+this.options.classes_nav.content)[0].set("html","");this.showStatus(b);JsHttpRequest.query(this.type[d].url,g,function(h,j){thisObj.onLoad(h,j,b)},true)},onLoad:function(a,c,b){b.set("html","");if(!a){msgErrorBox.alert("Error","Please try again later")}if(a.bStateError){}else{b.set("html",a.sText)}},showStatus:function(b){var a=new Element("div");a.setStyle("text-align","center");a.set("html",'<img src="'+DIR_STATIC_SKIN+'/images/loader.gif" >');a.inject(b)}});function ajaxToggleUserFrend(b,a){b=$(b);JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/userFriend.php",{idUser:a},function(c,d){if(!c){msgErrorBox.alert("Error","Please try again later")}if(c.bStateError){msgErrorBox.alert(c.sMsgTitle,c.sMsg)}else{msgNoticeBox.alert(c.sMsgTitle,c.sMsg);if(b){b.set("text",c.sToggleText);if(c.bState){b.getParent("li").removeClass("add");b.getParent("li").addClass("del")}else{b.getParent("li").removeClass("del");b.getParent("li").addClass("add")}}}},true)}function ajaxJoinLeaveBlog(b,a){b=$(b);JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/joinLeaveBlog.php",{idBlog:a},function(c,d){if(!c){msgErrorBox.alert("Error","Please try again later")}if(c.bStateError){msgErrorBox.alert(c.sMsgTitle,c.sMsg)}else{msgNoticeBox.alert(c.sMsgTitle,c.sMsg);if(b){b.getParent().removeClass("active");if(c.bState){b.getParent().addClass("active")}divCount=$("blog_user_count_"+a);if(divCount){divCount.set("text",c.iCountUser)}}}},true)}function ajaxBlogInfo(a){JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/blogInfo.php",{idBlog:a},function(b,c){if(!b){msgErrorBox.alert("Error","Please try again later")}if(b.bStateError){}else{if($("block_blog_info")){$("block_blog_info").set("html",b.sText)}}},true)}function ajaxTextPreview(d,b,a){var c;if(BLOG_USE_TINYMCE&&tinyMCE&&(ed=tinyMCE.get(d))){c=ed.getContent()}else{c=$(d).value}JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/textPreview.php",{text:c,save:b},function(e,f){if(!e){msgErrorBox.alert("Error","Please try again later")}if(e.bStateError){msgErrorBox.alert("Error","Please try again later")}else{if(!a){a="text_preview"}if($(a)){$(a).set("html",e.sText).setStyle("display","block")}}},true)}function addField(b){tr=b;while(tr.tagName!="TR"){tr=tr.parentNode}var a=tr.parentNode.insertBefore(tr.cloneNode(true),tr.nextSibling);checkFieldForLast()}function checkFieldForLast(){btns=document.getElementsByName("drop_answer");for(i=0;i<btns.length;i++){btns[i].disabled=false}if(btns.length<=2){btns[0].disabled=true;btns[1].disabled=true}}function dropField(a){tr=a;while(tr.tagName!="TR"){tr=tr.parentNode}tr.parentNode.removeChild(tr);checkFieldForLast()}function checkAllTalk(a){$$(".form_talks_checkbox").each(function(b){if(a.checked){b.checked=true}else{b.checked=false}})}function showImgUploadForm(){if(Browser.Engine.trident){}if(!winFormImgUpload){winFormImgUpload=new StickyWin.Modal({content:$("window_load_img"),closeClassName:"close-block",useIframeShim:false})}winFormImgUpload.show();winFormImgUpload.pin(true);return false}function hideImgUploadForm(){winFormImgUpload.hide()}var winFormImgUpload;function ajaxUploadImg(b,c){c=$(c);var a=new JsHttpRequest();a.onreadystatechange=function(){if(a.readyState==4){if(a.responseJS.bStateError){msgErrorBox.alert(a.responseJS.sMsgTitle,a.responseJS.sMsg)}else{c.insertAtCursor(a.responseJS.sText);hideImgUploadForm()}}};a.open(null,DIR_WEB_ROOT+"/include/ajax/uploadImg.php",true);a.send({value:b})}function showLoginForm(){if(Browser.Engine.trident){return true}if(!winFormLogin){winFormLogin=new StickyWin.Modal({content:$("login-form"),closeClassName:"close-block",useIframeShim:false})}winFormLogin.show();winFormLogin.pin(true);return false}function hideLoginForm(){winFormLogin.hide()}var winFormLogin=false;var lsPanelClass=new Class({initialize:function(){},putText:function(b,d){b=$(b);var c=b.scrollLeft;var a=b.scrollTop;if(Browser.Engine.trident&&document.selection){b.focus();sel=document.selection.createRange();sel.text=d}else{b.insertAtCursor(d)}b.scrollLeft=c;b.scrollTop=a},putTag:function(b,a){this.putText(b,"<"+a+"/>")},putTextAround:function(d,a,b){d=$(d);var e=d.scrollLeft;var c=d.scrollTop;if(Browser.Engine.trident&&document.selection){d.focus();sel=document.selection.createRange();sel.text=a+sel.text+b}else{d.insertAroundCursor({before:a,defaultMiddle:"",after:b})}d.scrollLeft=e;d.scrollTop=c},putTagAround:function(c,b,a){if(!a){a=b}this.putTextAround(c,"<"+b+">","</"+a+">")},putTagUrl:function(c,a){c=$(c);if(url=prompt(a,"http://")){var b=c.getSelectedText();var d=b.split('"').join("");this.putText(c,'<a href="'+url+'" title="'+d+'">'+b+"</a>")}},putTagVideo:function(b,a){b=$(b);url=prompt(a,"http://");this.putText(b,"<video>"+url+"</video>")},putTagAudio:function(c,b,a){c=$(c);url=prompt(b,"http://");title=prompt(a,"");this.putText(c,'<audio title="'+title+'">'+url+"</audio>")},putQuote:function(a){a=$(a);if(selText=this.getSelectedText()){this.putText(a,"<blockquote>"+selText+"</blockquote>")}else{this.putTagAround(a,"blockquote")}},getSelectedText:function(){if(Browser.Engine.trident){return document.selection.createRange().text}return document.getSelection()}});var lsPanel;window.addEvent("domready",function(){lsPanel=new lsPanelClass()});var AudioPlayer=function(){var b=[];var e;var c="";var a={};var d=-1;function f(g){return document.all?window[g]:document[g]}return{setup:function(g,h){c=g;a=h},getPlayer:function(g){return f(g)},embed:function(m,h){var o={};var k;var q;var g;var p;var j={};var n={};var l={};for(k in a){o[k]=a[k]}for(k in h){o[k]=h[k]}if(o.transparentpagebg=="yes"){j.bgcolor="#FFFFFF";j.wmode="transparent"}else{if(o.pagebg){j.bgcolor="#"+o.pagebg}j.wmode="opaque"}j.menu="false";for(k in o){if(k=="pagebg"||k=="width"||k=="transparentpagebg"){continue}n[k]=o[k]}l.name=m;l.style="outline: none";n.playerID=m;audioplayer_swfobject.embedSWF(c,m,o.width.toString(),"24","9",false,n,j,l);b.push(m)},syncVolumes:function(j,g){d=g;for(var h=0;h<b.length;h++){if(b[h]!=j){f(b[h]).setVolume(d)}}},activate:function(g){if(e&&e!=g){f(e).close()}e=g},load:function(h,k,g,j){f(h).load(k,g,j)},close:function(g){f(g).close();if(g==e){e=null}},open:function(g){f(g).open()},getVolume:function(g){return d}}}();var audioplayer_swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in audioplayer_swfobject){audioplayer_swfobject[q]=null}audioplayer_swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();function H(){var a=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);H=function(){return a};return a}(function(){function aB(q){q=q.split(/ /g);var r={};for(var v=q.length;--v>=0;){var u=q[v];if(u){r[u]=null}}return r}var az="break continue do else for if return while ",l=az+"auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile ",aj=l+"catch class delete false import new operator private protected public this throw true try ",af=aj+"alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",ae=aj+"boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",j=ae+"as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",ad=aj+"debugger eval export function get null set undefined var with Infinity NaN ",ac="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",ab=az+"and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",B=az+"alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",A=az+"case done elif esac eval fi function in local set then until ",h=af+j+ad+ac+ab+B+A;function f(q){return q>="a"&&q<="z"||q>="A"&&q<="Z"}function aE(q,r,v,u){q.unshift(v,u||0);try{r.splice.apply(r,q)}finally{q.splice(0,2)}}var e=(function(){var q=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=","~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"],r="(?:(?:(?:^|[^0-9.])\\.{1,3})|(?:(?:^|[^\\+])\\+)|(?:(?:^|[^\\-])-)";for(var v=0;v<q.length;++v){var u=q[v];r+=f(u.charAt(0))?"|\\b"+u:"|"+u.replace(/([^=<>:&])/g,"\\$1")}r+="|^)\\s*$";return new RegExp(r)})(),w=/&/g,t=/</g,p=/>/g,c=/\"/g;function au(q){return q.replace(w,"&amp;").replace(t,"&lt;").replace(p,"&gt;").replace(c,"&quot;")}function ai(q){return q.replace(w,"&amp;").replace(t,"&lt;").replace(p,"&gt;")}var al=/&lt;/g,aJ=/&gt;/g,av=/&apos;/g,am=/&quot;/g,a=/&amp;/g,aw=/&nbsp;/g;function an(q){var r=q.indexOf("&");if(r<0){return q}for(--r;(r=q.indexOf("&#",r+1))>=0;){var y=q.indexOf(";",r);if(y>=0){var x=q.substring(r+3,y),u=10;if(x&&x.charAt(0)==="x"){x=x.substring(1);u=16}var v=parseInt(x,u);if(!isNaN(v)){q=q.substring(0,r)+String.fromCharCode(v)+q.substring(y+1)}}}return q.replace(al,"<").replace(aJ,">").replace(av,"'").replace(am,'"').replace(a,"&").replace(aw," ")}function o(q){return"XMP"===q.tagName}function ay(q,r){switch(q.nodeType){case 1:var y=q.tagName.toLowerCase();r.push("<",y);for(var x=0;x<q.attributes.length;++x){var u=q.attributes[x];if(!u.specified){continue}r.push(" ");ay(u,r)}r.push(">");for(var v=q.firstChild;v;v=v.nextSibling){ay(v,r)}if(q.firstChild||!/^(?:br|link|img)$/.test(y)){r.push("</",y,">")}break;case 2:r.push(q.name.toLowerCase(),'="',au(q.value),'"');break;case 3:case 4:r.push(ai(q.nodeValue));break}}var ah=null;function b(q){if(null===ah){var r=document.createElement("PRE");r.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));ah=!/</.test(r.innerHTML)}if(ah){var x=q.innerHTML;if(o(q)){x=ai(x)}return x}var v=[];for(var u=q.firstChild;u;u=u.nextSibling){ay(u,v)}return v.join("")}function ax(q){var r=0;return function(D){var C=null,x=0;for(var z=0,v=D.length;z<v;++z){var y=D.charAt(z);switch(y){case"\t":if(!C){C=[]}C.push(D.substring(x,z));var u=q-r%q;r+=u;for(;u>=0;u-="".length){C.push("".substring(0,u))}x=z+1;break;case"\n":r=0;break;default:++r}}if(!C){return D}C.push(D.substring(x));return C.join("")}}var ao=/(?:[^<]+|<!--[\s\S]*?--\>|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g,d=/^<!--/,aA=/^<\[CDATA\[/,ap=/^<br\b/i;function g(C){var D=C.match(ao),z=[],y=0,u=[];if(D){for(var x=0,r=D.length;x<r;++x){var v=D[x];if(v.length>1&&v.charAt(0)==="<"){if(d.test(v)){continue}if(aA.test(v)){z.push(v.substring(9,v.length-3));y+=v.length-12}else{if(ap.test(v)){z.push("\n");++y}else{u.push(y,v)}}}else{var q=an(v);z.push(q);y+=q.length}}}return{source:z.join(""),tags:u}}function aD(q,r){var v={};(function(){var z=q.concat(r);for(var D=z.length;--D>=0;){var y=z[D],C=y[3];if(C){for(var x=C.length;--x>=0;){v[C.charAt(x)]=y}}}})();var u=r.length;return function(J,L){L=L||0;var I=[L,"pln"],K="",G=0,F=J;while(F.length){var y,C=null,E,D=v[F.charAt(0)];if(D){E=F.match(D[1]);C=E[0];y=D[0]}else{for(var z=0;z<u;++z){D=r[z];var x=D[2];if(x&&!x.test(K)){continue}E=F.match(D[1]);if(E){C=E[0];y=D[0];break}}if(!C){y="pln";C=F.substring(0,1)}}I.push(L+G,y);G+=C.length;F=F.substring(C.length);if(y!=="com"&&/\S/.test(C)){K=C}}return I}}var aC=aD([],[["pln",/^[^<]+/,null],["dec",/^<!\w[^>]*(?:>|$)/,null],["com",/^<!--[\s\S]*?(?:--\>|$)/,null],["src",/^<\?[\s\S]*?(?:\?>|$)/,null],["src",/^<%[\s\S]*?(?:%>|$)/,null],["src",/^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i,null],["tag",/^<\/?\w[^<>]*>/,null]]);function aq(q){var r=aC(q);for(var z=0;z<r.length;z+=2){if(r[z+1]==="src"){var y,v;y=r[z];v=z+2<r.length?r[z+2]:q.length;var x=q.substring(y,v),u=x.match(/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/);if(u){r.splice(z,2,y,"tag",y+u[1].length,"src",y+u[1].length+(u[2]||"").length,"tag")}}}return r}var k=aD([["atv",/^\'[^\']*(?:\'|$)/,null,"'"],["atv",/^\"[^\"]*(?:\"|$)/,null,'"'],["pun",/^[<>\/=]+/,null,"<>/="]],[["tag",/^[\w:\-]+/,/^</],["atv",/^[\w\-]+/,/^=/],["atn",/^[\w:\-]+/,null],["pln",/^\s+/,null," \t\r\n"]]);function aF(q,r){for(var C=0;C<r.length;C+=2){var z=r[C+1];if(z==="tag"){var v,y;v=r[C];y=C+2<r.length?r[C+2]:q.length;var u=q.substring(v,y),x=k(u,v);aE(x,r,C,2);C+=x.length-2}}return r}function aH(q){var r=[],z=[];if(q.tripleQuotedStrings){r.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(q.multiLineStrings){r.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{r.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}z.push(["pln",/^(?:[^\'\"\`\/\#]+)/,null," \r\n"]);if(q.hashComments){r.push(["com",/^#[^\r\n]*/,null,"#"])}if(q.cStyleComments){z.push(["com",/^\/\/[^\r\n]*/,null])}if(q.regexLiterals){z.push(["str",/^\/(?:[^\\\*\/\[]|\\[\s\S]|\[(?:[^\]\\]|\\.)*(?:\]|$))+(?:\/|$)/,e])}if(q.cStyleComments){z.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null])}var y=aB(q.keywords);q=null;var v=aD(r,z),x=aD([],[["pln",/^\s+/,null," \r\n"],["pln",/^[a-z_$@][a-z_$@0-9]*/i,null],["lit",/^0x[a-f0-9]+[a-z]/i,null],["lit",/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,null,"123456789"],["pun",/^[^\s\w\.$@]+/,null]]);function u(N,M){for(var L=0;L<M.length;L+=2){var F=M[L+1];if(F==="pln"){var I,K,J,G;I=M[L];K=L+2<M.length?M[L+2]:N.length;J=N.substring(I,K);G=x(J,I);for(var D=0,P=G.length;D<P;D+=2){var O=G[D+1];if(O==="pln"){var E=G[D],C=D+2<P?G[D+2]:J.length,Q=N.substring(E,C);if(Q==="."){G[D+1]="pun"}else{if(Q in y){G[D+1]="kwd"}else{if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(Q)){G[D+1]=Q.charAt(0)==="@"?"lit":"typ"}}}}}aE(G,M,L,2);L+=G.length-2}}return M}return function(D){var C=v(D);C=u(D,C);return C}}var ag=aH({keywords:h,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function ar(C,D){for(var z=0;z<D.length;z+=2){var y=D[z+1];if(y==="src"){var u,x;u=D[z];x=z+2<D.length?D[z+2]:C.length;var r=ag(C.substring(u,x));for(var v=0,q=r.length;v<q;v+=2){r[v]+=u}aE(r,D,z,2);z+=r.length-2}}return D}function n(K,L){var J=false;for(var I=0;I<L.length;I+=2){var E=L[I+1],G,D;if(E==="atn"){G=L[I];D=I+2<L.length?L[I+2]:K.length;J=/^on|^style$/i.test(K.substring(G,D))}else{if(E==="atv"){if(J){G=L[I];D=I+2<L.length?L[I+2]:K.length;var F=K.substring(G,D),C=F.length,z=C>=2&&/^[\"\']/.test(F)&&F.charAt(0)===F.charAt(C-1),r,v,y;if(z){v=G+1;y=D-1;r=F}else{v=G+1;y=D-1;r=F.substring(1,F.length-1)}var x=ag(r);for(var u=0,q=x.length;u<q;u+=2){x[u]+=v}if(z){x.push(y,"atv");aE(x,L,I+2,0)}else{aE(x,L,I,2)}}J=false}}}return L}function aG(q){var r=aq(q);r=aF(q,r);r=ar(q,r);r=n(q,r);return r}function at(F,G,E){var D=[],y=0,C=null,x=null,z=0,v=0,u=ax(8);function q(J){if(J>y){if(C&&C!==x){D.push("</span>");C=null}if(!C&&x){C=x;D.push('<span class="',C,'">')}var I=ai(u(F.substring(y,J))).replace(/(\r\n?|\n| ) /g,"$1&nbsp;").replace(/\r\n?|\n/g,"<br />");D.push(I);y=J}}while(true){var r;r=z<G.length?(v<E.length?G[z]<=E[v]:true):false;if(r){q(G[z]);if(C){D.push("</span>");C=null}D.push(G[z+1]);z+=2}else{if(v<E.length){q(E[v]);x=E[v+1];v+=2}else{break}}}q(F.length);if(C){D.push("</span>")}return D.join("")}var ak={};function aI(q,r){for(var v=r.length;--v>=0;){var u=r[v];if(!ak.hasOwnProperty(u)){ak[u]=q}else{if("console" in window){console.log("cannot override language handler %s",u)}}}}aI(ag,["default-code"]);aI(aG,["default-markup","html","htm","xhtml","xml","xsl"]);aI(aH({keywords:af,hashComments:true,cStyleComments:true}),["c","cc","cpp","cs","cxx","cyc"]);aI(aH({keywords:ae,cStyleComments:true}),["java"]);aI(aH({keywords:A,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);aI(aH({keywords:ab,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);aI(aH({keywords:ac,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);aI(aH({keywords:B,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);aI(aH({keywords:ad,cStyleComments:true,regexLiterals:true}),["js"]);function m(q,r){try{var z=g(q),y=z.source,v=z.tags;if(!ak.hasOwnProperty(r)){r=/^\s*</.test(y)?"default-markup":"default-code"}var x=ak[r].call({},y);return at(y,v,x)}catch(u){if("console" in window){console.log(u);console.trace()}return q}}function s(q){var r=H(),C=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],z=[];for(var v=0;v<C.length;++v){for(var y=0;y<C[v].length;++y){z.push(C[v][y])}}C=null;var u=0;function x(){var N=(new Date).getTime()+250;for(;u<z.length&&(new Date).getTime()<N;u++){var M=z[u];if(M.className&&M.className.indexOf("prettyprint")>=0){var G=M.className.match(/\blang-(\w+)\b/);if(G){G=G[1]}var J=false;for(var L=M.parentNode;L;L=L.parentNode){if((L.tagName==="pre"||L.tagName==="code"||L.tagName==="xmp")&&L.className&&L.className.indexOf("prettyprint")>=0){J=true;break}}if(!J){var K=b(M);K=K.replace(/(?:\r\n?|\n)$/,"");var I=m(K,G);if(!o(M)){M.innerHTML=I}else{var E=document.createElement("PRE");for(var P=0;P<M.attributes.length;++P){var O=M.attributes[P];if(O.specified){E.setAttribute(O.name,O.value)}}E.innerHTML=I;M.parentNode.replaceChild(E,M);E=M}if(r&&M.tagName==="PRE"){var F=M.getElementsByTagName("br");for(var D=F.length;--D>=0;){var Q=F[D];Q.parentNode.replaceChild(document.createTextNode("\r\n"),Q)}}}}}if(u<z.length){setTimeout(x,250)}else{if(q){q()}}}x()}window.PR_normalizedHtml=ay;window.prettyPrintOne=m;window.prettyPrint=s;window.PR={createSimpleLexer:aD,registerLangHandler:aI,sourceDecorator:aH,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();var PieChart=new Class({options:{pieChartRadius:60,td_label_index:0,td_index:1,index:1},initialize:function(b,c,a){this.setOptions(a);this.pieChartRadius=this.options.pieChartRadius;this.pieChartDiameter=this.pieChartRadius*2;this.pieVertices=12;this.arcIncrementMultiplier=1/this.pieVertices;this.index=0;this.tableIndex=this.options.index;this.areaIndex=1;this.canvas="";this.container="";this.data_table="";this.insertElements(c);aData=this.makeData(b);this.makePieChart(aData);this.addToolTips()},insertElements:function(a){this.container=new Element("div",{id:"pieChartContainer"+this.tableIndex}).injectBefore($(a)).addClass("pieChartContainer");this.data_table=a.clone().injectBottom(this.container);a.dispose();new Element("div",{id:"pieChartWrapper"+this.tableIndex}).injectTop(this.container).addClass("pieChartWrapper");this.canvas=new Element("canvas",{id:"canvas"+this.tableIndex,width:this.pieChartDiameter,height:this.pieChartDiameter}).injectInside(this.container.getElement(".pieChartWrapper")).addClass("pieChartCanvas");new Element("map",{id:"pieChartMap"+this.tableIndex,name:"pieChartMap"+this.tableIndex}).injectBottom(this.container).addClass("pieChartMap");new Asset.image(DIR_STATIC_SKIN+"/images/spacer.gif",{alt:"",usemap:"#pieChartMap"+this.tableIndex,width:this.pieChartDiameter,height:this.pieChartDiameter}).injectInside(this.container.getElement(".pieChartWrapper")).setStyles({"width":this.pieChartDiameter,"height":this.pieChartDiameter});new Element("div").injectBottom(this.container).addClass("clear")},makeData:function(b){var a=[];b.getChildren().each(function(d){var e=d.getChildren();if($(e[0])){var c=e[0].getStyle("background").match(/#\w+/i);a.extend([{"label":d.get("text"),"value":e[1].get("text"),"color":e[0].getStyle("background").match(/#\w+/i)[0]}])}});return a},makePieChart:function(c){var v=[],r,m=[],u=[],e=[],w=0,o=0;c.each(function(y,x){u[m.length]=y.label;o=parseFloat(y.value);e[m.length]=o;w+=o;m[m.length]=y.color.hexToRgb()},this);var p=this.canvas.getContext("2d");var a=m.length;for(piece=0;piece<a;piece++){var t=e[piece]/w;var b=Math.PI*(-0.5+2*this.index);var h=Math.PI*(-0.5+2*(this.index+t));p.beginPath();p.moveTo(this.pieChartRadius,this.pieChartRadius);p.arc(this.pieChartRadius,this.pieChartRadius,this.pieChartRadius,b,h,false);p.closePath();p.fillStyle=m[piece];p.fill();p.lineWidth=1;p.beginPath();p.moveTo(this.pieChartRadius,this.pieChartRadius);p.arc(this.pieChartRadius,this.pieChartRadius,this.pieChartRadius,b,h,false);p.closePath();p.strokeStyle="#FFF";p.stroke();var f=(h-b)*this.arcIncrementMultiplier;var k=this.pieChartRadius+Math.round(Math.cos(b)*this.pieChartRadius);var n=this.pieChartRadius+Math.round(Math.sin(b)*this.pieChartRadius);var q=[];var j=1;for(i=0;i<((this.pieVertices*2)-2);i=i+2){var s=b+f*j;q[i]=this.pieChartRadius+Math.round(Math.cos(s)*this.pieChartRadius);q[i+1]=this.pieChartRadius+Math.round(Math.sin(s)*this.pieChartRadius);j++}var l=this.pieChartRadius+Math.round(Math.cos(h)*this.pieChartRadius);var g=this.pieChartRadius+Math.round(Math.sin(h)*this.pieChartRadius);var d="area"+this.tableIndex+"-"+piece;new Element("area",{"id":d,"shape":"poly","coords":this.pieChartRadius+","+this.pieChartRadius+","+k+","+n+","+q.join(",")+","+l+","+g,"title":u[piece]}).injectInside(this.container.getElement(".pieChartMap"));this.index+=t}this.tableIndex++},addToolTips:function(){new Tips($$(document.getElementsByTagName("area")),{showDelay:10,hideDelay:10})},getColor:function(e,g){var b=e*100/g;var f=Math.PI*2/g;var a=190;var d=60;var c=[];c[0]=Math.round(Math.sin(f*e+0)*d+a);c[1]=Math.round(Math.sin(f*e+2)*d+a);c[2]=Math.round(Math.sin(f*e+4)*d+a);return"rgb("+c.join(",")+")"}});PieChart.implement(new Options);function JsHttpRequest(){var t=this;t.onreadystatechange=null;t.readyState=0;t.responseText=null;t.responseXML=null;t.status=200;t.statusText="OK";t.responseJS=null;t.caching=false;t.loader=null;t.session_name="PHPSESSID";t._ldObj=null;t._reqHeaders=[];t._openArgs=null;t._errors={inv_form_el:"Invalid FORM element detected: name=%, tag=%",must_be_single_el:"If used, <form> must be a single HTML element in the list.",js_invalid:"JavaScript code generated by backend is invalid!\n%",url_too_long:"Cannot use so long query with GET request (URL is larger than % bytes)",unk_loader:"Unknown loader: %",no_loaders:"No loaders registered at all, please check JsHttpRequest.LOADERS array",no_loader_matched:"Cannot find a loader which may process the request. Notices are:\n%"};t.abort=function(){with(this){if(_ldObj&&_ldObj.abort){_ldObj.abort()}_cleanup();if(readyState==0){return}if(readyState==1&&!_ldObj){readyState=0;return}_changeReadyState(4,true)}};t.open=function(_2,_3,_4,_5,_6){with(this){if(_3.match(/^((\w+)\.)?(GET|POST)\s+(.*)/i)){this.loader=RegExp.$2?RegExp.$2:null;_2=RegExp.$3;_3=RegExp.$4}try{if(document.location.search.match(new RegExp("[&?]"+session_name+"=([^&?]*)"))||document.cookie.match(new RegExp("(?:;|^)\\s*"+session_name+"=([^;]*)"))){_3+=(_3.indexOf("?")>=0?"&":"?")+session_name+"="+this.escape(RegExp.$1)}}catch(e){}_openArgs={method:(_2||"").toUpperCase(),url:_3,asyncFlag:_4,username:_5!=null?_5:"",password:_6!=null?_6:""};_ldObj=null;_changeReadyState(1,true);return true}};t.send=function(_7){if(!this.readyState){return}this._changeReadyState(1,true);this._ldObj=null;var _8=[];var _9=[];if(!this._hash2query(_7,null,_8,_9)){return}var _a=null;if(this.caching&&!_9.length){_a=this._openArgs.username+":"+this._openArgs.password+"@"+this._openArgs.url+"|"+_8+"#"+this._openArgs.method;var _b=JsHttpRequest.CACHE[_a];if(_b){this._dataReady(_b[0],_b[1]);return false}}var _c=(this.loader||"").toLowerCase();if(_c&&!JsHttpRequest.LOADERS[_c]){return this._error("unk_loader",_c)}var _d=[];var _e=JsHttpRequest.LOADERS;for(var _f in _e){var ldr=_e[_f].loader;if(!ldr){continue}if(_c&&_f!=_c){continue}var _11=new ldr(this);JsHttpRequest.extend(_11,this._openArgs);JsHttpRequest.extend(_11,{queryText:_8.join("&"),queryElem:_9,id:(new Date().getTime())+""+JsHttpRequest.COUNT++,hash:_a,span:null});var _12=_11.load();if(!_12){this._ldObj=_11;JsHttpRequest.PENDING[_11.id]=this;return true}if(!_c){_d[_d.length]="- "+_f.toUpperCase()+": "+this._l(_12)}else{return this._error(_12)}}return _f?this._error("no_loader_matched",_d.join("\n")):this._error("no_loaders")};t.getAllResponseHeaders=function(){with(this){return _ldObj&&_ldObj.getAllResponseHeaders?_ldObj.getAllResponseHeaders():[]}};t.getResponseHeader=function(_13){with(this){return _ldObj&&_ldObj.getResponseHeader?_ldObj.getResponseHeader(_13):null}};t.setRequestHeader=function(_14,_15){with(this){_reqHeaders[_reqHeaders.length]=[_14,_15]}};t._dataReady=function(_16,js){with(this){if(caching&&_ldObj){JsHttpRequest.CACHE[_ldObj.hash]=[_16,js]}responseText=responseXML=_16;responseJS=js;if(js!==null){status=200;statusText="OK"}else{status=500;statusText="Internal Server Error"}_changeReadyState(2);_changeReadyState(3);_changeReadyState(4);_cleanup()}};t._l=function(_18){var i=0,p=0,msg=this._errors[_18[0]];while((p=msg.indexOf("%",p))>=0){var a=_18[++i]+"";msg=msg.substring(0,p)+a+msg.substring(p+1,msg.length);p+=1+a.length}return msg};t._error=function(msg){msg=this._l(typeof(msg)=="string"?arguments:msg);msg="JsHttpRequest: "+msg;if(!window.Error){throw msg}else{if((new Error(1,"test")).description=="test"){throw new Error(1,msg)}else{throw new Error(msg)}}};t._hash2query=function(_1e,_1f,_20,_21){if(_1f==null){_1f=""}if((""+typeof(_1e)).toLowerCase()=="object"){var _22=false;if(_1e&&_1e.parentNode&&_1e.parentNode.appendChild&&_1e.tagName&&_1e.tagName.toUpperCase()=="FORM"){_1e={form:_1e}}for(var k in _1e){var v=_1e[k];if(v instanceof Function){continue}var _25=_1f?_1f+"["+this.escape(k)+"]":this.escape(k);var _26=v&&v.parentNode&&v.parentNode.appendChild&&v.tagName;if(_26){var tn=v.tagName.toUpperCase();if(tn=="FORM"){_22=true}else{if(tn=="INPUT"||tn=="TEXTAREA"||tn=="SELECT"){}else{return this._error("inv_form_el",(v.name||""),v.tagName)}}_21[_21.length]={name:_25,e:v}}else{if(v instanceof Object){this._hash2query(v,_25,_20,_21)}else{if(v===null){continue}if(v===true){v=1}if(v===false){v=""}_20[_20.length]=_25+"="+this.escape(""+v)}}if(_22&&_21.length>1){return this._error("must_be_single_el")}}}else{_20[_20.length]=_1e}return true};t._cleanup=function(){var _28=this._ldObj;if(!_28){return}JsHttpRequest.PENDING[_28.id]=false;var _29=_28.span;if(!_29){return}_28.span=null;var _2a=function(){_29.parentNode.removeChild(_29)};JsHttpRequest.setTimeout(_2a,50)};t._changeReadyState=function(s,_2c){with(this){if(_2c){status=statusText=responseJS=null;responseText=""}readyState=s;if(onreadystatechange){onreadystatechange()}}};t.escape=function(s){return escape(s).replace(new RegExp("\\+","g"),"%2B")}}JsHttpRequest.COUNT=0;JsHttpRequest.MAX_URL_LEN=2000;JsHttpRequest.CACHE={};JsHttpRequest.PENDING={};JsHttpRequest.LOADERS={};JsHttpRequest._dummy=function(){};JsHttpRequest.TIMEOUTS={s:window.setTimeout,c:window.clearTimeout};JsHttpRequest.setTimeout=function(b,c){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.s;if(typeof(b)=="string"){d=window.JsHttpRequest_tmp(b,c)}else{var d=null;var a=function(){b();delete JsHttpRequest.TIMEOUTS[d]};d=window.JsHttpRequest_tmp(a,c);JsHttpRequest.TIMEOUTS[d]=a}window.JsHttpRequest_tmp=null;return d};JsHttpRequest.clearTimeout=function(b){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.c;delete JsHttpRequest.TIMEOUTS[b];var a=window.JsHttpRequest_tmp(b);window.JsHttpRequest_tmp=null;return a};JsHttpRequest.query=function(a,e,d,c){var b=new this();b.caching=!c;b.onreadystatechange=function(){if(b.readyState==4){d(b.responseJS,b.responseText)}};b.open(null,a,true);b.send(e)};JsHttpRequest.dataReady=function(b){var a=this.PENDING[b.id];delete this.PENDING[b.id];if(a){a._dataReady(b.text,b.js)}else{if(a!==false){throw"dataReady(): unknown pending id: "+b.id}}};JsHttpRequest.extend=function(b,c){for(var a in c){b[a]=c[a]}};JsHttpRequest.LOADERS.xml={loader:function(req){JsHttpRequest.extend(req._errors,{xml_no:"Cannot use XMLHttpRequest or ActiveX loader: not supported",xml_no_diffdom:"Cannot use XMLHttpRequest to load data from different domain %",xml_no_headers:"Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported, needed to work with encodings correctly",xml_no_form_upl:"Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryElem.length){return["xml_no_form_upl"]}if(this.url.match(new RegExp("^([a-z]+://[^\\/]+)(.*)","i"))){if(RegExp.$1.toLowerCase()!=document.location.protocol+"//"+document.location.hostname.toLowerCase()){return["xml_no_diffdom",RegExp.$1]}}var xr=null;if(window.XMLHttpRequest){try{xr=new XMLHttpRequest()}catch(e){}}else{if(window.ActiveXObject){try{xr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}if(!xr){try{xr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}}}}if(!xr){return["xml_no"]}var _40=window.ActiveXObject||xr.setRequestHeader;if(!this.method){this.method=_40&&this.queryText.length?"POST":"GET"}if(this.method=="GET"){if(this.queryText){this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText}this.queryText="";if(this.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN]}}else{if(this.method=="POST"&&!_40){return["xml_no_headers"]}}this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+(req.caching?"0":this.id)+"-xml";var id=this.id;xr.onreadystatechange=function(){if(xr.readyState!=4){return}xr.onreadystatechange=JsHttpRequest._dummy;req.status=null;try{req.status=xr.status;req.responseText=xr.responseText}catch(e){}if(!req.status){return}try{eval("JsHttpRequest._tmp = function(id) { var d = "+req.responseText+"; d.id = id; JsHttpRequest.dataReady(d); }")}catch(e){return req._error("js_invalid",req.responseText)}JsHttpRequest._tmp(id);JsHttpRequest._tmp=null};xr.open(this.method,this.url,true,this.username,this.password);if(_40){for(var i=0;i<req._reqHeaders.length;i++){xr.setRequestHeader(req._reqHeaders[i][0],req._reqHeaders[i][1])}xr.setRequestHeader("Content-Type","application/octet-stream")}xr.send(this.queryText);this.span=null;this.xr=xr;return null};this.getAllResponseHeaders=function(){return this.xr.getAllResponseHeaders()};this.getResponseHeader=function(_43){return this.xr.getResponseHeader(_43)};this.abort=function(){this.xr.abort();this.xr=null}}};JsHttpRequest.LOADERS.script={loader:function(a){JsHttpRequest.extend(a._errors,{script_only_get:"Cannot use SCRIPT loader: it supports only GET method",script_no_form:"Cannot use SCRIPT loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryText){this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText}this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+this.id+"-"+"script";this.queryText="";if(!this.method){this.method="GET"}if(this.method!=="GET"){return["script_only_get"]}if(this.queryElem.length){return["script_no_form"]}if(this.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN]}var f=this,h=document,e=null,c=h.body;if(!window.opera){this.span=e=h.createElement("SCRIPT");var g=function(){e.language="JavaScript";if(e.setAttribute){e.setAttribute("src",f.url)}else{e.src=f.url}c.insertBefore(e,c.lastChild)}}else{this.span=e=h.createElement("SPAN");e.style.display="none";c.insertBefore(e,c.lastChild);e.innerHTML="Workaround for IE.<s"+"cript></"+"script>";var g=function(){e=e.getElementsByTagName("SCRIPT")[0];e.language="JavaScript";if(e.setAttribute){e.setAttribute("src",f.url)}else{e.src=f.url}}}JsHttpRequest.setTimeout(g,10);return null}}};JsHttpRequest.LOADERS.form={loader:function(a){JsHttpRequest.extend(a._errors,{form_el_not_belong:'Element "%" does not belong to any form!',form_el_belong_diff:'Element "%" belongs to a different form. All elements must belong to the same form!',form_el_inv_enctype:'Attribute "enctype" of the form must be "%" (for IE), "%" given.'});this.load=function(){var g=this;if(!g.method){g.method="POST"}g.url+=(g.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+g.id+"-"+"form";if(g.method=="GET"){if(g.queryText){g.url+=(g.url.indexOf("?")>=0?"&":"?")+g.queryText}if(g.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN]}var f=g.url.split("?",2);g.url=f[0];g.queryText=f[1]||""}var j=null;var h=false;if(g.queryElem.length){if(g.queryElem[0].e.tagName.toUpperCase()=="FORM"){j=g.queryElem[0].e;h=true;g.queryElem=[]}else{j=g.queryElem[0].e.form;for(var k=0;k<g.queryElem.length;k++){var l=g.queryElem[k].e;if(!l.form){return["form_el_not_belong",l.name]}if(l.form!=j){return["form_el_belong_diff",l.name]}}}if(g.method=="POST"){var c="multipart/form-data";var b=(j.attributes.encType&&j.attributes.encType.nodeValue)||(j.attributes.enctype&&j.attributes.enctype.value)||j.enctype;if(b!=c){return["form_el_inv_enctype",c,b]}}}var m=j&&(j.ownerDocument||j.document)||document;var q="jshr_i_"+g.id;var r=g.span=m.createElement("DIV");r.style.position="absolute";r.style.display="none";r.style.visibility="hidden";r.innerHTML=(j?"":"<form"+(g.method=="POST"?' enctype="multipart/form-data" method="post"':"")+"></form>")+'<iframe name="'+q+'" id="'+q+'" style="width:0px; height:0px; overflow:hidden; border:none"></iframe>';if(!j){j=g.span.firstChild}m.body.insertBefore(r,m.body.lastChild);var o=function(w,x){var d=[];var t=w;if(w.mergeAttributes){var t=m.createElement("form");t.mergeAttributes(w,false)}for(var u=0;u<x.length;u++){var s=x[u][0],p=x[u][1];d[d.length]=[s,t.getAttribute(s)];t.setAttribute(s,p)}if(w.mergeAttributes){w.mergeAttributes(t,false)}return d};var n=function(){top.JsHttpRequestGlobal=JsHttpRequest;var u=[];if(!h){for(var p=0,w=j.elements.length;p<w;p++){u[p]=j.elements[p].name;j.elements[p].name=""}}var v=g.queryText.split("&");for(var p=v.length-1;p>=0;p--){var s=v[p].split("=",2);var t=m.createElement("INPUT");t.type="hidden";t.name=unescape(s[0]);t.value=s[1]!=null?unescape(s[1]):"";j.appendChild(t)}for(var p=0;p<g.queryElem.length;p++){g.queryElem[p].e.name=g.queryElem[p].name}var d=o(j,[["action",g.url],["method",g.method],["onsubmit",null],["target",q]]);j.submit();o(j,d);for(var p=0;p<v.length;p++){j.lastChild.parentNode.removeChild(j.lastChild)}if(!h){for(var p=0,w=j.elements.length;p<w;p++){j.elements[p].name=u[p]}}};JsHttpRequest.setTimeout(n,100);return null}}};var Roar=new Class({Implements:[Options,Events,Chain],options:{duration:4000,position:"upperLeft",container:null,bodyFx:null,itemFx:null,margin:{x:10,y:10},offset:5,className:"roar",onShow:$empty,onHide:$empty,onRender:$empty,style:"notice"},initialize:function(a){this.setOptions(a);this.items=[];this.container=$(this.options.container)||document},alert:function(e,c,b){var d=Array.link(arguments,{title:String.type,message:String.type,options:Object.type});var a=[new Element("h3",{"html":$pick(d.title,"")})];if(d.message){a.push(new Element("p",{"html":d.message}))}return this.inject(a,d.options)},inject:function(a,j){if(!this.body){this.render()}j=j||{};var c=[-this.options.offset,0];var g=this.items.getLast();if(g){c[0]=g.retrieve("roar:offset");c[1]=c[0]+g.offsetHeight+this.options.offset}var f={"opacity":1};f[this.align.y]=c;var h=new Element("div",{"class":this.options.className,"opacity":0}).adopt(new Element("div",{"class":this.options.className+"-bg","opacity":0.7}),a);h.setStyle(this.align.x,0).store("roar:offset",c[1]).set("morph",$merge({unit:"px",link:"cancel",onStart:Chain.prototype.clearChain,transition:Fx.Transitions.Back.easeOut},this.options.itemFx));var d=this.remove.create({bind:this,arguments:[h],delay:10});this.items.push(h.addEvent("click",d));if(this.options.duration){var e=false;var b=(function(){b=null;if(!e){d()}}).delay(this.options.duration);h.addEvents({mouseover:function(){e=true},mouseout:function(){e=false;if(!b){d()}}})}h.inject(this.body).morph(f);return this.fireEvent("onShow",[h,this.items.length])},remove:function(b){var a=this.items.indexOf(b);if(a==-1){return this}this.items.splice(a,1);b.removeEvents();var c={opacity:0};c[this.align.y]=b.getStyle(this.align.y).toInt()-b.offsetHeight-this.options.offset;b.morph(c).get("morph").chain(b.destroy.bind(b));return this.fireEvent("onHide",[b,this.items.length]).callChain(b)},empty:function(){while(this.items.length){this.remove(this.items[0])}return this},render:function(){this.position=this.options.position;if($type(this.position)=="string"){var a={x:"center",y:"center"};this.align={x:"left",y:"top"};if((/left|west/i).test(this.position)){a.x="left"}else{if((/right|east/i).test(this.position)){this.align.x=a.x="right"}}if((/upper|top|north/i).test(this.position)){a.y="top"}else{if((/bottom|lower|south/i).test(this.position)){this.align.y=a.y="bottom"}}this.position=a}this.body=new Element("div",{"class":this.options.className+"-body"}).inject(document.body);if(Browser.Engine.trident4){this.body.addClass(this.options.className+"-body-ugly")}this.moveTo=this.body.setStyles.bind(this.body);this.reposition();if(this.options.bodyFx){var c=new Fx.Morph(this.body,$merge({unit:"px",chain:"cancel",transition:Fx.Transitions.Circ.easeOut},this.options.bodyFx));this.moveTo=c.start.bind(c)}var b=this.reposition.bind(this);window.addEvents({scroll:b,resize:b});this.fireEvent("onRender",this.body)},reposition:function(){var c=document.getCoordinates(),b=document.getScroll(),d=this.options.margin;c.left+=b.x;c.right+=b.x;c.top+=b.y;c.bottom+=b.y;var a=($type(this.container)=="element")?this.container.getCoordinates():c;this.moveTo({left:(this.position.x=="right")?(Math.min(a.right,c.right)-d.x):(Math.max(a.left,c.left)+d.x),top:(this.position.y=="bottom")?(Math.min(a.bottom,c.bottom)-d.y):(Math.max(a.top,c.top)+d.y)})}});var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(c,a,b){this.element=$(c)||$$(c);this.addEvent("onFired",a);this.setOptions(b);this.bound=this.changed.bind(this);this.resume()},changed:function(){var a=this.element.get("value");if($equals(this.value,a)){return}this.clear();this.value=a;this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(a){this.value=a;this.element.set("value",a);return this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){$clear(this.timeout||null);return this},pause:function(){if(this.timer){$clear(this.timer)}else{this.element.removeEvent("keyup",this.bound)}return this.clear()},resume:function(){this.value=this.element.get("value");if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)}else{this.element.addEvent("keyup",this.bound)}return this}});var $equals=function(b,a){return(b==a||JSON.encode(b)==JSON.encode(a))};var Autocompleter=new Class({Implements:[Options,Events],options:{minLength:1,markQuery:true,width:"inherit",maxChoices:10,injectChoice:null,customChoices:null,emptyChoices:null,visibleChoices:true,className:"autocompleter-choices",zIndex:42,delay:400,observerOptions:{},fxOptions:{},autoSubmit:false,overflow:false,overflowMargin:25,selectFirst:false,filter:null,filterCase:false,filterSubset:false,forceSelect:false,selectMode:true,choicesMatch:null,multiple:false,separator:", ",separatorSplit:/\s*[,;]\s*/,autoTrim:false,allowDupes:false,cache:true,relative:false},initialize:function(b,a){this.element=$(b);this.setOptions(a);this.build();this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({"delay":this.options.delay},this.options.observerOptions));this.queryValue=null;if(this.options.filter){this.filter=this.options.filter.bind(this)}var c=this.options.selectMode;this.typeAhead=(c=="type-ahead");this.selectMode=(c===true)?"selection":c;this.cached=[]},build:function(){if($(this.options.customChoices)){this.choices=this.options.customChoices}else{this.choices=new Element("ul",{"class":this.options.className,"styles":{"zIndex":this.options.zIndex}}).inject(document.body);this.relative=false;if(this.options.relative){this.choices.inject(this.element,"after");this.relative=this.element.getOffsetParent()}this.fix=new OverlayFix(this.choices)}if(!this.options.separator.test(this.options.separatorSplit)){this.options.separatorSplit=this.options.separator}this.fx=(!this.options.fxOptions)?null:new Fx.Tween(this.choices,$merge({"property":"opacity","link":"cancel","duration":200},this.options.fxOptions)).addEvent("onStart",Chain.prototype.clearChain).set(0);this.element.setProperty("autocomplete","off").addEvent((Browser.Engine.trident||Browser.Engine.webkit)?"keydown":"keypress",this.onCommand.bind(this)).addEvent("click",this.onCommand.bind(this,[false])).addEvent("focus",this.toggleFocus.create({bind:this,arguments:true,delay:100})).addEvent("blur",this.toggleFocus.create({bind:this,arguments:false,delay:100}))},destroy:function(){if(this.fix){this.fix.destroy()}this.choices=this.selected=this.choices.destroy()},toggleFocus:function(a){this.focussed=a;if(!a){this.hideChoices(true)}this.fireEvent((a)?"onFocus":"onBlur",[this.element])},onCommand:function(b){if(!b&&this.focussed){return this.prefetch()}if(b&&b.key&&!b.shift){switch(b.key){case"enter":if(this.element.value!=this.opted){return true}if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}break;case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var a=(b.key=="up");this.choiceOver((this.selected||this.choices)[(this.selected)?((a)?"getPrevious":"getNext"):((a)?"getLast":"getFirst")](this.options.choicesMatch),true)}return false;case"esc":case"tab":this.hideChoices(true);break}}return true},setSelection:function(f){var g=this.selected.inputValue,h=g;var a=this.queryValue.length,c=g.length;if(g.substr(0,a).toLowerCase()!=this.queryValue.toLowerCase()){a=0}if(this.options.multiple){var e=this.options.separatorSplit;h=this.element.value;a+=this.queryIndex;c+=this.queryIndex;var b=h.substr(this.queryIndex).split(e,1)[0];h=h.substr(0,this.queryIndex)+g+h.substr(this.queryIndex+b.length);if(f){var d=h.split(this.options.separatorSplit).filter(function(k){return this.test(k)},/[^\s,]+/);if(!this.options.allowDupes){d=[].combine(d)}var j=this.options.separator;h=d.join(j)+j;c=h.length}}this.observer.setValue(h);this.opted=h;if(f||this.selectMode=="pick"){a=c}this.element.selectRange(a,c);this.fireEvent("onSelection",[this.element,this.selected,h,g])},showChoices:function(){var c=this.options.choicesMatch,b=this.choices.getFirst(c);this.selected=this.selectedValue=null;if(this.fix){var e=this.element.getCoordinates(this.relative),a=this.options.width||"auto";this.choices.setStyles({"left":e.left,"top":e.bottom,"width":(a===true||a=="inherit")?e.width:a})}if(!b){return}if(!this.visible){this.visible=true;this.choices.setStyle("display","");if(this.fx){this.fx.start(1)}this.fireEvent("onShow",[this.element,this.choices])}if(this.options.selectFirst||this.typeAhead||b.inputValue==this.queryValue){this.choiceOver(b,this.typeAhead)}var d=this.choices.getChildren(c),f=this.options.maxChoices;var j={"overflowY":"hidden","height":""};this.overflown=false;if(d.length>f){var k=d[f-1];j.overflowY="scroll";j.height=k.getCoordinates(this.choices).bottom;this.overflown=true}this.choices.setStyles(j);this.fix.show();if(this.options.visibleChoices){var h=document.getScroll(),l=document.getSize(),g=this.choices.getCoordinates();if(g.right>h.x+l.x){h.x=g.right-l.x}if(g.bottom>h.y+l.y){h.y=g.bottom-l.y}window.scrollTo(Math.min(h.x,g.left),Math.min(h.y,g.top))}},hideChoices:function(a){if(a){var c=this.element.value;if(this.options.forceSelect){c=this.opted}if(this.options.autoTrim){c=c.split(this.options.separatorSplit).filter($arguments(0)).join(this.options.separator)}this.observer.setValue(c)}if(!this.visible){return}this.visible=false;if(this.selected){this.selected.removeClass("autocompleter-selected")}this.observer.clear();var b=function(){this.choices.setStyle("display","none");this.fix.hide()}.bind(this);if(this.fx){this.fx.start(0).chain(b)}else{b()}this.fireEvent("onHide",[this.element,this.choices])},prefetch:function(){var f=this.element.value,e=f;if(this.options.multiple){var c=this.options.separatorSplit;var a=f.split(c);var b=this.element.getSelectedRange().start;var g=f.substr(0,b).split(c);var d=g.length-1;b-=g[d].length;e=a[d]}if(e.length<this.options.minLength){this.hideChoices()}else{if(e===this.queryValue||(this.visible&&e==this.selectedValue)){if(this.visible){return false}this.showChoices()}else{this.queryValue=e;this.queryIndex=b;if(!this.fetchCached()){this.query()}}}return true},fetchCached:function(){return false;if(!this.options.cache||!this.cached||!this.cached.length||this.cached.length>=this.options.maxChoices||this.queryValue){return false}this.update(this.filter(this.cached));return true},update:function(b){this.choices.empty();this.cached=b;var a=b&&$type(b);if(!a||(a=="array"&&!b.length)||(a=="hash"&&!b.getLength())){(this.options.emptyChoices||this.hideChoices).call(this)}else{if(this.options.maxChoices<b.length&&!this.options.overflow){b.length=this.options.maxChoices}b.each(this.options.injectChoice||function(d){var c=new Element("li",{"html":this.markQueryValue(d)});c.inputValue=d;this.addChoiceEvents(c).inject(this.choices)},this);this.showChoices()}},choiceOver:function(c,d){if(!c||c==this.selected){return}if(this.selected){this.selected.removeClass("autocompleter-selected")}this.selected=c.addClass("autocompleter-selected");this.fireEvent("onSelect",[this.element,this.selected,d]);if(!this.selectMode){this.opted=this.element.value}if(!d){return}this.selectedValue=this.selected.inputValue;if(this.overflown){var f=this.selected.getCoordinates(this.choices),e=this.options.overflowMargin,g=this.choices.scrollTop,a=this.choices.offsetHeight,b=g+a;if(f.top-e<g&&g){this.choices.scrollTop=Math.max(f.top-e,0)}else{if(f.bottom+e>b){this.choices.scrollTop=Math.min(f.bottom-a+e,b)}}}if(this.selectMode){this.setSelection()}},choiceSelect:function(a){if(a){this.choiceOver(a)}this.setSelection(true);this.queryValue=false;this.hideChoices()},filter:function(a){return(a||this.tokens).filter(function(b){return this.test(b)},new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i"))},markQueryValue:function(a){return(!this.options.markQuery||!this.queryValue)?a:a.replace(new RegExp("("+((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp()+")",(this.options.filterCase)?"":"i"),'<span class="autocompleter-queried">$1</span>')},addChoiceEvents:function(a){return a.addEvents({"mouseover":this.choiceOver.bind(this,[a]),"click":this.choiceSelect.bind(this,[a])})}});var OverlayFix=new Class({initialize:function(a){if(Browser.Engine.trident){this.element=$(a);this.relative=this.element.getOffsetParent();this.fix=new Element("iframe",{"frameborder":"0","scrolling":"no","src":"javascript:false;","styles":{"position":"absolute","border":"none","display":"none","filter":"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).inject(this.element,"after")}},show:function(){if(this.fix){var a=this.element.getCoordinates(this.relative);delete a.right;delete a.bottom;this.fix.setStyles($extend(a,{"display":"","zIndex":(this.element.getStyle("zIndex")||1)-1}))}return this},hide:function(){if(this.fix){this.fix.setStyle("display","none")}return this},destroy:function(){if(this.fix){this.fix=this.fix.destroy()}}});Element.implement({getSelectedRange:function(){if(!Browser.Engine.trident){return{start:this.selectionStart,end:this.selectionEnd}}var e={start:0,end:0};var a=this.getDocument().selection.createRange();if(!a||a.parentElement()!=this){return e}var c=a.duplicate();if(this.type=="text"){e.start=0-c.moveStart("character",-100000);e.end=e.start+a.text.length}else{var b=this.value;var d=b.length-b.match(/[\n\r]*$/)[0].length;c.moveToElementText(this);c.setEndPoint("StartToEnd",a);e.end=d-c.text.length;c.setEndPoint("StartToStart",a);e.start=d-c.text.length}return e},selectRange:function(d,a){if(Browser.Engine.trident){var c=this.value.substr(d,a-d).replace(/\r/g,"").length;d=this.value.substr(0,d).replace(/\r/g,"").length;var b=this.createTextRange();b.collapse(true);b.moveEnd("character",d+c);b.moveStart("character",d);b.select()}else{this.focus();this.setSelectionRange(d,a)}return this}});Autocompleter.Base=Autocompleter;Autocompleter.Request=new Class({Extends:Autocompleter,options:{postData:{},ajaxOptions:{},postVar:"value"},query:function(){var c=$unlink(this.options.postData)||{};c[this.options.postVar]=this.queryValue;var b=$(this.options.indicator);if(b){b.setStyle("display","")}var a=this.options.indicatorClass;if(a){this.element.addClass(a)}this.fireEvent("onRequest",[this.element,this.request,c,this.queryValue]);this.request.send({"data":c})},queryResponse:function(){var b=$(this.options.indicator);if(b){b.setStyle("display","none")}var a=this.options.indicatorClass;if(a){this.element.removeClass(a)}return this.fireEvent("onComplete",[this.element,this.request])}});Autocompleter.Request.JSON=new Class({Extends:Autocompleter.Request,initialize:function(c,b,a){this.parent(c,a);this.request=new Request.JSON($merge({"url":b,"link":"cancel"},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(a){this.parent();this.update(a)}});Autocompleter.Request.HTML=new Class({Extends:Autocompleter.Request,initialize:function(c,b,a){this.parent(c,a);this.request=new Request.HTML($merge({"url":b,"link":"cancel","update":this.choices},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(a,b){this.parent();if(!b||!b.length){this.hideChoices()}else{this.choices.getChildren(this.options.choicesMatch).each(this.options.injectChoice||function(c){var d=c.get("text");c.inputValue=d;this.addChoiceEvents(c.set("html",this.markQueryValue(d)))},this);this.showChoices()}}});Autocompleter.Ajax={Base:Autocompleter.Request,Json:Autocompleter.Request.JSON,Xhtml:Autocompleter.Request.HTML};function show_login_form(){document.write('<div style="display: none;"><div class="login-popup" id="login-form"><div class="login-popup-top"><a href="#" class="close-block" onclick="return false;"></a></div><div class="content"><form action="http://musforest.ru/login/" method="post"><h3>Авторизация</h3><div class="lite-note"><a href="http://musforest.ru/registration/">Зарегистрироваться</a><label for="login-input">Логин или эл. почта</label></div><p><input type="text" class="input-text" name="login" tabindex="1" id="login-input"/></p><div class="lite-note"><a href="http://musforest.ru/login/reminder/" tabindex="-1">Напомнить пароль</a><label for="password-input">Пароль</label></div><p><input type="password" name="password" class="input-text" id="password-input" tabindex="2" /></p><div class="lite-note"><button type="submit" onfocus="blur()"><span><em>Войти</em></span></button><label for="remember_me" class="input-checkbox"><input type="checkbox" name="remember" id="remember_me" checked="checked" tabindex="3"/>Запомнить меня</label></div><input type="hidden" name="submit_login"/></form></div><div class="login-popup-bottom"></div></div></div>')}function show_top_right(){document.write('<div class="profile guest"><a href="http://musforest.ru/login/" onclick="return showLoginForm();">Войти</a> или <a href="http://musforest.ru/registration/" class="reg">Зарегистрироваться</a></div>')}String.implement({parseQuery:function(){var b=this.split(/[&;]/),a={};if(b.length){b.each(function(g){var c=g.indexOf("="),d=c<0?[""]:g.substr(0,c).match(/[^\]\[]+/g),e=decodeURIComponent(g.substr(c+1)),f=a;d.each(function(j,h){var k=f[j];if(h<d.length-1){f=f[j]=k||{}}else{if($type(k)=="array"){k.push(e)}else{f[j]=$defined(k)?[k,e]:e}}})})}return a},cleanQuery:function(a){return this.split("&").filter(function(e){var b=e.indexOf("="),c=b<0?"":e.substr(0,b),d=e.substr(b+1);return a?a.run([c,d]):$chk(d)}).join("&")}});ls_Event={eventId:0,today:"",menuAct:0,billDate:"",billCity:"",billDiv:"",billActiveColor:"#99CCEE",billRollOverColor:"#CFFF9F",billInActiveColor:"#EEEEEE",Rating_current:0,Rating_countVote:0,Rating_userIsVote:0,Respanel_weeksCount:1,Respanel_currentWeek:0,Respanel_weeksOrder:new Array(),Respanel_weeksTime:new Array(),GMapsInited:false,GMapLat:0,GMapLng:0,setField:function(b,a){$("event_"+b).value=a},Respanel_init:function(a){this.Respanel_currentTime=a||(new Date()).getTime();this.Respanel_weekBox=$$("#event_respanel div.week-box")[0];this.Respanel_weeks=$("event_respanel_weeks");this.Respanel_weekWidth=this.Respanel_weekBox.offsetWidth;this.Respanel_weeks.setStyle("width",this.Respanel_weekWidth);var b=$$("#event_respanel_weeks div.week")[0];if(!b){return alert("Can't find week panel.")}b.setStyle("width",this.Respanel_weekWidth);this.Respanel_weekTpl=b.innerHTML;this.Respanel_weeksOrder.push(1);this.Respanel_weeksTime.push(a*1000-1000*60*60*24)},Respanel_addWeek:function(a){var b="<div class='week' style='width:"+this.Respanel_weekWidth+"px;' id='event_respanel_week"+(this.Respanel_weeksCount++)+"'>"+this.Respanel_weekTpl+"</div>";this.Respanel_weeks.setStyle("width",this.Respanel_weekWidth*this.Respanel_weeksCount);if(a=="next"){var c=this.Respanel_weeksTime[this.Respanel_currentWeek]+1000*60*60*24*7;this.Respanel_weeksTime.push(c);this.Respanel_weeksOrder.push(this.Respanel_weeksCount);this.Respanel_weeks.removeChild(this.Respanel_weeks.getLast());this.Respanel_weeks.innerHTML=this.Respanel_weeks.innerHTML+b+'<div class="clearer">&nbsp;</div>'}else{var c=this.Respanel_weeksTime[this.Respanel_currentWeek]-1000*60*60*24*7;this.Respanel_weeks.innerHTML=b+this.Respanel_weeks.innerHTML;this.Respanel_weeksTime.unshift(c);this.Respanel_weeksOrder.unshift(this.Respanel_weeksCount);this.Respanel_move_next(true)}this.Respanel_putDays($("event_respanel_week"+(this.Respanel_weeksCount-1)),c)},Respanel_putDays:function(a,f){a=$(a);var b,c,g,d,e,j;var h=a.getElements("div.day");var k=this;$each(h,function(l,m){l.removeClass("today");l.removeClass("holiday");l.removeClass("active");b=f+1000*60*60*24*m;c=new Date();c.setTime(b);g=c.getDate();if(g<10){g="0"+g}d=c.getMonth()+1;if(d<10){d="0"+d}e=c.getDay();if(e==0||e==6){l.addClass("holiday")}l.id="date_"+c.getFullYear()+"-"+d+"-"+g;l.getElement("a.monthday").innerHTML=g;if(c.getMonth()!=(new Date()).getMonth()){l.getElement("a.monthday").innerHTML+=("."+d)}l.getElement("a.weekday").innerHTML=ls_Event.Respanel_langWeekDays[e]})},Respanel_day_over:function(b){b=$(b);if(b.hasClass("active")){return}var a=this.menuAct==0?[b]:$(b.parentNode).getChildren("div.day");a.each(function(c){c.set("morph",{"duration":"short"});c.morph({backgroundColor:ls_Event.billRollOverColor})})},Respanel_day_out:function(b){b=$(b);if(b.hasClass("active")){return}var a=this.menuAct==0?[b]:$(b.parentNode).getChildren("div.day");a.each(function(c){c.set("morph",{"duration":"short"});c.morph({backgroundColor:ls_Event.billInActiveColor})})},Respanel_arrow_over:function(b,a){(new Fx.Tween($(b))).set("opacity","1")},Respanel_arrow_out:function(a){(new Fx.Tween($(a))).set("opacity","0.7")},Respanel_move_next:function(a){a=a||false;if(this.menuAct==1){var b=$("event_respanel_week"+(this.Respanel_weeksOrder[this.Respanel_currentWeek]-1));var e=b.getChildren();e.each(function(d){d.removeClass("active");d.setStyle("background-color",this.billInActiveColor)})}if(!a&&this.Respanel_currentWeek>=this.Respanel_weeksCount-1){this.Respanel_addWeek("next")}var c=parseInt(this.Respanel_weeks.getElement(":first-child").getStyle("width"))*++this.Respanel_currentWeek;if(!a){(new Fx.Tween(this.Respanel_weeks)).start("left",-c);if(this.menuAct==1){this.billToggle(1)}}else{this.Respanel_weeks.setStyle("left",-c)}},Respanel_move_prev:function(a){a=a||false;if(this.menuAct==1){var b=$("event_respanel_week"+(this.Respanel_weeksOrder[this.Respanel_currentWeek]-1));var e=b.getChildren();e.each(function(d){d.removeClass("active");d.setStyle("background-color",this.billInActiveColor)})}if(!a&&this.Respanel_currentWeek<=0){this.Respanel_addWeek("prev")}var c=parseInt(this.Respanel_weeks.getElement(":first-child").getStyle("width"))*--this.Respanel_currentWeek;if(!a){(new Fx.Tween(this.Respanel_weeks)).start("left",-c);if(this.menuAct==1){this.billToggle(1)}}else{this.Respanel_weeks.setStyle("left",c)}},Respanel_setDate:function(b){if(b.hasClass("active")){return false}if(this.menuAct==1){return this.billToggle(1)}var a=$("date_"+this.billDate);a.removeClass("active");a.set("morph",{duration:"short"});a.morph({backgroundColor:this.billInActiveColor});b.addClass("active");b.set("morph",{duration:"short"});b.morph({backgroundColor:this.billActiveColor});ls_Event.billDate=b.id.replace("date_","");this.loadBill()},Rating_move:function(b,a){a=a||window.event;if(!b.className){b=b.parentNode}b.firstChild.style.width=((a.layerX||a.offsetX)/120*100)+"%";$("place_rating").innerHTML=parseInt((a.layerX||a.offsetX)*500/120)},Rating_out:function(b){b=b||window.event;var a=b.target||b.srcElement;if((a.className&&a.className=="stars")){return false}$("place_rating").innerHTML=this.Rating_current;$("place_rating_stars").style.width=(this.Rating_current/500*100+"%")},Rating_click:function(c,b){b=b||window.event;if(!c.className){c=c.parentNode}var a=Math.round((b.layerX||b.offsetX)*500/120);this.Rating_userIsVote=a;return lsVote.vote(this.placeId,c,a,"place")},Rating_voted:function(a){this.Rating_current=Math.round(a.iRating);this.Rating_countVote=a.iCountVote;$("place_rating").innerHTML=this.Rating_current;$("place_rating_stars").style.width=(this.Rating_current/500*100+"%");$("place_count_vote").innerHTML=a.iCountVote;this.Rating_userIsVote=true},loadBill:function(b,d){d=$(d||this.billDiv);b=b||{place_id:"*",date:ls_Event.billDate,time:"*",type:"*",limit:null},b.city=ls_Event.billCity||"*";b.type=ls_Event.billType||"*";var c=new Hash(b);if(c.date){var a=c.date.split("~");c.date=a.map(function(e){return ls_Event._convertDate(e,false)}).join("-")}location.hash=c.filter(function(f,e){return f!="*"}).toQueryString();d.getChildren()[1].setStyle("display","none");d.getChildren()[0].setStyle("display","block");JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/event_loadBill.php",b,function(e,f){if(!e){msgErrorBox.alert("Error","Please try again later")}else{if(e.bStateError){msgErrorBox.alert(e.sMsgTitle,e.sMsg)}else{d.getChildren()[0].setStyle("display","none");d.getChildren()[1].set("html",e.sText);d.getChildren()[1].setStyle("display","block")}}},true)},billToggle:function(c){$("event_bill_menu"+this.menuAct).removeClass("active");$("event_bill_menu"+c).addClass("active");this.menuAct=c;if(c<2){$("event_respanel").style.display="block";$("event_time_select").style.display="none";if(lastday=$("date_"+this.billDate)){lastday.removeClass("active");lastday.setStyle("background-color",this.billInActiveColor)}var a=$("event_respanel_week"+(this.Respanel_weeksOrder[this.Respanel_currentWeek]-1));var d=a.getChildren();d.each(function(e){if(c==1){e.addClass("active");e.set("morph",{duration:"short"});e.morph({backgroundColor:this.billActiveColor})}else{e.removeClass("active");e.set("morph",{duration:"short"});e.morph({backgroundColor:this.billInActiveColor})}});if(c==0){d[1].addClass("active");d[1].setStyle("background-color",this.billActiveColor);this.billDate=d[1].id.replace("date_","")}else{this.billDate=d[0].id.replace("date_","")+"~"+d[d.length-2].id.replace("date_","")}this.loadBill()}else{var b=this.billDate.split("~");if(b.length<2){b[1]=b[0]}b.each(function(e,f){b[f]=ls_Event._convertDate(e,false)});$("event_time_select_from").value=b[0];$("event_time_select_to").value=b[1];$("event_respanel").style.display="none";$("event_time_select").style.display="block"}},selectCity:function(a){setTimeout(function(){if(!a.focused){if(a.value!=ls_Event.billCity){ls_Event.billCity=a.value;if(!a.value||a.value=="*"||a.value==ls_Event.lang_cities_all){a.value=ls_Event.lang_cities_all;ls_Event.billCity="*"}ls_Event.loadBill()}a.removeClass("focused")}},100)},selectType:function(c,a){types=c.split(",").map(function(d){return d.trim()});var b=$("event_complexpanel").getElements("a");b.each(function(d){if(types.contains(d.get("text"))){d.addClass("active")}else{d.removeClass("active")}});this.billType=c==this.lang_types_all?"*":c;if(a){return}this.loadBill()},dateSelect:function(a){var d,c;var b=this;setTimeout(function(){d=$("event_time_select_from").value;c=$("event_time_select_to").value;b.billDate=b._convertDate(d,true)+"~"+b._convertDate(c,true);b.loadBill()},500)},_convertDate:function(c,d){if(c=="*"){return c}d=d||(c.indexOf(".")!=-1);var b;var a;if(d){a=c.split(".");b=a[2]+"-"+a[1]+"-"+a[0]}else{a=c.split("-");b=a[2]+"."+a[1]+"."+a[0]}return b},parseWordsInDate:function(b){var a=b.split("-");var b=a.map(function(c){return ls_Event._wordToDate(c)}).join("-");if(b.indexOf("-")!=b.lastIndexOf("-")){b=b.substring(0,b.indexOf("-",b.indexOf("-")+1))}return b},_wordToDate:function(g){var e,f;var c=(new Date()).getTime();var b=1000*60*60*24;var h,a;switch(g){case"today":e=new Date();break;case"tomorrow":e=new Date(c+1*b);break;case"yesterday":e=new Date(c-1*b);break;case"thisweek":e=new Date();f=new Date(c+6*b);break;case"nextweek":e=new Date(c+7*b);f=new Date(c+13*b);break;case"lastweek":e=new Date(c-7*b);f=new Date(c-1*b);break;case"thismonth":e=new Date();f=new Date(c+30*b);break;case"nextmonth":e=new Date(c+30*b);f=new Date(c+60*b);break;case"lastmonth":e=new Date(c-30*b);f=new Date(c-1*b);break;default:return g}h=e.getDate();a=e.getMonth()+1;e=(h<10?"0"+h:h)+"."+(a<10?"0"+a:a)+"."+e.getFullYear();if(f){h=f.getDate();a=f.getMonth()+1;e=e+"-"+((h<10?"0"+h:h)+"."+(a<10?"0"+a:a)+"."+f.getFullYear())}return e},joinLeave:function(b,a){b=$(b);JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/event_joinLeave.php",{idEvent:a},function(c,e){if(!c){msgErrorBox.alert("Error","Please try again later")}else{if(c.bStateError){msgErrorBox.alert(c.sMsgTitle,c.sMsg)}else{msgNoticeBox.alert(c.sMsgTitle,c.sMsg);if(b){if(c.bState){$("event_join_true").style.display="none";$("event_join_false").style.display="inline"}else{$("event_join_true").style.display="inline";$("event_join_false").style.display="none"}var d=$("event_user_count_"+a);if(d){d.set("text",c.iCountUser)}}}}},true)},GMapInit:function(b,d,a,c){if(this.GMapsInited){return true}else{this.GMapsInited=true}if(!GBrowserIsCompatible()){return}ls_Event.GMap=new GMap2(b);ls_Event.GMap.setCenter(new GLatLng(d,a),13);ls_Event.GMap.addControl(new GLargeMapControl());ls_Event.GMap.addControl(new GMapTypeControl());ls_Event.GMap.enableScrollWheelZoom();ls_Event.GMapMarker=new GMarker(ls_Event.GMap.getCenter());ls_Event.GMap.addOverlay(ls_Event.GMapMarker);if(c){GEvent.addListener(ls_Event.GMap,"click",function(e,f){ls_Event.GMapMarker.setLatLng(f);$("form_gmap_lat").value=f.lat();$("form_gmap_lng").value=f.lng()})}window.addEvent("unload",function(){GUnload()})},toggleEdit:function(d,b){var a=$("event_edit_form").getChildren("div");a.each(function(e){e.setStyle("display","none")});$("eventEdit_div"+d).setStyle("display","block");var c=$("event_edit_menu").getChildren("li");c.each(function(e){e.toggleClass("active")});if(ls_Event&&(d==1&&!ls_Event.GMapsInited)){ls_Event.GMapInit($("gmap_canvas"),this.GMapLat,this.GMapLng,true)}}};ls_Place={placeId:0,selectedTypes:Array(),selectedTypesMaxLength:0,Rating_current:0,Rating_countVote:0,Rating_userIsVote:0,GMapLat:0,GMapLng:0,catalogueCity:"",catalogueType:"",catalogueDiv:"",catalogueTitleLike:"",setField:function(b,a){$("place_"+b).value=a},create_addType:function(b){if(this.selectedTypesMaxLength==0){return true}var a=b.id.substring(b.id.lastIndexOf("_")+1);if(this.selectedTypes.contains(a)){this.selectedTypes.erase(a)}else{if(this.selectedTypes.length<this.selectedTypesMaxLength){this.selectedTypes.push(a)}}b.parentNode.getElements("input[type=checkbox]").each(function(c){c.disabled=c.checked?false:this.selectedTypes.length>=this.selectedTypesMaxLength},this)},Rating_move:function(b,a){a=a||window.event;if(!b.className){b=b.parentNode}b.firstChild.style.width=((a.layerX||a.offsetX)/120*100)+"%";$("place_rating").innerHTML=parseInt((a.layerX||a.offsetX)*500/120)},Rating_out:function(b){b=b||window.event;var a=b.target||b.srcElement;if((a.className&&a.className=="stars")){return false}$("place_rating").innerHTML=this.Rating_current;$("place_rating_stars").style.width=(this.Rating_current/500*100+"%")},Rating_click:function(c,b){b=b||window.event;if(!c.className){c=c.parentNode}var a=Math.round((b.layerX||b.offsetX)*500/120);this.Rating_userIsVote=a;return lsVote.vote(this.placeId,c,a,"place")},Rating_voted:function(a){this.Rating_current=Math.round(a.iRating);this.Rating_countVote=a.iCountVote;$("place_rating").innerHTML=this.Rating_current;$("place_rating_stars").style.width=(this.Rating_current/500*100+"%");$("place_count_vote").innerHTML=a.iCountVote;this.Rating_userIsVote=true},joinLeave:function(b,a){b=$(b);JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/place_joinLeave.php",{idPlace:a},function(c,e){if(!c){msgErrorBox.alert("Error","Please try again later")}else{if(c.bStateError){msgErrorBox.alert(c.sMsgTitle,c.sMsg)}else{msgNoticeBox.alert(c.sMsgTitle,c.sMsg);if(b){if(c.bState){$("place_join_true").style.display="none";$("place_join_false").style.display="inline"}else{$("place_join_true").style.display="inline";$("place_join_false").style.display="none"}var d=$("place_user_count_"+a);if(d){d.set("text",c.iCountUser)}}}}},true)},toggleEdit:function(d,b){var a=$("place_edit_form").getChildren("div");a.each(function(e){e.setStyle("display","none")});$("placeEdit_div"+d).setStyle("display","block");var c=$("place_edit_menu").getChildren("li");c.each(function(e){e.toggleClass("active")});if(ls_Event&&(d==1&&!ls_Event.GMapsInited)){ls_Event.GMapInit($("gmap_canvas"),this.GMapLat,this.GMapLng,true)}},selectCity:function(a){setTimeout(function(){if(!a.focused){if(a.value!=ls_Place.catalogueCity){ls_Place.catalogueCity=a.value;if(!a.value||a.value=="*"||a.value==ls_Place.lang_cities_all){a.value=ls_Place.lang_cities_all;ls_Place.catalogueCity="*"}ls_Place.loadCatalogue()}a.removeClass("focused")}},100)},selectType:function(c,a){types=c.split(",").map(function(d){return d.trim()});var b=$("place_types").getElements("a");b.each(function(d){if(types.contains(d.get("text"))||types.contains(d.get("nativetext"))){d.addClass("active")}else{d.removeClass("active")}});this.catalogueType=c==this.lang_types_all?"*":c;if(a){return}this.loadCatalogue()},loadCatalogue:function(b,a){a=$(a||this.catalogueDiv);b=b||{},b.city=ls_Place.catalogueCity||"*";b.type=ls_Place.catalogueType||"*";b.sortby=ls_Place.catalogueSortBy;b.titlelike=ls_Place.catalogueTitleLike;var c=new Hash(b);location.hash=c.filter(function(e,d){return e!="*"}).toQueryString();a.getChildren()[1].setStyle("display","none");a.getChildren()[0].setStyle("display","block");JsHttpRequest.query(DIR_WEB_ROOT+"/include/ajax/place_loadCatalogue.php",b,function(d,e){if(!d){msgErrorBox.alert("Error","Please try again later")}else{if(d.bStateError){msgErrorBox.alert(d.sMsgTitle,d.sMsg)}else{a.getChildren()[0].setStyle("display","none");a.getChildren()[1].set("html",d.sText);a.getChildren()[1].setStyle("display","block")}}},true)},profile_EventsFilter:function(b){var c=$("place_events_filter").getChildren("li");c.each(function(f){f.removeClass("active")});var e=$("place_events_filter").getFirst("li."+b)||$("place_events_filter").getFirst("li.all");e.addClass("active");var d=ls_Event.parseWordsInDate(b).split("-");var a=d.map(function(f){return ls_Event._convertDate(f,true)}).join("~");ls_Event.loadBill({place_id:this.placeId,date:a})}};function toggleBlogInfo(d,a){a=$(a);var b=$(d);var c=new Fx.Slide(b);if(b.getStyle("display")=="none"){c.hide();b.setStyle("display","block")}a.toggleClass("inactive");c.toggle()}function show_search_form(){document.write('<div class="web-icons"><a href="http://music-forest.livejournal.com/" title="MusicForest в LiveJornal" class="lj" target="blank"></a><a href="http://vkontakte.ru/club13121980" title="MusicForest в контакте" class="vkontakte" target="blank"></a><a href="http://twitter.com/MusForest" title="MusicForest в Twitter\'е" class="twitter" target="blank"></a></div><div class="search"><form action="http://musforest.ru/search/topics/" method="get"><input class="text" type="text" onblur="if (!value) value=defaultValue" onclick="if (value==defaultValue) value=\'\'" value="Поиск" name="q" /><input class="button" type="submit" value="" /></form></div>')}function submitTags(a){window.location=DIR_WEB_ROOT+"/tag/"+a+"/";return false}function show_tag_search_form(a){document.write('&nbsp;&nbsp;<form action="" method="GET" onsubmit="return submitTags(this.tag.value);"><img src="http://musforest.ru/templates/skin/musforest/images/tagcloud.gif" border="0" style="margin-left: 13px;">&nbsp;<input type="text" name="tag" value="'+a+'" class="tags-input" ></form><br>')}function totwitter(a,b){document.write('<a href="http://twitter.com/home/?status='+a+"+"+b+'+@MusForest" title="В твиттер" target="blank" rel="nofollow"></a>')}function tbtm(f,b,a,e,c,g,h,d){document.write('<ul class="voting '+f+'"><li class="plus"><a href="#" onclick="lsVote.vote('+b+',this,1,\'topic\'); return false;"></a></li><li class="total" title="всего проголосовало: '+a+'"> '+e+' </li><li class="minus"><a href="#" onclick="lsVote.vote('+b+',this,-1,\'topic\'); return false;"></a></li><li class="date">'+c+'</li><li class="author"><a href="http://musforest.ru/profile/'+d+'/">'+d+"</a></li><li><div class='yashare-auto-init' style='margin-top:-4px' data-yashareL10n='ru' data-yashareType='none' data-yashareQuickServices='yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,lj,friendfeed,moikrug,gbuzz,blogger,linkedin'></div></li></ul>")}function tbtm_l(f,b,a,e,c,g,h,d){if(e==""){e='<a href="#" onclick="lsVote.vote('+b+",this,0,'topic'); return false;\">&mdash;</a>"}document.write('<ul class="voting '+f+'"><li class="plus"><a href="#" onclick="lsVote.vote('+b+',this,1,\'topic\'); return false;"></a></li><li class="total" title="всего проголосовало: '+a+'"> '+e+' </li><li class="minus"><a href="#" onclick="lsVote.vote('+b+',this,-1,\'topic\'); return false;"></a></li><li class="date">'+c+'</li><li class="author"><a href="http://musforest.ru/profile/'+d+'/">'+d+'</a></li><li class="comments-total"><a href="'+g+'#comments" title="комментировать"><span class="red">комментировать</span></a></li><li><div class="yashare-auto-init" style="margin-top:-4px" data-yashareL10n="ru" data-yashareType="none" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,lj,friendfeed,moikrug,gbuzz,blogger,linkedin" data-yashareLink="'+g+'" data-yashareTitle="'+h+'"></div></li></ul>')};
