function geogebra_display(C,F,B,E){var G=$jq(B).parent().parent();if(ie){G.html('<div id="dp'+C+"-geogebra"+F+'"><object id="p'+C+"-geogebra"+F+'" style="width: 550px; height: 400px;" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"><param name="archive" value="includes/geogebra/geogebra.jar" /><param name="java_code" value="geogebra.GeoGebraApplet" /><param name="java_codebase" value="." /><param name="filename" value="'+E+'" /><param name="framePossible" value="false" /></object></div>')}else{var D='<object id="p'+C+"-geogebra"+F+'" style="width: 550px; height: 400px;" type="application/x-java-applet" archive="includes/geogebra/geogebra.jar" ><param name="archive" value="includes/geogebra/geogebra.jar" /><param name="java_code" value="geogebra.GeoGebraApplet" /><param name="java_codebase" value="." /><param name="filename" value="'+E+'" /><param name="framePossible" value="false" /></object>';G.html('<div id="dp'+C+"-geogebra"+F+'">'+D+"</div>")}var A='<div class="geogebra-c"><input type="button" class="liteoption" value="Reset picture" onclick="geogebra_reset(\'p'+C+"-geogebra"+F+'\');" /><input type="button" class="liteoption" value="Hide picture" onclick="geogebra_hide('+C+", "+F+', this);" /></div>';G.append(A)}function geogebra_hide(B,C,A){$jq("#dp"+B+"-geogebra"+C).hide();$jq(A).parent().html('<input type="button" class="mainoption" value="Click to view applet" onclick="geogebra_show('+B+", "+C+', this);" />')}function geogebra_show(B,C,A){var D=$jq(A).parent().parent();$jq("#dp"+B+"-geogebra"+C).show();$jq(A).parent().remove();D.append('<div class="geogebra-c"><input type="button" class="liteoption" value="Reset picture" onclick="geogebra_reset(\'p'+B+"-geogebra"+C+'\');" /><input type="button" class="liteoption" value="Hide picture" onclick="geogebra_hide('+B+", "+C+', this);" /></div>')}function geogebra_insert(C,A,B){var D=$jq("object#"+C)[0].getXML();$jq.post("includes/ajax/ajax.php",{"class":"geogebra",subdir:"geogebra",xml_text:D,in_wiki:A},function(E){if(E.msg!=undefined){alert(E.msg);return false}if(confirm("Click OK if you want to close the current window, or Cancel if you want to keep editing")){geogebra_emoticon(E.bbcode,A);window.close()}},"json")}function geogebra_reset(B,A){if((A==undefined)||confirm("Are you sure you want to reset this picture?")){$jq("object#"+B)[0].reset()}}function geogebra_emoticon(B,A){if(opener!=null){if(A){geogebra_emoticon_insert(opener.document.forms.editform.wpTextbox1,B)}else{geogebra_emoticon_insert(opener.document.forms.post.message,B)}}}function geogebra_emoticon_insert(D,C){C=" "+C+" ";if(D.createTextRange&&D.caretPos){var B=D.caretPos;var A;if(ie){A=document.selection.createRange().duplicate().boundingHeight}if(A!=D.caretPos.boundingHeight){D.focus();geogebra_storeCaret(D)}B.text=B.text.charAt(B.text.length-1)==" "?B.text+C+" ":B.text+C;D.focus()}else{if((D.selectionEnd|D.selectionEnd==0)&&(D.selectionStart|D.selectionStart==0)){geogebra_mozInsert(D,C,"")}else{D.value+=C;D.focus()}}}function geogebra_mozInsert(F,D,C){var E=(typeof(F.scrollTop)=="number"?F.scrollTop:-1);if(F.selectionEnd>F.value.length){F.selectionEnd=F.value.length}var B=F.selectionStart;var A=F.selectionEnd+D.length;F.value=F.value.slice(0,B)+D+F.value.slice(B);F.value=F.value.slice(0,A)+C+F.value.slice(A);F.selectionStart=B+D.length;F.selectionEnd=A;F.focus();if(E>=0){F.scrollTop=E}}function geogebra_storeCaret(A){if(A.createTextRange){A.caretPos=document.selection.createRange().duplicate()}}$(document).ready(function(){$("a.hidetag").click(function(A){A.preventDefault();$(this).next().toggle();return false})});(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return}for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);function link_to_post(A,B){B=typeof(B)!="undefined"?B:"viewtopic";temp=prompt(L_LINK_TO,"http://"+SERVER_NAME+B+".php?p="+A+"#"+A);return false}function link_to_topic(A,B){B=typeof(B)!="undefined"?B:"viewtopic";temp=prompt(L_LINK_TO,"http://"+SERVER_NAME+B+".php?t="+A);return false}function marklist(id,name,state){var parent=document.getElementById(id);if(!parent){eval("parent = document."+id)}if(!parent){return}var rb=parent.getElementsByTagName("input");for(var r=0;r<rb.length;r++){if(rb[r].name.substr(0,name.length)==name){rb[r].checked=state}}}function MM_swapImgRestore(){var C,A,B=document.MM_sr;for(C=0;B&&C<B.length&&(A=B[C])&&A.oSrc;C++){A.src=A.oSrc}}function MM_preloadImages(){var D=document;if(D.images){if(!D.MM_p){D.MM_p=new Array()}var C,B=D.MM_p.length,A=MM_preloadImages.arguments;for(C=0;C<A.length;C++){if(A[C].indexOf("#")!=0){D.MM_p[B]=new Image;D.MM_p[B++].src=A[C]}}}}function MM_findObj(E,D){var C,B,A;if(!D){D=document}if((C=E.indexOf("?"))>0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B<D.forms.length;B++){A=D.forms[B][E]}for(B=0;!A&&D.layers&&B<D.layers.length;B++){A=MM_findObj(E,D.layers[B].document)}if(!A&&document.getElementById){A=document.getElementById(E)}return A}function MM_swapImage(){var D,C=0,A,B=MM_swapImage.arguments;document.MM_sr=new Array;for(D=0;D<(B.length-2);D+=3){if((A=MM_findObj(B[D]))!=null){document.MM_sr[C++]=A;if(!A.oSrc){A.oSrc=A.src}A.src=B[D+2]}}}function img_popup(D,C,B,A){screenwidth=false;screenwidth=screen.Width;if(!screenwidth){screenwidth=window.outerWidth}screenheight=false;screenheight=screen.Height;if(!screenheight){screenheight=window.outerHeight}if(screenwidth<(C+30)||screenheight<(B+30)||C==null||B==null){window.open(D,"limit_image_mod_popup_img_"+A,"resizable=yes,top=0,left=0,screenX=0,screenY=0,scrollbars=yes",false)}else{window.open(D,"limit_image_mod_popup_img_"+A,"resizable=yes,top=0,left=0,screenX=0,screenY=0,height="+(B+30)+",width="+(C+30),false)}}function _hideBBCode(){this.objs=[];return this}_hideBBCode.prototype.IsDisplaySupported=function(){if(window.opera&&!document.childNodes){return false}if(document.getElementById||document.all){return true}return false};_hideBBCode.prototype.getObj=function(A){return(document.getElementById?document.getElementById(A):(document.all?document.all[A]:(document.layers?document.layers[A]:null)))};_hideBBCode.prototype.displayObj=function(D,B){var A=this.getObj(D);if(!A){return}var C=(document.layers?A:A.style);if(this.IsDisplaySupported()){C.display=B}else{C.visibility=(B=="none"?"hidden":"visible")}};_hideBBCode.prototype.open=function(D){var C="",A="hide"+Math.floor(Math.random()*15000);var B=(this.IsDisplaySupported()?"display:none;":"visibility:hidden;");if(document.layers){B="position:relative;"+B}C+='<div class="hidetitle"><a class="postlink" href="javascript:hideBBCode.showHide(\''+A+'\');" onmouseover="top.status=\'\';" onfocus="this.blur();">'+D+"</a></div>";C+='<div id="'+A+'" style="'+B+'" class="hide">';document.write(C);this.objs[A]="none"};_hideBBCode.prototype.close=function(){document.write("</div>")};_hideBBCode.prototype.showHide=function(A){if(!this.objs[A]){return}this.objs[A]=((this.objs[A]=="none")?"block":"none");this.displayObj(A,this.objs[A])};var hideBBCode=new _hideBBCode();function page_jump(A,B,C){pages=1;cur_st=page_start;cur_page=1;if(B%C==0){pages=B/C}else{pages=Math.ceil(B/C)}msg=jump_from+" "+pages;if(cur_st>0){cur_page=cur_st/C;cur_page=cur_page-1}show_page=1;if(cur_page<pages){show_page=cur_page+1}if(cur_page>=pages){show_page=cur_page-1}else{show_page=cur_page+1}userPage=prompt(msg,show_page);if(userPage>0){if(userPage<1){userPage=1}if(userPage>pages){userPage=pages}if(userPage==1){start=0}else{start=(userPage-1)*C}window.location=A+"&start="+start}}function sprintf(){if(!arguments||arguments.length<1||!RegExp){return}var I=arguments[0];var G=/([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;var Q=b=[],A=0,E=0;while(Q=G.exec(I)){var H=Q[1],N=Q[2],R=Q[3],M=Q[4];var J=Q[5],F=Q[6],C=Q[7];E++;if(F=="%"){B="%"}else{A++;if(A>=arguments.length){alert("Error! Not enough function arguments ("+(arguments.length-1)+", excluding the string)\nfor the number of substitution parameters in string ("+A+" so far).")}var D=arguments[A];var O="";if(N&&N.substr(0,1)=="'"){O=H.substr(1,1)}else{if(N){O=N}}var K=true;if(R&&R==="-"){K=false}var P=-1;if(M){P=parseInt(M)}var L=-1;if(J&&F=="f"){L=parseInt(J.substring(1))}var B=D;if(F=="b"){B=parseInt(D).toString(2)}else{if(F=="c"){B=String.fromCharCode(parseInt(D))}else{if(F=="d"){B=parseInt(D)?parseInt(D):0}else{if(F=="u"){B=Math.abs(D)}else{if(F=="f"){B=(L>-1)?Math.round(parseFloat(D)*Math.pow(10,L))/Math.pow(10,L):parseFloat(D)}else{if(F=="o"){B=parseInt(D).toString(8)}else{if(F=="s"){B=D}else{if(F=="x"){B=(""+parseInt(D).toString(16)).toLowerCase()}else{if(F=="X"){B=(""+parseInt(D).toString(16)).toUpperCase()}}}}}}}}}}I=H+B+C}return I}function _alert(C,B){var A=document.getElementById(C);A.innerHTML=B}function dE(C,A){var B=document.getElementById(C);if(!A){A=(B.style.display==""||B.style.display=="block")?-1:1}B.style.display=(A==1)?"block":"none"}function subPanels(D){var B,C,A;if(typeof(D)=="string"){show_panel=D}for(B=0;B<panels.length;B++){C=document.getElementById(panels[B]);A=document.getElementById(panels[B]+"-tab");if(C){if(panels[B]==show_panel){C.style.display="block";if(A){A.className="activetab"}}else{C.style.display="none";if(A){A.className=""}}}}}function displayBlocks(F,D,A){var C=(D.checked==true)?1:-1;if(A){C*=-1}var B=document.getElementsByTagName("DIV");for(var E=0;E<B.length;E++){if(B[E].className.indexOf(F)==0){B[E].style.display=(C==1)?"none":"block"}}}function selectCode(A){var D=A.parentNode.parentNode.getElementsByTagName("CODE")[0];if(document.selection){var C=document.body.createTextRange();C.moveToElementText(D);C.select()}else{var B=window.getSelection();var C=document.createRange();C.setStartBefore(D);C.setEndAfter(D);B.addRange(C)}}function leq(B,A){if(B<A){return true}else{return false}}function jumpto(B,C,A){var D=prompt(JUMP_PAGE,A);if(D!==null&&!isNaN(D)&&D>0){param=B.indexOf("?")!=-1?"&":"?";document.location.href=B.replace(/&amp;/g,"&")+param+"start="+((D-1)*C)}}function poplatex(D,C,B){if(!C){C=500}if(!B){B=200}if(ie){L_LATEX_POPUP_TITLE=L_CODE}var A=window.open("",L_LATEX_POPUP_TITLE,"width="+C+", height="+B+", resizable=yes, scrollbars=yes, menubar=no, toolbar=no, location=no, status=yes");A.document.write('<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>'+L_LATEX_POPUP_TITLE+'</title><link rel="stylesheet" href="'+STYLESHEET+'" /><link rel="stylesheet" href="'+CODEBOX_STYLESHEET+'" /><script type="text/javascript" src="http://'+SERVER_NAME+'js/latex_code.js" ><\/script></head><body><div style="width: 95%; padding: 5px; text-align: left;"><dl class="codebox" style="width: 95%;"><dt>'+L_CODE+': <a href="#" onclick="selectCode(this); return false;">'+L_SELECT_ALL+"</a></dt><dd><code>"+D+"</code></dd></dl></div></body></html>");A.document.close();A.focus()}$(function(){$("a.latex").click(function(B){B.preventDefault();var A=window.open(this.href,"","width=550, height=400, resizable=yes, scrollbars=yes, menubar=no, toolbar=no, location=no, status=no");A.focus();return false});$("a.latexcenter").click(function(B){B.preventDefault();var A=window.open(this.href,"","width=550, height=400, resizable=yes, scrollbars=yes, menubar=no, toolbar=no, location=no, status=no");A.focus();return false})});function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/; domain = "+COOKIE_DOMAIN}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function GlobalReplaceWithComma(B,A){while(A.indexOf(B)!=-1){A=A.replace(B,",")}return A}function GlobalReplaceComma(A,B){while(B.indexOf(",")!=-1){B=B.replace(",",A)}return B}function _dom_toggle(){return this}_dom_toggle.prototype.objref=function(A){return document.getElementById?document.getElementById(A):(document.all?document.all[A]:(document.layers?document.layers[A]:null))};_dom_toggle.prototype.cancel_event=function(){if(window.event){window.event.cancelBubble=true}};_dom_toggle.prototype.save_toggle_status=function(F,A,D,B){F=F.replace(A,"");var E=readCookie(D);var C="%2C";E=GlobalReplaceWithComma(C,E);if(B){if(E==null||E==""){createCookie(D,F,365)}else{E=E+","+F;E=GlobalReplaceComma(C,E);createCookie(D,E,365)}}else{E=","+E+",";F=","+F+",";E=GlobalReplaceWithComma(F,E);E=E.substring(1,E.length-1);E=GlobalReplaceComma(C,E);createCookie(D,E,365)}};_dom_toggle.prototype.toggle=function(H,E,D,G,A,F){var B=this.objref(H);var C=this.objref(E);if(B&&B.style){if(B.style.display=="none"){B.style.display="";if(F!=""){this.save_toggle_status(H,A,F,false)}}else{B.style.display="none";if(F!=""){this.save_toggle_status(H,A,F,true)}}if(C&&C.src){C.src=(B.style.display=="none")?D:G}}this.cancel_event()};dom_toggle=new _dom_toggle();var keep_toggle_status=1;(function(A){A.widget("ui.stars",{init:function(){var B=this,E=this.options;E.isSelect=E.inputType=="select";this.$selec=E.isSelect?A("select",this.element):null;this.$rboxs=E.isSelect?A("option",this.$selec):A(":radio",this.element);this.$stars=this.$rboxs.map(function(H){if(H==0){E.split=typeof E.split!="number"?0:E.split;E.val2id=[];E.id2val=[];E.id2title=[];E.name=E.isSelect?B.$selec.get(0).name:this.name;E.disabled=E.disabled||(E.isSelect?A(B.$selec).attr("disabled"):A(this).attr("disabled"));E.items=0}E.items++;E.val2id[this.value]=H;E.id2val[H]=this.value;E.id2title[H]=(E.isSelect?this.text:this.title)||this.value;if(E.selected==H||(E.selected==-1&&(E.isSelect?this.defaultSelected:this.defaultChecked))){E.checked=H;E.value=E.id2val[H];E.title=E.id2title[H]}var G=A("<div/>").addClass(E.starClass);var I=A("<a/>").attr("title",E.showTitles?E.id2title[H]:"").text(this.value);if(E.split){var F=(H%E.split);var J=Math.floor(E.starWidth/E.split);G.width(J);I.css("margin-left","-"+(F*J)+"px")}return G.append(I).get(0)});this.$cancel=A("<div/>").addClass(E.cancelClass).append(A("<a/>").attr("title",E.showTitles?E.cancelTitle:"").text(E.cancelValue));this.$value=A('<input type="hidden" name="'+E.name+'" value="'+E.value+'" />');E.cancelShow&=!E.disabled&&!E.oneVoteOnly;this.element.empty();if(E.cancelShow){this.element.append(this.$cancel)}this.element.append(this.$stars);this.element.append(this.$value);E.isSelect?this.$selec.remove():this.$rboxs.remove();if(E.checked===undefined){E.checked=-1;E.value=E.cancelValue;E.title="";if(E.cancelShow){this._disableCancel()}}else{C(E.checked,false)}if(E.disabled){this.disable()}A(window).bind("unload",function(){B.$cancel.unbind(".stars");B.$stars.unbind(".stars");B.$selec=B.$rboxs=B.$stars=B.$value=B.$cancel=null});function D(){B.$stars.removeClass([E.starOnClass,E.starHoverClass].join(" "));B._showCap("")}function C(F,H){if(F!=-1){var I=H?E.starHoverClass:E.starOnClass;var G=H?E.starOnClass:E.starHoverClass;B.$stars.eq(F).prevAll("."+E.starClass).andSelf().removeClass(G).addClass(I);B.$stars.eq(F).nextAll("."+E.starClass).removeClass([E.starHoverClass,E.starOnClass].join(" "));B._showCap(E.id2title[F])}else{D()}}this.$stars.bind("click.stars",function(){if(!E.forceSelect&&E.disabled){return false}var F=B.$stars.index(this);E.checked=F;E.value=E.id2val[F];E.title=E.id2title[F];B.$value.attr({disabled:E.disabled?"disabled":"",value:E.value});C(F,false);B._disableCancel();if(!E.forceSelect){B.callback("star")}}).bind("mouseover.stars",function(){if(B.options.explain.length==1){B.options.explain.show()}if(E.disabled){return false}var F=B.$stars.index(this);C(F,true)}).bind("mouseout.stars",function(){if(B.options.explain.length==1){B.options.explain.hide()}if(E.disabled){return false}C(B.options.checked,false)});this.$cancel.bind("click.stars",function(){if(!E.forceSelect&&E.disabled){return false}var F=E.value!=E.cancelValue;E.checked=-1;E.value=E.cancelValue;E.title="";B.$value.attr({value:E.value,disabled:"disabled"});D();B._disableCancel();if(!E.forceSelect){B.callback(F?"cancel":"cancel_second_click")}}).bind("mouseover.stars",function(){if(B._disableCancel()){return false}B.$cancel.addClass(E.cancelHoverClass);D();B._showCap(E.cancelTitle)}).bind("mouseout.stars",function(){if(B._disableCancel()){return false}B.$cancel.removeClass(E.cancelHoverClass);B.$stars.triggerHandler("mouseout.stars")})},select:function(C){var B=this.options;B.forceSelect=true;if(C==B.cancelValue){this.$cancel.triggerHandler("click.stars")}else{this.$stars.eq(B.val2id[C]).triggerHandler("click.stars")}B.forceSelect=false},selectID:function(C){var B=this.options;B.forceSelect=true;if(C==-1){this.$cancel.triggerHandler("click.stars")}else{this.$stars.eq(C).triggerHandler("click.stars")}B.forceSelect=false},enable:function(){this.options.disabled=false;this._disableAll()},disable:function(){this.options.disabled=true;this._disableAll()},_disableCancel:function(){var C=this.options,B=C.disabled||C.oneVoteOnly||(C.value==C.cancelValue);if(B){this.$cancel.removeClass(C.cancelHoverClass).addClass(C.cancelDisabledClass)}else{this.$cancel.removeClass(C.cancelDisabledClass)}this.$cancel.setOpacity(B?0.5:1)},_disableAll:function(){var B=this.options;this._disableCancel();if(B.disabled){this.$stars.filter("div").addClass(B.starDisabledClass)}else{this.$stars.filter("div").removeClass(B.starDisabledClass)}},_showCap:function(B){var C=this.options;if(C.captionEl){C.captionEl.text(B)}},destroy:function(){this.options.isSelect?this.$selec.appendTo(this.element):this.$rboxs.appendTo(this.element);this.$cancel.unbind(".stars").remove();this.$stars.unbind(".stars").remove();this.$value.remove();this.element.unbind(".stars").removeData("stars")},callback:function(B){var C=this.options;C.callback(this,B,C.value);if(C.oneVoteOnly&&!C.disabled){this.disable()}}});A.ui.stars.defaults={inputType:"select",split:0,selected:-1,disabled:false,cancelTitle:"Cancel Rating",cancelValue:0,cancelShow:true,oneVoteOnly:false,showTitles:false,captionEl:null,callback:function(C,B,D){},explain:"",starWidth:17,cancelClass:"rating-stars-cancel",starClass:"rating-stars-star",starOnClass:"rating-stars-star-on",starHoverClass:"rating-stars-star-hover",starDisabledClass:"rating-stars-star-disabled",cancelHoverClass:"rating-stars-cancel-hover",cancelDisabledClass:"rating-stars-cancel-disabled"}})(jQuery);$(function(){$("span.cantrate").hide();$("div.stars-display").each(function(){var A=$(this).parent().find("span.cantrate");if(A.length==1){$(this).stars({split:2,explain:A})}else{$(this).stars({split:2})}$(this).parent().show()});$("div.stars-wrapper").each(function(){$(this).stars({captionEl:$(this).next(),callback:function(D,B,C){var A=$(this).attr("name").substring(6);$.post("includes/ajax/ajax.php",{"class":"rating",subdir:"ratings",p:A,del:B=="cancel"?1:0,r:C},function(E){var F=E.u;$('span[name="ur_'+F+'"]').each(function(){$(this).html(E["ur_"+F])});$("#stars-display-"+E.p).stars("select",2*E["r_"+A])},"json")}});if(!$.browser.msie&&($.browser.version<8)){$(this).setOpacity(0.5);$(this).bind("mouseover",function(){$(this).setOpacity(1)}).bind("mouseout",function(){$(this).setOpacity(0.5)})}})});(function(A){A.fn.sortOptions=function(E,D,F){var C=typeof(E)=="undefined"?true:!!E;var B=typeof(D)=="undefined"?false:!!D;var G=typeof(F)=="undefined"?0:F*1;this.each(function(){if(this.nodeName.toLowerCase()!="select"){return}var J=this.options;var H=J.length;var K=[];for(var I=0;I<H;I++){K[I]={v:J[I].value,t:J[I].text}}K.sort(function(M,L){o1t=M.t.toLowerCase(),o2t=L.t.toLowerCase();if(B){if(M.v==G){return -1}if(L.v==G){return 1}}if(o1t==o2t){return 0}if(C){return o1t<o2t?-1:1}else{return o1t>o2t?-1:1}});for(var I=0;I<H;I++){J[I].text=K[I].t;J[I].value=K[I].v}});return this}})(jQuery);function catsInit(){$jq("#cats_edit").html('<a href="#" onclick="cats_mod_init(); return false;">Edit categories</a>')}function cats_add_category(){if($jq("#category-cat").val()==0){var A=$jq("#category-new");var C=$jq.trim(A.val());if(C==""){alert("You need to put in a name for the category!");A.val("");A.focus();return false}$jq.post("includes/ajax/ajax.php",{"class":"ajax_blog_cats",subdir:"blogs/ajax",cat_name:C,w:WEBLOG_ID},function(D){if(D.error==0){cat_write_selected(D.cat_id,C);A.val("")}else{alert(D.error)}},"json")}else{var B=$jq("#category-cat").val();var C=$jq("#category-cat option[value="+B+"]");cat_write_selected(B,C.html());C.remove();if($jq("#category-cat option").length==1){$jq("#category-cat option").html("No other categories available")}}}function cat_write_selected(B,A){if($jq("#category-opt").length<1){$jq("#category-new").before('<div><select id="category-opt" name="category-opt[]" multiple="multiple" size="1"><option value="'+B+'">'+A+'</option></select><input value="Remove" id="category-remove" name="category-remove" type="submit"><input value="'+B+'" id="category-options" name="category-options" type="hidden"></div>');$jq("#category-remove").click(function(C){C.preventDefault();cats_remove_category()})}else{$jq("#category-opt").append('<option value="'+B+'">'+A+"</option>");$jq("#category-opt").attr("size",1+1*$jq("#category-opt").attr("size"));$jq("#category-options").val($jq("#category-options").val()+","+B)}}function cats_remove_category(){if($jq("#category-opt").val()==null){alert("Select a category to remove first");return false}var C=$jq("#category-opt").val();var D=","+$jq("#category-options").val()+",";if($jq("#category-cat option").length==1){$jq("#category-cat option").html("Select a category from below")}for(var B=0;B<C.length;++B){$jq("#category-cat").append('<option value="'+C[B]+'">'+$jq("#category-opt option[value="+C[B]+"]").html()+"</option>")}$jq("#category-cat").sortOptions(true,true);var A=$jq("#category-opt").attr("size");if(C.length==A){$jq("#category-remove").parent().remove()}else{for(var B=0;B<C.length;++B){D.replace(","+C[B]+",",",");$jq("#category-opt option[value="+C[B]+"]").remove()}$jq("#category-opt").attr("size",(A*1)-C.length);$jq("#category-options").val(D.slice(1,D.length-1))}}function cats_mod_init(){var A=$jq("ul.cats li");for(var B=0;B<A.length;++B){cats_create_edit_del_controls(A[B])}$jq("ul.cats").append('<li id="li_cats_add_cat"><input type="button" value="Add a new category" onclick="cats_add_cat();" /></li>');$jq("#cats_edit").html('<a href="#" onclick="cats_remove_mod_buttons(); return false;">Exit mod view</a>')}function cats_add_cat(){var A='<input type="text" size="10" value="" id="cats_add_cat" />';A+='<input type="image" src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/ok.gif" onclick="cats_add_ok(); return false;" style="border: 0; padding: 0 5px;" />';A+='<input type="image" src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/back.gif" onclick="cats_add_back(); return false;" style="border: 0; padding: 0 5px;" />';$jq("#li_cats_add_cat").html(A);$jq("#cats_add_cat").focus();$jq("#cats_add_cat").keyup(function(B){if(B.keyCode==13){cats_add_ok()}})}function cats_add_ok(){var A=$jq("#cats_add_cat");if($jq.trim(A.val())==""){alert("You need to put in a name for the category!");A.val("");A.focus();return false}$jq.post("includes/ajax/ajax.php",{"class":"ajax_blog_cats",subdir:"blogs/ajax",cat_name:A.val(),w:WEBLOG_ID},function(B){if(B.error==0){$jq("#li_cats_add_cat").before(B.message);cats_create_edit_del_controls("#li_cat_"+B.cat_id);$jq("#li_cats_add_cat").html('<input type="button" value="Add a new category" onclick="cats_add_cat();" />')}else{alert(B.error)}},"json")}function cats_add_back(){$jq("#li_cats_add_cat").remove();$jq("ul.cats").append('<li id="li_cats_add_cat"><input type="button" value="Add a new category" onclick="cats_add_cat();" /></li>')}function cats_edit_cat(C){var B=$jq("#li_cat_"+C+" a");$jq("#li_cat_"+C+" input").remove();var A='<input type="text" size="10" value="'+B.text()+'" id="cats_edit_'+C+'" />';A+='<input type="image" src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/ok.gif" onclick="cats_edit_ok('+C+'); return false;" style="border: 0; padding: 0 5px;" />';A+='<input type="image" src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/back.gif" onclick="cats_edit_back('+C+'); return false;" style="border: 0; padding: 0 5px;" />';B.after(A);B.hide();$jq("#cats_edit_"+C).focus();$jq("#cats_edit_"+C).keyup(function(D){if(D.keyCode==13){cats_edit_ok(C)}})}function cats_create_edit_del_controls(A){$jq(A).append('<input type="image" src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/bs_edit.gif" value="Edit" onclick="cats_edit_cat('+$jq(A).attr("id").substring(7)+'); return false;" style="border: 0; padding: 0 5px;" /><input type="image"  src="http://'+SERVER_NAME+'templates/blogs/Hyperion/images/bs_delete.gif" value="Delete" onclick="cats_delete_cat('+$jq(A).attr("id").substring(7)+'); return false;" style="border: 0; padding: 0 5px;" />')}function cats_edit_ok(B){var A=$jq("#cats_edit_"+B);if($jq.trim(A.val())==""){alert("You need to put in a name for the category!");A.val("");A.focus();return false}$jq.post("includes/ajax/ajax.php",{"class":"ajax_blog_cats",subdir:"blogs/ajax",cat_id:B,cat_name:A.val()},function(C){if(C.error==0){$jq("#li_cat_"+B+" a").html($jq.trim(A.val()));$jq("#li_cat_"+B+" a").show();$jq("#li_cat_"+B+" input").remove();cats_create_edit_del_controls("#li_cat_"+B)}else{alert(C.error)}},"json")}function cats_edit_back(A){$jq("#li_cat_"+A+" a").show();$jq("#li_cat_"+A+" input").remove();cats_create_edit_del_controls($jq("#li_cat_"+A))}function cats_delete_cat(A){if(confirm("Are you sure you want to delete this category?")){$jq.post("includes/ajax/ajax.php",{"class":"ajax_blog_cats",subdir:"blogs/ajax",cat_id:A,cat_name:"",del:1},function(B){if(B.error==0){$jq("#li_cat_"+A).remove()}else{alert(B.error)}},"json")}}function cats_remove_mod_buttons(){$jq("ul.cats li input").remove();$jq("#li_cats_add_cat").remove();catsInit()}function blogsInit(){if(!ie){$jq("#feed_link").click(function(){prompt(L_COPY_RSS,this.href);return false})}catsInit();$jq("ul.cats li").css("line-height","24px");$jq("ul.cats a").css({"vertical-align":"middle"});$jq("#category-sel-add").click(function(A){A.preventDefault();cats_add_category()});if($jq("#category-remove").length>0){$jq("#category-remove").click(function(A){A.preventDefault();cats_remove_category()})}}function Calendar_picker(B,D,C,A){this.state=0;this.name=B;this.curDate=new Date();this.mode=D;this.selectMultiple=(A==true);this.selectedDates=new Array();this.calendar;this.calHeading;this.calCells;this.rows;this.cols;this.cells=new Array();this.monthSelect;this.yearSelect;this.mousein=false;this.calConfig();this.setDays();this.displayYear=this.displayYearInitial;this.displayMonth=this.displayMonthInitial;this.createCalendar();if(this.mode=="popup"&&C&&C.type=="text"){this.tgt=C;this.calendar.style.position="absolute";this.topOffset=this.tgt.offsetHeight;this.leftOffset=0;this.calendar.style.top=this.getTop(C)+this.topOffset+"px";this.calendar.style.left=this.getLeft(C)+this.leftOffset+"px";document.body.appendChild(this.calendar);this.tgt.calendar=this;this.tgt.onfocus=function(){this.calendar.show()};this.tgt.onblur=function(){if(!this.calendar.mousein){this.calendar.hide()}}}else{this.container=C;this.container.appendChild(this.calendar)}this.state=2;this.visible?this.show():this.hide()}Calendar_picker.prototype.calConfig=function(){this.displayYearInitial=this.curDate.getFullYear();this.displayMonthInitial=this.curDate.getMonth();this.rangeYearLower=2004;this.rangeYearUpper=2009;this.minDate=new Date(2004,0,1);this.maxDate=new Date(2009,0,1);this.startDay=0;this.showWeeks=true;this.selCurMonthOnly=false;this.clearSelectedOnChange=true;switch(this.mode){case"popup":this.visible=false;break;case"flat":this.visible=true;break}this.setLang()};Calendar_picker.prototype.setLang=function(){this.daylist=new Array("Su","Mo","Tu","We","Th","Fr","Sa","Su","Mo","Tu","We","Th","Fr","Sa");this.months_sh=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");this.monthup_title="Go to the next month";this.monthdn_title="Go to the previous month";this.clearbtn_caption="Clear";this.clearbtn_title="Clears any dates selected on the calendar";this.maxrange_caption="This is the maximum range"};Calendar_picker.prototype.getTop=function(A){var C=A;var B=0;while(C.tagName!="BODY"){B+=C.offsetTop;C=C.offsetParent}return B};Calendar_picker.prototype.getLeft=function(A){var C=A;var B=0;while(C.tagName!="BODY"){B+=C.offsetLeft;C=C.offsetParent}return B};Calendar_picker.prototype.show=function(){this.calendar.style.display="block";this.visible=true};Calendar_picker.prototype.hide=function(){this.calendar.style.display="none";this.visible=false};Calendar_picker.prototype.toggle=function(){if(this.visible){this.hide()}else{this.show()}};Calendar_picker.prototype.setDays=function(){this.daynames=new Array();var A=0;for(var B=this.startDay;B<this.startDay+7;B++){this.daynames[A++]=this.daylist[B]}this.monthDayCount=new Array(31,((this.curDate.getFullYear()-2000)%4?28:29),31,30,31,30,31,31,30,31,30,31)};Calendar_picker.prototype.setClass=function(A,B){A.setAttribute("class",B);A.setAttribute("className",B)};Calendar_picker.prototype.createCalendar=function(){var A,B,C;this.calendar=document.createElement("table");this.calendar.setAttribute("id",this.name+"_calendar");this.setClass(this.calendar,"calendar");this.calendar.onselectstart=function(){return false};this.calendar.ondrag=function(){return false};A=document.createElement("tbody");B=document.createElement("tr");C=document.createElement("td");C.appendChild(this.createMainHeading());B.appendChild(C);A.appendChild(B);B=document.createElement("tr");C=document.createElement("td");C.appendChild(this.createDayHeading());B.appendChild(C);A.appendChild(B);B=document.createElement("tr");C=document.createElement("td");C.setAttribute("id",this.name+"_cell_td");this.calCellContainer=C;C.appendChild(this.createCalCells());B.appendChild(C);A.appendChild(B);B=document.createElement("tr");C=document.createElement("td");C.appendChild(this.createFooter());B.appendChild(C);A.appendChild(B);this.calendar.appendChild(A);this.calendar.owner=this;this.calendar.onmouseover=function(){this.owner.mousein=true};this.calendar.onmouseout=function(){this.owner.mousein=false}};Calendar_picker.prototype.createMainHeading=function(){var A=document.createElement("div");A.setAttribute("id",this.name+"_mainheading");this.setClass(A,"mainheading");this.monthSelect=document.createElement("select");this.yearSelect=document.createElement("select");var E=document.createElement("input"),D=document.createElement("input");var C,B;for(B=0;B<12;B++){C=document.createElement("option");C.setAttribute("value",B);if(this.state==0&&this.displayMonth==B){C.setAttribute("selected","selected")}C.appendChild(document.createTextNode(this.months_sh[B]));this.monthSelect.appendChild(C)}for(B=this.rangeYearLower;B<=this.rangeYearUpper;B++){C=document.createElement("option");C.setAttribute("value",B);if(this.state==0&&this.displayYear==B){C.setAttribute("selected","selected")}C.appendChild(document.createTextNode(B));this.yearSelect.appendChild(C)}D.setAttribute("type","button");D.setAttribute("value",">");D.setAttribute("title",this.monthup_title);E.setAttribute("type","button");E.setAttribute("value","<");E.setAttribute("title",this.monthdn_title);this.monthSelect.owner=this.yearSelect.owner=D.owner=E.owner=this;D.onmouseup=function(){this.owner.nextMonth()};E.onmouseup=function(){this.owner.prevMonth()};this.monthSelect.onchange=function(){this.owner.displayMonth=this.value;this.owner.displayYear=this.owner.yearSelect.value;this.owner.goToMonth(this.owner.displayYear,this.owner.displayMonth)};this.yearSelect.onchange=function(){this.owner.displayMonth=this.owner.monthSelect.value;this.owner.displayYear=this.value;this.owner.goToMonth(this.owner.displayYear,this.owner.displayMonth)};A.appendChild(E);A.appendChild(this.monthSelect);A.appendChild(this.yearSelect);A.appendChild(D);return A};Calendar_picker.prototype.createFooter=function(){var A=document.createElement("div");var B=document.createElement("input");B.setAttribute("type","button");B.setAttribute("value",this.clearbtn_caption);B.setAttribute("title",this.clearbtn_title);B.owner=this;B.onclick=function(){this.owner.resetSelections(false)};A.appendChild(B);return A};Calendar_picker.prototype.resetSelections=function(A){this.selectedDates=new Array();this.rows=new Array(false,false,false,false,false,false,false);this.cols=new Array(false,false,false,false,false,false,false);if(this.tgt){this.tgt.value="";if(this.mode=="popup"){this.hide()}}if(A==true){this.goToMonth(this.displayYearInitial,this.displayMonthInitial)}else{this.reDraw()}};Calendar_picker.prototype.createDayHeading=function(){this.calHeading=document.createElement("table");this.calHeading.setAttribute("id",this.name+"_caldayheading");this.setClass(this.calHeading,"caldayheading");var A,B,D;A=document.createElement("tbody");B=document.createElement("tr");this.cols=new Array(false,false,false,false,false,false,false);if(this.showWeeks){D=document.createElement("td");D.setAttribute("class","wkhead");D.setAttribute("className","wkhead");B.appendChild(D)}for(var C=0;C<7;C++){D=document.createElement("td");D.appendChild(document.createTextNode(this.daynames[C]));if(this.selectMultiple){D.headObj=new CalHeading(this,D,(C+this.startDay<7?C+this.startDay:C+this.startDay-7))}B.appendChild(D)}A.appendChild(B);this.calHeading.appendChild(A);return this.calHeading};Calendar_picker.prototype.createCalCells=function(){this.rows=new Array(false,false,false,false,false,false);this.cells=new Array();var J=-1,C=(this.showWeeks?48:42);var D=new Date(this.displayYear,this.displayMonth,1);var G=new Date(this.displayYear,this.displayMonth,this.monthDayCount[this.displayMonth]);var A=new Date(D);A.setDate(A.getDate()+(this.startDay-D.getDay())-(this.startDay-D.getDay()>0?7:0));this.calCells=document.createElement("table");this.calCells.setAttribute("id",this.name+"_calcells");this.setClass(this.calCells,"calcells");var F,H,B;F=document.createElement("tbody");for(var E=0;E<C;E++){if(this.showWeeks){if(E%8==0){J++;H=document.createElement("tr");B=document.createElement("td");if(this.selectMultiple){B.weekObj=new WeekHeading(this,B,A.getWeek(),J)}else{B.setAttribute("class","wkhead");B.setAttribute("className","wkhead")}B.appendChild(document.createTextNode(A.getWeek()));H.appendChild(B);E++}}else{if(E%7==0){J++;H=document.createElement("tr")}}B=document.createElement("td");B.appendChild(document.createTextNode(A.getDate()));var I=new CalCell(this,B,A,J);this.cells.push(I);B.cellObj=I;A.setDate(A.getDate()+1);H.appendChild(B);F.appendChild(H)}this.calCells.appendChild(F);this.reDraw();return this.calCells};Calendar_picker.prototype.reDraw=function(){this.state=1;var B,A;for(B=0;B<this.cells.length;B++){this.cells[B].selected=false}for(B=0;B<this.cells.length;B++){for(A=0;A<this.selectedDates.length;A++){if(this.cells[B].date.getUeDay()==this.selectedDates[A].getUeDay()){this.cells[B].selected=true}}this.cells[B].setClass()}this.state=2};Calendar_picker.prototype.deleteCells=function(){this.calCellContainer.removeChild(this.calCellContainer.firstChild);this.cells=new Array()};Calendar_picker.prototype.goToMonth=function(A,B){this.monthSelect.value=this.displayMonth=B;this.yearSelect.value=this.displayYear=A;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells())};Calendar_picker.prototype.nextMonth=function(){if(this.monthSelect.value<11){this.monthSelect.value++}else{if(this.yearSelect.value<this.rangeYearUpper){this.monthSelect.value=0;this.yearSelect.value++}else{alert(this.maxrange_caption)}}this.displayMonth=this.monthSelect.value;this.displayYear=this.yearSelect.value;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells())};Calendar_picker.prototype.prevMonth=function(){if(this.monthSelect.value>0){this.monthSelect.value--}else{if(this.yearSelect.value>this.rangeYearLower){this.monthSelect.value=11;this.yearSelect.value--}else{alert(this.maxrange_caption)}}this.displayMonth=this.monthSelect.value;this.displayYear=this.yearSelect.value;this.deleteCells();this.calCellContainer.appendChild(this.createCalCells())};Calendar_picker.prototype.addZero=function(A){return((A<10)?"0":"")+A};Calendar_picker.prototype.addDates=function(D,E){var A,C;for(var B=0;B<D.length;B++){C=false;for(A=0;A<this.selectedDates.length;A++){if(D[B].getUeDay()==this.selectedDates[A].getUeDay()){C=true;break}}if(!C){this.selectedDates.push(D[B])}}if(E!=false){this.reDraw()}};Calendar_picker.prototype.removeDates=function(C,D){var A;for(var B=0;B<C.length;B++){for(A=0;A<this.selectedDates.length;A++){if(C[B].getUeDay()==this.selectedDates[A].getUeDay()){this.selectedDates.splice(A,1)}}}if(D!=false){this.reDraw()}};Calendar_picker.prototype.outputDate=function(C,I){var J=this.addZero(C.getDate());var G=this.addZero(C.getMonth()+1);var A=this.addZero(C.getFullYear());var F=this.addZero(C.getFullYear().toString().substring(3,4));var H=(I.indexOf("yyyy")>-1?A:F);var E=this.addZero(C.getHours());var D=this.addZero(C.getMinutes());var B=this.addZero(C.getSeconds());return I.replace(/dd/g,J).replace(/mm/g,G).replace(/y{1,4}/g,H).replace(/hh/g,E).replace(/nn/g,D).replace(/ss/g,B)};Calendar_picker.prototype.updatePos=function(A){this.calendar.style.top=this.getTop(A)+this.topOffset+"px";this.calendar.style.left=this.getLeft(A)+this.leftOffset+"px"};function CalHeading(A,C,B){this.owner=A;this.tableCell=C;this.dayOfWeek=B;this.tableCell.onclick=this.onclick}CalHeading.prototype.onclick=function(){var A=this.headObj.owner;var E=A.selectedDates;var C=A.cells;A.cols[this.headObj.dayOfWeek]=!A.cols[this.headObj.dayOfWeek];for(var D=0;D<C.length;D++){if(C[D].dayOfWeek==this.headObj.dayOfWeek&&(!A.selCurMonthOnly||C[D].date.getMonth()==A.displayMonth&&C[D].date.getFullYear()==A.displayYear)){if(A.cols[this.headObj.dayOfWeek]){if(A.selectedDates.arrayIndex(C[D].date)==-1){E.push(C[D].date)}}else{for(var B=0;B<E.length;B++){if(C[D].dayOfWeek==E[B].getDay()){E.splice(B,1);break}}}C[D].selected=A.cols[this.headObj.dayOfWeek]}}A.reDraw()};function WeekHeading(A,D,B,C){this.owner=A;this.tableCell=D;this.week=B;this.tableRow=C;this.tableCell.setAttribute("class","wkhead");this.tableCell.setAttribute("className","wkhead");this.tableCell.onclick=this.onclick}WeekHeading.prototype.onclick=function(){var A=this.weekObj.owner;var C=A.cells;var E=A.selectedDates;var D,B;A.rows[this.weekObj.tableRow]=!A.rows[this.weekObj.tableRow];for(D=0;D<C.length;D++){if(C[D].tableRow==this.weekObj.tableRow){if(A.rows[this.weekObj.tableRow]&&(!A.selCurMonthOnly||C[D].date.getMonth()==A.displayMonth&&C[D].date.getFullYear()==A.displayYear)){if(A.selectedDates.arrayIndex(C[D].date)==-1){E.push(C[D].date)}}else{for(B=0;B<E.length;B++){if(E[B].getTime()==C[D].date.getTime()){E.splice(B,1);break}}}}}A.reDraw()};function CalCell(A,D,B,C){this.owner=A;this.tableCell=D;this.cellClass;this.selected=false;this.date=new Date(B);this.dayOfWeek=this.date.getDay();this.week=this.date.getWeek();this.tableRow=C;this.tableCell.onclick=this.onclick;this.tableCell.onmouseover=this.onmouseover;this.tableCell.onmouseout=this.onmouseout;this.setClass()}CalCell.prototype.onmouseover=function(){this.setAttribute("class",this.cellClass+" hover");this.setAttribute("className",this.cellClass+" hover")};CalCell.prototype.onmouseout=function(){this.cellObj.setClass()};CalCell.prototype.onclick=function(){var B=this.cellObj;var A=B.owner;if(!A.selCurMonthOnly||B.date.getMonth()==A.displayMonth&&B.date.getFullYear()==A.displayYear){if(A.selectMultiple==true){if(!B.selected){if(A.selectedDates.arrayIndex(B.date)==-1){A.selectedDates.push(B.date)}}else{var D=A.selectedDates;for(var C=0;C<D.length;C++){if(D[C].getUeDay()==B.date.getUeDay()){D.splice(C,1)}}}}else{A.selectedDates=new Array(B.date);if(A.tgt){A.tgt.value=A.selectedDates[0].dateFormat();if(A.mode=="popup"){A.hide()}}}A.reDraw()}};CalCell.prototype.setClass=function(){if(this.selected){this.cellClass="row2"}else{if(this.owner.displayMonth!=this.date.getMonth()){this.cellClass="row2"}else{if(this.date.getDay()>0&&this.date.getDay()<6){this.cellClass="wkday row1"}else{this.cellClass="wkend row1"}}}if(this.date.getFullYear()==this.owner.curDate.getFullYear()&&this.date.getMonth()==this.owner.curDate.getMonth()&&this.date.getDate()==this.owner.curDate.getDate()){this.cellClass=this.cellClass+" curdate"}this.tableCell.setAttribute("class",this.cellClass);this.tableCell.setAttribute("className",this.cellClass)};Date.prototype.getDayOfYear=function(){return parseInt((this.getTime()-new Date(this.getFullYear(),0,1).getTime())/86400000+1)};Date.prototype.getWeek=function(){return parseInt((this.getTime()-new Date(this.getFullYear(),0,1).getTime())/604800000+1)};Date.prototype.getUeDay=function(){return parseInt(Math.floor((this.getTime()-this.getTimezoneOffset()*60000)/86400000))};Date.prototype.dateFormat=function(g){if(!g){g="n/j/Y"}LZ=function(E){return(E<0||E>9?"":"0")+E};var J=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var V=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");g=g+"";var L="";var U=0;var j="";var D="";var I=this.getFullYear().toString();var F=this.getMonth()+1;var i=this.getDate();var O=this.getDay();var N=this.getHours();var X=this.getMinutes();var Q=this.getSeconds();var S,T,B,R,l,C,f,a,Y,P,o,N,n,G,A,Z;var W=new Object();W.Y=I.toString();W.y=I.substring(2);W.n=F;W.m=LZ(F);W.F=J[F-1];W.M=J[F+11];W.j=i;W.d=LZ(i);W.D=V[O+7];W.l=V[O];W.G=N;W.H=LZ(N);if(N==0){W.g=12}else{if(N>12){W.g=N-12}else{W.g=N}}W.h=LZ(W.g);if(N>11){W.a="pm";W.A="PM"}else{W.a="am";W.A="AM"}W.i=LZ(X);W.s=LZ(Q);while(U<g.length){j=g.charAt(U);D="";while((g.charAt(U)==j)&&(U<g.length)){D+=g.charAt(U++)}if(W[D]!=null){L=L+W[D]}else{L=L+D}}return L};Array.prototype.arrayIndex=function(A,C){C=(C!=null?C:0);for(var B=C;B<this.length;B++){if(A==this[B]){return B}}return -1};function initCalpicker(){start_date=new Calendar_picker("start_date","popup",document.getElementById("start_date"));end_date=new Calendar_picker("end_date","popup",document.getElementById("end_date"));cal_inited=true}function check_cal(A){return true}function initCal(){if(!cal_inited){initCalpicker()}}$(function(){if($("div.bcalen").css("display")=="block"){initCalpicker()}});var imageTag=false;var theSelection=false;var clientPC=navigator.userAgent.toLowerCase();var clientVer=parseInt(navigator.appVersion);var is_ie=((clientPC.indexOf("msie")!=-1)&&(clientPC.indexOf("opera")==-1));var is_win=((clientPC.indexOf("win")!=-1)||(clientPC.indexOf("16bit")!=-1));var baseHeight;function helpline(A){document.forms[form_name].helpbox.value=help_line[A]}function bbstyle(A){if(A!=-1){bbfontstyle(bbtags[A],bbtags[A+1])}else{insert_text("[*]");document.forms[form_name].elements[text_name].focus()}}function bbfontstyle(B,F){theSelection=false;var D=document.forms[form_name].elements[text_name];D.focus();if((clientVer>=4)&&is_ie&&is_win){theSelection=document.selection.createRange().text;if(theSelection){document.selection.createRange().text=B+theSelection+F;document.forms[form_name].elements[text_name].focus();theSelection="";return}}else{if(document.forms[form_name].elements[text_name].selectionEnd&&(document.forms[form_name].elements[text_name].selectionEnd-document.forms[form_name].elements[text_name].selectionStart>0)){mozWrap(document.forms[form_name].elements[text_name],B,F);document.forms[form_name].elements[text_name].focus();theSelection="";return}}var A=getCaretPosition(D).start;var C=A+B.length;insert_text(B+F);if(!isNaN(D.selectionStart)){D.selectionStart=C;D.selectionEnd=C}else{if(document.selection){var E=D.createTextRange();E.move("character",C);E.select();storeCaret(D)}}D.focus();return}function insert_text(G,D,C){var B;if(!C){B=document.forms[form_name].elements[text_name]}else{B=opener.document.forms[form_name].elements[text_name]}if(D){G=" "+G+" "}if(!isNaN(B.selectionStart)){var F=B.selectionStart;var E=B.selectionEnd;mozWrap(B,G,"");B.selectionStart=F+G.length;B.selectionEnd=E+G.length}else{if(B.createTextRange&&B.caretPos){if(baseHeight!=B.caretPos.boundingHeight){B.focus();storeCaret(B)}var A=B.caretPos;A.text=A.text.charAt(A.text.length-1)==" "?A.text+G+" ":A.text+G}else{B.value=B.value+G}}if(!C){B.focus()}}function attach_inline(B,A){insert_text("[attachment="+B+"]"+A+"[/attachment]");document.forms[form_name].elements[text_name].focus()}function addquote(C,E){var A="message_"+C;var D="";var B=false;if(document.all){B=document.all[A]}else{B=document.getElementById(A)}if(window.getSelection){D=window.getSelection().toString()}else{if(document.getSelection){D=document.getSelection()}else{if(document.selection){D=document.selection.createRange().text}}}if(D==""||typeof D=="undefined"||D==null){if(B.innerHTML){D=B.innerHTML.replace(/<br>/ig,"\n");D=D.replace(/<br\/>/ig,"\n");D=D.replace(/&lt\;/ig,"<");D=D.replace(/&gt\;/ig,">");D=D.replace(/&amp\;/ig,"&")}else{if(document.all){D=B.innerText}else{if(B.textContent){D=B.textContent}else{if(B.firstChild.nodeValue){D=B.firstChild.nodeValue}}}}}if(D){insert_text('[quote="'+E+'"]'+D+"[/quote]")}return}function mozWrap(G,D,J){var C=G.textLength;var A=G.selectionStart;var E=G.selectionEnd;var B=G.scrollTop;if(E==1||E==2){E=C}var I=(G.value).substring(0,A);var H=(G.value).substring(A,E);var F=(G.value).substring(E,C);G.value=I+D+H+J+F;G.selectionStart=E+D.length+J.length;G.selectionEnd=G.selectionStart;G.focus();G.scrollTop=B;return}function storeCaret(A){if(A.createTextRange){A.caretPos=document.selection.createRange().duplicate()}}function colorPalette(D,C,K,B){if(B===undefined){B="colour_palette"}var I=$(B).find(":nth-child(1)").find(":nth-child(2)");var A=0,G=0,H=0;var F=new Array(6);var E="";F[0]="00";F[1]="40";F[2]="80";F[3]="BF";F[4]="FF";var J='<table cellspacing="1" cellpadding="0" border="0">';for(A=0;A<5;A++){if(D=="h"){J+="<tr>"}for(G=0;G<5;G++){if(D=="v"){J+="<tr>"}for(H=0;H<5;H++){E=String(F[A])+String(F[G])+String(F[H]);J+='<td bgcolor="#'+E+'">';J+='<a href="#" onclick="bbfontstyle(\'[color=#'+E+']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="'+C+'" height="'+K+'" alt="#'+E+'" title="#'+E+'" /></a>';J+="</td>"}if(D=="v"){J+="</tr>"}}if(D=="h"){J+="</tr>"}}J+="</table>"}function caretPosition(){var B=null;var A=null}function getCaretPosition(E){var C=new caretPosition();if(E.selectionStart||E.selectionStart==0){C.start=E.selectionStart;C.end=E.selectionEnd}else{if(document.selection){var A=document.selection.createRange();var B=document.body.createTextRange();B.moveToElementText(E);var D;for(D=0;B.compareEndPoints("StartToStart",A)<0;D++){B.moveStart("character",1)}E.sel_start=D;C.start=E.sel_start;C.end=E.sel_start}}return C}function emoticon(A){insert_text(A,true)}function change_palette(){e=document.getElementById("colour_palette");if(e.style.display=="block"){document.getElementById("bbpalette").value="Hide font color"}else{document.getElementById("bbpalette").value="Font color"}}var cal;var cal_inited=false;$(function(){blogsInit();latexHand()});