var Debug={write:function(a){jsDebug&&!Object.isUndefined(window.console)&&console.log(a)},dir:function(a){jsDebug&&!Object.isUndefined(window.console)&&console.dir(a)},error:function(a){jsDebug&&!Object.isUndefined(window.console)&&console.error(a)},warn:function(a){jsDebug&&!Object.isUndefined(window.console)&&console.warn(a)},info:function(a){jsDebug&&!Object.isUndefined(window.console)&&console.info(a)}};Event.observe(window,"load",function(){Element.Methods.getOffsetParent=function(a){if(a.offsetParent&&a.offsetParent!=document.body)return $(a.offsetParent);if(a==document.body)return $(a);for(;(a=a.parentNode)&&a!=document.body;)if(Element.getStyle(a,"position")!="static")return $(a);return $(document.body)}});function _getOffsetParent(a){if(a.offsetParent&&a.offsetParent!=document.body)return $(a.offsetParent);if(a==document.body)return $(a);for(;(a=a.parentNode)&&a!=document.body;)if(Element.getStyle(a,"position")!="static")return $(a);return $(document.body)}
Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;Prototype.Browser.IE8=Prototype.Browser.IE&&!Prototype.Browser.IE6&&!Prototype.Browser.IE7;Prototype.Browser.Chrome=Prototype.Browser.WebKit&&navigator.userAgent.indexOf("Chrome/")>-1;window.IPBoard=Class.create({namePops:[],vars:[],lang:[],templates:[],editors:$A(),initDone:false,initialize:function(){Debug.write("IPBjs is loading...");document.observe("dom:loaded",function(){this.Cookie.init();Ajax.Responders.register({onLoading:function(){if(!$("ajax_loading")){if(!ipb.templates.ajax_loading)return;$("ipboard_body").insert(ipb.templates.ajax_loading)}new Effect.Appear($("ajax_loading"),{duration:0.2})},onComplete:function(){$("ajax_loading")&&new Effect.Fade($("ajax_loading"),{duration:0.2})}});ipb.delegate.initialize();ipb.initDone=true}.bind(this))},positionCenter:function(a,b){if($(a)){elem_s=$(a).getDimensions();window_s=document.viewport.getDimensions();window_offsets=document.viewport.getScrollOffsets();center={left:(window_s.width-elem_s.width)/2,top:(window_s.height-elem_s.height)/2};if(typeof b=="undefined"||b!="h"&&b!="v")$(a).setStyle("top: "+center.top+"px; left: "+center.left+"px");else if(b=="h")$(a).setStyle("left: "+center.left+"px");else b=="v"&&$(a).setStyle("top: "+center.top+"px");$(a).setStyle("position: fixed")}},showModal:function(){$("ipb_modal")||this.createModal();this.modal.show()},hideModal:function(){$("ipb_modal")&&this.modal.hide()},createModal:function(){this.modal=(new Element("div",{id:"ipb_modal"})).hide().addClassName("modal");this.modal.setStyle("width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; overflow: hidden; z-index: 1000; opacity: 0.2");$("ipboard_body").insert({bottom:this.modal})},alert:function(a){$("ipb_alert")||this.createAlert();this.showModal();$("ipb_alert_message").update(a)},createAlert:function(){wrapper=new Element("div",{id:"ipb_alert"});icon=new Element("div",{id:"ipb_alert_icon"});message=new Element("div",{id:"ipb_alert_message"});ok_button=new Element("input",{type:"button",value:"OK",id:"ipb_alert_ok"});cancel_button=new Element("input",{type:"button",value:"Cancel",id:"ipb_alert_cancel"});wrapper.insert({bottom:icon}).insert({bottom:message}).insert({bottom:ok_button}).insert({bottom:cancel_button}).setStyle("z-index: 1001");$("ipboard_body").insert({bottom:wrapper});this.positionCenter(wrapper,"h")},editorInsert:function(a,b){if(b)b=ipb.editors[b];else{Debug.dir(ipb.editors);b=$A(ipb.editors).first();Debug.write(b)}if(Object.isUndefined(b))Debug.error("Can't find any suitable editor");else{b.insert_text(a);b.editor_check_focus()}}});IPBoard.prototype.delegate={store:$A(),initialize:function(){document.observe("click",function(a){if(Event.isLeftClick(a)||Prototype.Browser.IE){var b=null,c=null,d=ipb.delegate.store.find(function(e){if(b=a.findElement(e.selector)){c=e;return true}else return false});if(!Object.isUndefined(d))if(c){Debug.write("Firing callback for selector "+c.selector);c.callback(a,b,c.params)}}})},register:function(a,b,c){ipb.delegate.store.push({selector:a,callback:b,params:c})}};IPBoard.prototype.Cookie={store:[],initDone:false,set:function(a,b,c){var d="",e="/",f="";if(a){if(c)if(c==1)d="; expires=Wed, 1 Jan 2020 00:00:00 GMT";else if(c==-1)d="; expires=Thu, 01-Jan-1970 00:00:01 GMT";else if(c.length>10)d="; expires="+c;if(ipb.vars.cookie_domain)f="; domain="+ipb.vars.cookie_domain;if(ipb.vars.cookie_path)e=ipb.vars.cookie_path;document.cookie=ipb.vars.cookie_id+a+"="+escape(b)+"; path="+e+d+f+";";ipb.Cookie.store[a]=b;Debug.write("Set cookie: "+ipb.vars.cookie_id+a+"="+b+"; path="+e+d+f+";")}},get:function(a){ipb.Cookie.initDone!==true&&ipb.Cookie.init();if(ipb.Cookie.store[a])return ipb.Cookie.store[a];return""},doDelete:function(a){Debug.write("Deleting cookie "+a);ipb.Cookie.set(a,"",-1)},init:function(){if(ipb.Cookie.initDone)return true;skip=["session_id","ipb_admin_session_id","member_id","pass_hash"];(cookies=$H(document.cookie.replace(" ","").toQueryParams(";")))&&cookies.each(function(a){a[0]=a[0].strip();if(ipb.vars.cookie_id!="")if(a[0].startsWith(ipb.vars.cookie_id))a[0]=a[0].replace(ipb.vars.cookie_id,"");else return;if(!skip[a[0]]){ipb.Cookie.store[a[0]]=unescape(a[1]||"");Debug.write("Loaded cookie: "+a[0]+" = "+a[1])}});ipb.Cookie.initDone=true}};IPBoard.prototype.validate={isFilled:function(a){if(!$(a))return null;return!$F(a).blank()},isNumeric:function(a){if(!$(a))return null;return $F(a).match(/^[\d]+?$/)},isMatching:function(a,b){if(!$(a)||!$(b))return null;return $F(a)==$F(b)},email:function(a){if(!$(a))return null;return $F(a).match(/^.+@.+\..{2,4}$/)?true:false}};IPBoard.prototype.Autocomplete=Class.create({initialize:function(a,b){this.id=$(a).id;this.timer=null;this.last_string="";this.internal_cache=$H();this.pointer=0;this.items=$A();this.observing=true;this.objHasFocus=null;this.options=Object.extend({min_chars:3,multibox:false,global_cache:false,classname:"ipb_autocomplete",templates:{wrap:new Template("<ul id='#{id}'></ul>"),item:new Template("<li id='#{id}'>#{itemvalue}</li>")}},b||{});if(!$(this.id)){Debug.error("Invalid textbox ID");return false}this.obj=$(this.id);if(!this.options.url){Debug.error("No URL specified for autocomplete");return false}$(this.obj).writeAttribute("autocomplete","off");this.buildList();$(this.obj).observe("focus",this.timerEventFocus.bindAsEventListener(this));$(this.obj).observe("blur",this.timerEventBlur.bindAsEventListener(this));$(this.obj).observe("keypress",this.eventKeypress.bindAsEventListener(this))},eventKeypress:function(a){if([Event.KEY_TAB,Event.KEY_UP,Event.KEY_DOWN,Event.KEY_LEFT,Event.KEY_RIGHT,Event.KEY_RETURN].include(a.keyCode))if($(this.list).visible()){switch(a.keyCode){case Event.KEY_TAB:;case Event.KEY_RETURN:this.selectCurrentItem(a);break;case Event.KEY_UP:;case Event.KEY_LEFT:this.selectPreviousItem(a);break;case Event.KEY_DOWN:;case Event.KEY_RIGHT:this.selectNextItem(a);break}
Event.stop(a)}},selectCurrentItem:function(){var a=$(this.list).down(".active");this.unselectAll();if(!Object.isUndefined(a)){a=$(a).id.replace(this.id+"_ac_item_","");if(!a)return;a=this.items[a].replace("&amp;","&");if(this.options.multibox){if($F(this.obj).indexOf(",")!==-1){var b=$F(this.obj).split(",");b[b.length-1]="";$(this.obj).value=b.join(",")+" "}else $(this.obj).value="";$(this.obj).value=$F(this.obj)+a+", "}else{$(this.obj).value=a;new Effect.Fade($(this.list),{duration:0.3});this.observing=false}}$(this.obj).focus()},selectThisItem:function(a){this.unselectAll();var b=$(this.list).immediateDescendants();for(a=Event.element(a);!b.include(a);)a=a.up();$(a).addClassName("active")},selectPreviousItem:function(){var a=$(this.list).down(".active");this.unselectAll();if(Object.isUndefined(a))this.selectFirstItem();else(a=$(a).previous())?$(a).addClassName("active"):this.selectLastItem()},selectNextItem:function(){var a=$(this.list).down(".active");this.unselectAll();if(Object.isUndefined(a))this.selectFirstItem();else(a=$(a).next())?$(a).addClassName("active"):this.selectFirstItem()},selectFirstItem:function(){if($(this.list).visible()){this.unselectAll();$(this.list).firstDescendant().addClassName("active")}},selectLastItem:function(){if($(this.list).visible()){this.unselectAll();var a=$(this.list).immediateDescendants();(a=a[a.length-1])&&$(a).addClassName("active")}},unselectAll:function(){$(this.list).childElements().invoke("removeClassName","active")},timerEventBlur:function(a){window.clearTimeout(this.timer);this.eventBlur.bind(this).delay(0.6,a)},timerEventFocus:function(a){this.timer=this.eventFocus.bind(this).delay(0.4,a)},eventBlur:function(){this.objHasFocus=false;$(this.list).visible()&&new Effect.Fade($(this.list),{duration:0.3})},eventFocus:function(a){if(this.observing){this.objHasFocus=true;this.timer=this.eventFocus.bind(this).delay(0.6,a);var b=this.getCurrentName();if(b!=this.last_string)if(b.length<this.options.min_chars)$(this.list).visible()&&new Effect.Fade($(this.list),{duration:0.3,afterFinish:function(){$(this.list).update()}.bind(this)});else{this.last_string=b;json=this.cacheRead(b);if(json==false)new Ajax.Request(this.options.url+escape(b),{method:"get",evalJSON:"force",onSuccess:function(c){if(Object.isUndefined(c.responseJSON))Debug.error("Invalid response returned from the server");else{if(c.responseJSON.error){switch(c.responseJSON.error){case"requestTooShort":Debug.warn("Server said request was too short, skipping...");break;default:Debug.error("Server returned an error: "+c.responseJSON.error);break}
return false}if(c.responseText!="[]"){this.cacheWrite(b,c.responseJSON);this.updateAndShow(c.responseText.evalJSON())}}}.bind(this)});else this.updateAndShow(json)}}},updateAndShow:function(a){if(a){this.updateList(a);if(!$(this.list).visible()&&this.objHasFocus){Debug.write("Showing");new Effect.Appear($(this.list),{duration:0.3,afterFinish:function(){this.selectFirstItem()}.bind(this)})}}},cacheRead:function(a){if(this.options.global_cache!=false){if(!Object.isUndefined(this.options.global_cache[a])){Debug.write("Read from global cache");return this.options.global_cache[a]}}else if(!Object.isUndefined(this.internal_cache[a])){Debug.write("Read from internal cache");return this.internal_cache[a]}return false},cacheWrite:function(a,b){if(this.options.global_cache!==false)this.options.global_cache[a]=b;else this.internal_cache[a]=b;return true},getCurrentName:function(){if(this.options.multibox)if($F(this.obj).indexOf(",")===-1)return $F(this.obj).strip();else{var a=$F(this.obj).split(",");return a[a.length-1].strip()}else return $F(this.obj).strip()},buildList:function(){if(!$(this.id+"_ac")){var a=this.options.templates.wrap.evaluate({id:this.id+"_ac"});$$("body")[0].insert({bottom:a});a={};var b=$(this.id).viewportOffset(),c=$(this.id).getDimensions(),d=[0,0],e=null,f=document.viewport.getScrollOffsets();if(Element.getStyle($(this.id),"position")=="absolute"){e=element.getOffsetParent();d=e.viewportOffset()}a.left=b[0]-d[0];a.top=b[1]-d[1]+f.top;a.top+=c.height;$(this.id+"_ac").setStyle("position: absolute; top: "+a.top+"px; left: "+a.left+"px;").hide();this.list=$(this.id+"_ac")}},updateList:function(a){if(a&&$(this.list)){var b="";this.items=$A();a=$H(a);a.each(function(c){var d=this.options.templates.item.evaluate({id:this.id+"_ac_item_"+c.key,itemid:c.key,itemvalue:c.value.showas||c.value.name,img:c.value.img||"",img_w:c.value.img_w||"",img_h:c.value.img_h||""});this.items[c.key]=c.value.name;b+=d}.bind(this));$(this.list).update(b);$(this.list).immediateDescendants().each(function(c){$(c).observe("mouseover",this.selectThisItem.bindAsEventListener(this));$(c).observe("click",this.selectCurrentItem.bindAsEventListener(this));$(c).setStyle("cursor: pointer")}.bind(this));$(this.list).visible()&&this.selectFirstItem()}}});IPBoard.prototype.editor_values=$H({templates:$A(),colors_perrow:8,colors:["000000","A0522D","556B2F","006400","483D8B","000080","4B0082","2F4F4F","8B0000","FF8C00","808000","008000","008080","0000FF","708090","696969","FF0000","F4A460","9ACD32","2E8B57","48D1CC","4169E1","800080","808080","FF00FF","FFA500","FFFF00","00FF00","00FFFF","00BFFF","9932CC","C0C0C0","FFC0CB","F5DEB3","FFFACD","98FB98","AFEEEE","ADD8E6","DDA0DD","FFFFFF"],primary_fonts:$H({arial:"Arial",arialblack:"Arial Black",arialnarrow:"Arial Narrow",bookantiqua:"Book Antiqua",centurygothic:"Century Gothic",comicsansms:"Comic Sans MS",couriernew:"Courier New",franklingothicmedium:"Franklin Gothic Medium",garamond:"Garamond",georgia:"Georgia",impact:"Impact",lucidaconsole:"Lucida Console",lucidasansunicode:"Lucida Sans Unicode",microsoftsansserif:"Microsoft Sans Serif",palatinolinotype:"Palatino Linotype",tahoma:"Tahoma",timesnewroman:"Times New Roman",trebuchetms:"Trebuchet MS",verdana:"Verdana"}),font_sizes:$A([1,2,3,4,5,6,7])});Object.extend(RegExp,{escape:function(a){if(!arguments.callee.sRE)arguments.callee.sRE=new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$)","g");return a.replace(arguments.callee.sRE,"\\$1")}});String.prototype.encodeUrl=function(){text=this;var a=text.match(/[\x90-\xFF]/g);if(a)for(var b=0;b<a.length;b++)text=text.replace(a[b],"%u00"+(a[b].charCodeAt(0)&255).toString(16).toUpperCase());return escape(text).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40")};String.prototype.encodeParam=function(){text=this;var a=text.match(/[\x90-\xFF]/g);if(a)for(var b=0;b<a.length;b++)text=text.replace(a[b],"%u00"+(a[b].charCodeAt(0)&255).toString(16).toUpperCase());return escape(text).replace(/\+/g,"%2B")};Date.prototype.getDST=function(){var a=new Date("January 1, 2008"),b=(new Date("July 1, 2008")).getTimezoneOffset()-a.getTimezoneOffset();a=this.getTimezoneOffset()-a.getTimezoneOffset();return b!=0?b==a?1:0:0};var Loader={require:function(a){document.write("<script type='text/javascript' src='"+a+".js'><\/script>")},boot:function(){$A(document.getElementsByTagName("script")).findAll(function(a){return a.src&&a.src.match(/ipb\.js(\?.*)?$/)}).each(function(a){var b=a.src.replace(/ipb\.js(\?.*)?$/,"");a=a.src.match(/\?.*load=([a-z0-9_,]*)/);!Object.isUndefined(a)&&a!=null&&a[1]&&a[1].split(",").each(function(c){c&&Loader.require(b+"ips."+c)})})}},_global=window.IPBoard;_global.prototype.global={searchTimer:[],searchLastQuery:"",rssItems:[],reputation:{},ac_cache:$H(),pageJumps:$H(),pageJumpMenus:$H(),boardMarkers:$H(),init:function(){Debug.write("Initializing ips.global.js");document.observe("dom:loaded",function(){ipb.global.initEvents()})},initEvents:function(){ipb.delegate.register(".__user",ipb.global.userPopup);ipb.delegate.register(".warn_link",ipb.global.displayWarnLogs);ipb.delegate.register(".mini_friend_toggle",ipb.global.toggleFriend);$("rss_feed")&&ipb.global.buildRSSmenu();if($("newSkin")||$("newLang"))ipb.global.setUpSkinLang();$("pm_notification")&&new Effect.Parallel([new Effect.Appear($("pm_notification")),new Effect.BlindDown($("pm_notification"))],{duration:0.5});$("close_pm_notification")&&$("close_pm_notification").observe("click",ipb.global.closePMpopup);ipb.global.buildPageJumps();ipb.delegate.register(".bbc_spoiler_show",ipb.global.toggleSpoiler);ipb.delegate.register('a[rel~="external"]',ipb.global.openNewWindow)},userPopup:function(a,b){Event.stop(a);b.identify();a=$(b).className.match("__id([0-9]+)");var c=$(b).className.match("__fid([0-9]+)");if(a==null||Object.isUndefined(a[1]))Debug.error("Error showing popup");else{var d="popup_"+a[1]+"_user",e=ipb.vars.base_url+"&app=members&module=ajax&secure_key="+ipb.vars.secure_hash+"&section=card&mid="+a[1];Debug.write(c);if(c!=null&&!Object.isUndefined(c[1])&&c[1])e+="&f="+c[1];Debug.write(e);ipb.namePops[a]=new ipb.Popup(d,{type:"balloon",ajaxURL:e,stem:true,hideAtStart:false,attach:{target:b,position:"auto"},w:"400px"})}},displayWarnLogs:function(a,b){mid=b.id.match("warn_link_([0-9a-z]+)_([0-9]+)")[2];if(!Object.isUndefined(mid)){if(parseInt(mid)==0)return false;Event.stop(a);warnLogs=new ipb.Popup("warnLogs",{type:"pane",modal:false,w:"500px",h:"500px",ajaxURL:ipb.vars.base_url+"&app=members&module=ajax&secure_key="+ipb.vars.secure_hash+"&section=warn&do=view&mid="+mid,hideAtStart:false,close:".cancel"})}},toggleFriend:function(a,b){Event.stop(a);var c=$(b).id.match("friend_(.*)_([0-9]+)");if(!Object.isUndefined(c[2])){var d=$(b).hasClassName("is_friend")?1:0;new Ajax.Request(ipb.vars.base_url+"app=members&section=friends&module=ajax&do="+(d?"remove":"add")+"&member_id="+c[2]+"&md5check="+ipb.vars.secure_hash,{method:"get",onSuccess:function(e){switch(e.responseText){case"pp_friend_timeflood":alert(ipb.lang.cannot_readd_friend);Event.stop(a);break;case"pp_friend_already":alert(ipb.lang.friend_already);Event.stop(a);break;case"error":return true;default:var f=d?ipb.templates.m_add_friend.evaluate({id:c[2]}):ipb.templates.m_rem_friend.evaluate({id:c[2]});$$(".mini_friend_toggle").each(function(g){if($(g).id.endsWith("_"+c[2]))d?$(g).removeClassName("is_friend").addClassName("is_not_friend").update(f):$(g).removeClassName("is_not_friend").addClassName("is_friend").update(f)});new Effect.Highlight($(b),{startcolor:ipb.vars.highlight_color});document.fire("ipb:friendRemoved",{friendID:c[2]});Event.stop(a);break}}})}},toggleFlagSpammer:function(a,b){if(b==true){if(confirm(ipb.lang.set_as_spammer)){var c=b=0,d=0;if(typeof ipb.topic!="undefined"){b=ipb.topic.topic_id;c=ipb.topic.forum_id;d=ipb.topic.start_id}window.location=ipb.vars.base_url+"app=forums&module=moderate&section=moderate&do=setAsSpammer&member_id="+a+"&t="+b+"&f="+c+"&st="+d+"&auth_key="+ipb.vars.secure_hash}}else alert(ipb.lang.is_spammer);return false},toggleSpoiler:function(a,b){Event.stop(a);if($(b).up().down(".bbc_spoiler_wrapper").down(".bbc_spoiler_content").toggle().visible())$(b).value="Hide";else $(b).value="Show"},setUpSkinLang:function(){if($("newSkin")){var a=$("newSkin").up("form");if(a){$("newSkinSubmit")&&$("newSkinSubmit").hide();$("newSkin").observe("change",function(){a.submit();return true})}}if($("newLang")){var b=$("newLang").up("form");if(b){$("newLangSubmit")&&$("newLangSubmit").hide();$("newLang").observe("change",function(){b.submit();return true})}}},buildRSSmenu:function(){$$("link").each(function(a){a.readAttribute("type")=="application/rss+xml"&&ipb.global.rssItems.push(ipb.templates.rss_item.evaluate({url:a.readAttribute("href"),title:a.readAttribute("title")}))});if(ipb.global.rssItems.length>0){rssmenu=ipb.templates.rss_shell.evaluate({items:ipb.global.rssItems.join("\n")});$("rss_feed").insert({after:rssmenu});new ipb.Menu($("rss_feed"),$("rss_menu"))}else $("rss_feed").hide()},closePMpopup:function(a){$("pm_notification")&&new Effect.Parallel([new Effect.Fade($("pm_notification")),new Effect.BlindUp($("pm_notification"))],{duration:0.5});Event.stop(a)},initGD:function(a){if($(a)){$(a).observe("click",ipb.global.generateNewImage);$("gd-image-link")&&$("gd-image-link").observe("click",ipb.global.generateNewImage)}},generateImageExternally:function(a){$(a)&&$(a).observe("click",ipb.global.generateNewImage)},generateNewImage:function(a){img=Event.findElement(a,"img");Event.stop(a);if(img!=document){if(!img)if(anchor=Event.findElement(a,"a"))img=anchor.up().down("img");oldSrc=img.src.toQueryParams();oldSrc=$H(oldSrc).toObject();oldSrc.captcha_unique_id||Debug.error("No captcha ID found");new Ajax.Request(ipb.vars.base_url+"app=core&module=global&section=captcha&do=refresh&captcha_unique_id="+oldSrc.captcha_unique_id+"&secure_key="+ipb.vars.secure_hash,{method:"get",onSuccess:function(b){oldSrc.captcha_unique_id=b.responseText;img.writeAttribute({src:ipb.vars.base_url+$H(oldSrc).toQueryString()});$F("regid").value=b.responseText}})}},registerReputation:function(a,b,c){if($(a)){var d=$(a).down(".rep_up"),e=$(a).down(".rep_down"),f=ipb.vars.base_url+"&app=core&module=ajax&section=reputation&do=add_rating&app_rate="+b.app+"&type="+b.type+"&type_id="+b.typeid+"&secure_key="+ipb.vars.secure_hash;$(d)&&$(d).observe("click",ipb.global.repRate.bindAsEventListener(this,1,a));$(e)&&$(e).observe("click",ipb.global.repRate.bindAsEventListener(this,-1,a));ipb.global.reputation[a]={obj:$(a),url:b,sendUrl:f,currentRating:c||0};Debug.write("Registered reputation")}},repRate:function(a){Event.stop(a);var b=$A(arguments)[1],c=$A(arguments)[2],d=b==1?1:-1;if(ipb.global.reputation[c]){var e=ipb.global.reputation[c];new Ajax.Request(e.sendUrl+"&rating="+d,{method:"get",onSuccess:function(f){if(f.responseText=="done"){try{e.obj.down(".rep_up").hide();e.obj.down(".rep_down").hide()}catch(g){}var h=e.obj.down(".rep_show");if(h){["positive","negative","zero"].each(function(i){h.removeClassName(i)});f=e.currentRating+d;if(f>0)h.addClassName("positive");else f<0?h.addClassName("negative"):h.addClassName("zero");h.update(parseInt(e.currentRating+d))}}else f.responseText=="nopermission"?alert(ipb.lang.no_permission):alert(ipb.lang.action_failed+": "+f.responseText)}})}},timer_liveSearch:function(){ipb.global.searchTimer.show=setTimeout(ipb.global.liveSearch,400)},timer_hideLiveSearch:function(){ipb.global.searchTimer.hide=setTimeout(ipb.global.hideLiveSearch,800)},hideLiveSearch:function(){new Effect.Fade($("live_search_popup"),{duration:0.4,afterFinish:function(){$("ajax_result").update("")}});ipb.global.searchLastQuery="";clearTimeout(ipb.global.searchTimer.show);clearTimeout(ipb.global.searchTimer.hide)},liveSearch:function(){ipb.global.timer_liveSearch();if(!($F("main_search").length<ipb.vars.live_search_limit)){if($("live_search_popup"))$("live_search_popup").visible()||new Effect.Appear($("live_search_popup"),{duration:0.4});else{Debug.write("Creating popup");ipb.global.buildSearchPopup()}if($F("main_search")!=ipb.global.searchLastQuery){var a="";if(ipb.vars.active_app)a+="&app_search="+ipb.vars.active_app;if(ipb.vars.search_type&&ipb.vars.search_type_id)a+="&search_type="+ipb.vars.search_type+"&search_type_id="+ipb.vars.search_type_id;if(ipb.vars.search_type_2&&ipb.vars.search_type_id_2)a+="&search_type_2="+ipb.vars.search_type_2+"&search_type_id_2="+ipb.vars.search_type_id_2;new Ajax.Request(ipb.vars.base_url+"app=core&module=ajax&section=livesearch&do=search&secure_key="+ipb.vars.secure_hash+"&search_term="+$F("main_search").encodeUrl()+a,{method:"get",onSuccess:function(b){$("ajax_result")&&$("ajax_result").update(b.responseText)}});ipb.global.searchLastQuery=$F("main_search")}}},buildSearchPopup:function(){pos=$("main_search").cumulativeOffset();finalPos={top:pos.top+$("main_search").getHeight(),left:pos.left+45};popup=(new Element("div",{id:"live_search_popup"})).hide().setStyle("top: "+finalPos.top+"px; left: "+finalPos.left+"px");$("content").insert({bottom:popup});var a="";if(ipb.vars.active_app)a+="&app_search="+ipb.vars.active_app;if(ipb.vars.search_type&&ipb.vars.search_type_id)a+="&search_type="+ipb.vars.search_type+"&search_type_id="+ipb.vars.search_type_id;if(ipb.vars.search_type_2&&ipb.vars.search_type_id_2)a+="&search_type_2="+ipb.vars.search_type_2+"&search_type_id_2="+ipb.vars.search_type_id_2;new Ajax.Request(ipb.vars.base_url+"app=core&module=ajax&section=livesearch&do=template&secure_key="+ipb.vars.secure_hash+a,{method:"get",onSuccess:function(b){popup.update(b.responseText)}});new Effect.Appear($("live_search_popup"),{duration:0.3})},convertSize:function(a){if(a<1024)return a+" B";if(a<1048576)return(a/1024).toFixed(2)+" KB";if(a<1073741824)return(a/1048576).toFixed(2)+" MB";return(a/1073741824).toFixed(2)+" GB"},initImageResize:function(){var a=document.viewport.getDimensions();ipb.global.screen_w=a.width;ipb.global.screen_h=a.height;ipb.global.max_w=Math.ceil(ipb.global.screen_w*(ipb.vars.image_resize/100))},findImgs:function(a){if($(a))if(ipb.vars.image_resize)$(a).hasClassName("imgsize_ignore")?Debug.write("Ignoring this post for image resizing..."):$(a).select("img.bbc_img").each(function(b){ipb.global.screen_w||ipb.global.initImageResize();ipb.global.resizeImage(b)})},resizeImage:function(a){if(a.tagName=="IMG")if(a.readAttribute("handled"))Debug.write("Handled...");else{if(!ipb.global.post_width){var b=$(a).up(".post");if(!Object.isUndefined(b)){var c=parseInt(b.getStyle("padding-left"))+parseInt(b.getStyle("padding-right"));ipb.global.post_width=$(b).getWidth()-c*2}}c=ipb.vars.image_resize_force?ipb.vars.image_resize_force:ipb.global.post_width?ipb.global.post_width:ipb.global.max_w;b=a.getDimensions();if(b.width>c){c=Math.ceil(c/b.width*100);if(c<100){a.height=b.height*(c/100);a.width=b.width*(c/100)}var d=ipb.templates.resized_img;$(a).wrap("div").addClassName("resized_img");$(a).insert({before:d.evaluate({percent:c,width:b.width,height:b.height})});$(a).addClassName("resized").setStyle("cursor: pointer;");$(a).writeAttribute("origWidth",b.width).writeAttribute("origHeight",b.height).writeAttribute("shrunk",1);$(a).writeAttribute("newWidth",a.width).writeAttribute("newHeight",a.height).writeAttribute("handled",1);$(a).observe("click",ipb.global.enlargeImage)}}},enlargeImage:function(a){var b=Event.element(a);b.hasClassName("resized")||(b=Event.findElement(a,".resized"));if(a=b)if($(a).readAttribute("shrunk")==1){$(a).setStyle("width: "+a.readAttribute("origWidth")+"px; height: "+a.readAttribute("origHeight")+"px; cursor: pointer");$(a).writeAttribute("shrunk",0)}else{$(a).setStyle("width: "+a.readAttribute("newWidth")+"px; height: "+a.readAttribute("newHeight")+"px; cursor: pointer");$(a).writeAttribute("shrunk",1);Debug.write("width: "+a.readAttribute("newWidth"))}},registerPageJump:function(a,b){if(a&&b)ipb.global.pageJumps[a]=b},buildPageJumps:function(){$$(".pagejump").each(function(a){var b=$(a).className.match(/pj([0-9]+)/);if(b[1]){$(a).identify();var c=ipb.templates.page_jump.evaluate({id:"pj_"+$(a).identify()});$$("body")[0].insert(c);$("pj_"+$(a).identify()+"_submit").observe("click",ipb.global.pageJump.bindAsEventListener(this,$(a).identify()));$("pj_"+$(a).identify()+"_input").observe("keypress",function(e){e.which==Event.KEY_RETURN&&ipb.global.pageJump(e,$(a).identify())});c=$("pj_"+$(a).identify()+"_wrap").addClassName("pj"+b[1]).writeAttribute("jumpid",b[1]);var d={afterOpen:function(){try{$("pj_"+$(a).identify()+"_input").activate()}catch(e){}}};ipb.global.pageJumpMenus[b[1]]=new ipb.Menu($(a),$(c),{stopClose:true},d)}})},pageJump:function(a,b){if($(b)&&$("pj_"+$(b).id+"_input")){a=$F("pj_"+$(b).id+"_input");var c=$("pj_"+$(b).id+"_wrap").readAttribute("jumpid");if(a.blank())try{ipb.global.pageJumpMenus[source].doClose()}catch(d){}else a=parseInt(a);if(b=ipb.global.pageJumps[c]){a=(a-1)*b.perPage;Debug.write(a);if(a<1)a=0;a=ipb.vars.seo_enabled&&document.location.toString().match(ipb.vars.seo_params.start)&&document.location.toString().match(ipb.vars.seo_params.end)?b.url.match(ipb.vars.seo_params.varBlock)?b.url+ipb.vars.seo_params.varSep+b.stKey+ipb.vars.seo_params.varSep+a:b.url+ipb.vars.seo_params.varBlock+b.stKey+ipb.vars.seo_params.varSep+a:b.url+"&amp;"+b.stKey+"="+a;a=a.replace(/&amp;/g,"&");a=a.replace(/(http:)?\/\//g,function(e,f){return f?e:"/"});document.location=a}else{Debug.dir(ipb.global.pageJumps);Debug.write(c)}}},openNewWindow:function(a,b,c){if(document.location.host!=b.host||c){window.open(b.href);Event.stop(a);return false}else return true},registerMarker:function(a,b,c){if(!(!$(a)||b.blank()||c.blank()))if(!Object.isUndefined(ipb.global.boardMarkers)){Debug.write("Marker INIT: "+a);$(a).observe("click",ipb.global.sendMarker.bindAsEventListener(this,a,b,c))}},sendMarker:function(a,b,c,d){Event.stop(a);ipb.global.boardMarkers[c]&&new Ajax.Request(d+"&secure_key="+ipb.vars.secure_hash,{method:"get",evalJSON:"force",onSuccess:function(e){if(Object.isUndefined(e.responseJSON)){Debug.error("Invalid server response");return false}if(e.responseJSON.error){Debug.error(e.responseJSON.error);return false}$(b).replace(ipb.global.boardMarkers[c])}})},registerCheckAll:function(a,b){if($(a)){$(a).observe("click",ipb.global.checkAll.bindAsEventListener(this,b));$$("."+b).each(function(c){$(c).observe("click",ipb.global.checkOne.bindAsEventListener(this,a))})}},checkAll:function(a,b){Debug.write("checkAll");a=Event.element(a);b=$$("."+b);a.checked?b.each(function(c){c.checked=true}):b.each(function(c){c.checked=false})},checkOne:function(a,b){a=Event.element(a);if($(b).checked&&a.checked==false)$(b).checked=false},updateReportStatus:function(a,b,c,d){Event.stop(a);c=ipb.vars.base_url+"app=core&amp;module=ajax&amp;section=reports&amp;do=change_status&secure_key="+ipb.vars.secure_hash+"&amp;status=3&amp;id="+parseInt(b)+"&amp;noimg="+parseInt(d)+"&amp;noauto="+parseInt(c);new Ajax.Request(c.replace(/&amp;/g,"&"),{method:"post",evalJSON:"force",onSuccess:function(e){if(Object.isUndefined(e.responseJSON))alert(ipb.lang.action_failed);else try{$("rstat-"+b).update(e.responseJSON.img);ipb.menus.closeAll(a)}catch(f){Debug.error(f)}}})},getTotalOffset:function(a,b,c){if($(a).getOffsetParent()!=document.body){Debug.write("Checking "+$(a).id);var d=$(a).positionedOffset();b+=d.top;c+=d.left;return ipb.global.getTotalOffset($(a).getOffsetParent(),b,c)}else{Debug.write("OK Finished!");return{top:b,left:c}}},checkPermission:function(a){if(a=="nopermission"){alert(ipb.lang.nopermission);return false}return true}};var _menu=window.IPBoard;_menu.prototype.menus={registered:$H(),init:function(){Debug.write("Initializing ips.menu.js");document.observe("dom:loaded",function(){ipb.menus.initEvents()})},initEvents:function(){Event.observe(document,"click",ipb.menus.docCloseAll);$$(".ipbmenu").each(function(a){id=a.identify();$(id+"_menucontent")&&new ipb.Menu(a,$(id+"_menucontent"))})},register:function(a,b){ipb.menus.registered.set(a,b)},docCloseAll:function(a){(!Event.isLeftClick(a)||a.ctrlKey==true||a.keyCode==91)&&!Prototype.Browser.IE||ipb.menus.closeAll(a)},closeAll:function(a){ipb.menus.registered.each(function(b){if(typeof a=="undefined"||a&&b.key!=a)try{b.value.doClose()}catch(c){}})}};_menu.prototype.Menu=Class.create({initialize:function(a,b,c,d){if($(a)&&$(b)){$(a).id||$(a).identify();this.id=$(a).id+"_menu";this.source=$(a);this.target=$(b);this.callbacks=d||{};this.options=Object.extend({eventType:"click",stopClose:false,offsetX:0,offsetY:0},c||{});$(a).observe("click",this.eventClick.bindAsEventListener(this));$(a).observe("mouseover",this.eventOver.bindAsEventListener(this));$(b).observe("click",this.targetClick.bindAsEventListener(this));$(this.target).setStyle("position: absolute;").hide().setStyle({zIndex:9999});$(this.target).descendants().each(function(e){$(e).setStyle({zIndex:1E4})});ipb.menus.register($(a).id,this);Object.isFunction(this.callbacks.afterInit)&&this.callbacks.afterInit(this)}},doOpen:function(){Debug.write("Menu open");var a={};_source=this.options.positionSource?this.options.positionSource:this.source;var b=$(_source).positionedOffset(),c=$(_source).cumulativeOffset(),d=$(_source).cumulativeScrollOffset(),e={top:c.top-d.top,left:c.left-d.left},f=$(_source).getDimensions(),g=document.viewport.getDimensions(),h=$(this.target).getDimensions();Debug.write("realSourcePos: "+e.top+" x "+e.left);Debug.write("sourcePos: "+b.top+" x "+b.left);Debug.write("scrollOffset: "+d.top+" x "+d.left);Debug.write("_sourcePos: "+c.top+" x "+c.left);Debug.write("sourceDim: "+f.width+" x "+f.height);Debug.write("menuDim: "+h.height);Debug.write("screenDim: "+g.height);Debug.write("manual ofset: "+this.options.offsetX+" x "+this.options.offsetY);if(Prototype.Browser.IE7){_a=_source.getOffsetParent();_b=this.target.getOffsetParent()}else{_a=_getOffsetParent(_source);_b=_getOffsetParent(this.target)}if(_a!=_b){if(e.left+h.width>g.width){diff=h.width-f.width;a.left=c.left-diff+this.options.offsetX}else a.left=Prototype.Browser.IE7?b.left+this.options.offsetX:c.left+this.options.offsetX;a.top=e.top+f.height+h.height>g.height&&c.top-h.height+this.options.offsetY>0?c.top-h.height+this.options.offsetY:c.top+f.height+this.options.offsetY}else{if(e.left+h.width>g.width){diff=h.width-f.width;a.left=b.left-diff+this.options.offsetX}else a.left=b.left+this.options.offsetX;a.top=e.top+f.height+h.height>g.height&&c.top-h.height+this.options.offsetY>0?b.top-h.height+this.options.offsetY:b.top+f.height+this.options.offsetY}Debug.write("Menu position: "+a.top+" x "+a.left);$(this.target).setStyle("top: "+(a.top-1)+"px; left: "+a.left+"px;");new Effect.Appear($(this.target),{duration:0.2,afterFinish:function(){Object.isFunction(this.callbacks.afterOpen)&&this.callbacks.afterOpen(this)}.bind(this)});Event.observe(document,"keypress",this.checkKeyPress.bindAsEventListener(this))},checkKeyPress:function(a){a.keyCode==Event.KEY_ESC&&this.doClose()},doClose:function(){new Effect.Fade($(this.target),{duration:0.3,afterFinish:function(){Object.isFunction(this.callbacks.afterClose)&&this.callbacks.afterClose(this)}.bind(this)})},targetClick:function(a){this.options.stopClose&&Event.stop(a)},eventClick:function(a){Event.stop(a);if($(this.target).visible()){Object.isFunction(this.callbacks.beforeClose)&&this.callbacks.beforeClose(this);this.doClose()}else{ipb.menus.closeAll($(this.source).id);Object.isFunction(this.callbacks.beforeOpen)&&this.callbacks.beforeOpen(this);this.doOpen()}},eventOver:function(){}});_popup=window.IPBoard;_popup.prototype.Popup=Class.create({initialize:function(a,b,c){this.id="";this.stem=this.inner=this.wrapper=null;this.options={};this.timer=[];this.ready=false;this._startup=null;this.hideAfterSetup=false;this.eventPairs={mouseover:"mouseout",mousedown:"mouseup"};this._tmpEvent=null;this.id=a;this.options=Object.extend({type:"pane",w:"500px",modal:false,modalOpacity:0.4,hideAtStart:true,delay:{show:0,hide:0},defer:false,hideClose:false,closeContents:ipb.templates.close_popup},b||{});this.callbacks=c||{};if(this.options.defer&&$(this.options.attach.target)){this._defer=this.init.bindAsEventListener(this);$(this.options.attach.target).observe(this.options.attach.event,this._defer);if(this.eventPairs[this.options.attach.event]){this._startup=function(){this.hideAfterSetup=true;this.hide()}.bindAsEventListener(this);$(this.options.attach.target).observe(this.eventPairs[this.options.attach.event],this._startup)}}else this.init()},init:function(){try{Event.stopObserving($(this.options.attach.target),this.options.attach.event,this._defer)}catch(a){}this.wrapper=(new Element("div",{id:this.id+"_popup"})).setStyle("z-index: 16000").hide().addClassName("popupWrapper");this.inner=(new Element("div",{id:this.id+"_inner"})).addClassName("popupInner");this.options.w&&this.inner.setStyle("width: "+this.options.w);this.options.h&&this.inner.setStyle("max-height: "+this.options.h);this.wrapper.insert(this.inner);if(this.options.hideClose!=true){this.closeLink=(new Element("div",{id:this.id+"_close"})).addClassName("popupClose").addClassName("clickable");this.closeLink.update(this.options.closeContents);this.closeLink.observe("click",this.hide.bindAsEventListener(this));this.wrapper.insert(this.closeLink)}$$("body")[0].insert(this.wrapper);this.options.classname&&this.wrapper.addClassName(this.options.classname);this.options.initial&&this.update(this.options.initial);if(this.options.ajaxURL){this.updateAjax();setTimeout(this.continueInit.bind(this),80)}else{this.ready=true;this.continueInit()}},continueInit:function(){if(this.ready){this.options.type=="balloon"?this.setUpBalloon():this.setUpPane();try{if(this.options.close){closeElem=$(this.wrapper).select(this.options.close)[0];Object.isElement(closeElem)&&$(closeElem).observe("click",this.hide.bindAsEventListener(this))}}catch(a){Debug.write(a)}Object.isFunction(this.callbacks.afterInit)&&this.callbacks.afterInit(this);!this.options.hideAtStart&&!this.hideAfterSetup&&this.show();this.hideAfterSetup&&this._startup&&Event.stopObserving($(this.options.attach.target),this.eventPairs[this.options.attach.event],this._startup)}else setTimeout(this.continueInit.bind(this),80)},updateAjax:function(){new Ajax.Request(this.options.ajaxURL,{method:"get",onSuccess:function(a){if(a.responseText!="error")if(a.responseText=="nopermission")alert(ipb.lang.no_permission);else{if(a.responseText.match("__session__expired__log__out__")){this.update("");alert("Your session has expired, please refresh the page and log back in");return false}Debug.write("AJAX done!");this.update(a.responseText);this.ready=true;Object.isFunction(this.callbacks.afterAjax)&&this.callbacks.afterAjax(this,a.responseText)}else Debug.write(a.responseText)}.bind(this)})},show:function(a){a&&Event.stop(a);this.timer.show&&clearTimeout(this.timer.show);if(this.options.delay.show!=0)this.timer.show=setTimeout(this._show.bind(this),this.options.delay.show);else this._show()},hide:function(a){a&&Event.stop(a);this.document_event&&Event.stopObserving(document,"click",this.document_event);this.timer.hide&&clearTimeout(this.timer.hide);if(this.options.delay.hide!=0)this.timer.hide=setTimeout(this._hide.bind(this),this.options.delay.hide);else this._hide()},_show:function(){if(this.options.modal==false){new Effect.Appear($(this.wrapper),{duration:0.3,afterFinish:function(){Object.isFunction(this.callbacks.afterShow)&&this.callbacks.afterShow(this)}.bind(this)});this.document_event=this.handleDocumentClick.bindAsEventListener(this);Event.observe(document,"click",this.document_event)}else new Effect.Appear($("document_modal"),{duration:0.3,to:this.options.modalOpacity,afterFinish:function(){new Effect.Appear($(this.wrapper),{duration:0.4,afterFinish:function(){Object.isFunction(this.callbacks.afterShow)&&this.callbacks.afterShow(this)}.bind(this)})}.bind(this)})},_hide:function(){if(this._tmpEvent!=null){Event.stopObserving($(this.wrapper),"mouseout",this._tmpEvent);this._tmpEvent=null}if(this.options.modal==false)new Effect.Fade($(this.wrapper),{duration:0.3,afterFinish:function(){Object.isFunction(this.callbacks.afterHide)&&this.callbacks.afterHide(this)}.bind(this)});else new Effect.Fade($(this.wrapper),{duration:0.3,afterFinish:function(){new Effect.Fade($("document_modal"),{duration:0.2,afterFinish:function(){Object.isFunction(this.callbacks.afterHide)&&this.callbacks.afterHide(this)}.bind(this)})}.bind(this)})},handleDocumentClick:function(a){Event.element(a).descendantOf(this.wrapper)||this._hide(a)},update:function(a){this.inner.update(a)},setUpBalloon:function(){if(this.options.attach){var a=this.options.attach;if(a.target&&$(a.target)){this.options.stem==true&&this.createStem();if(!a.position)a.position="auto";if(Object.isUndefined(a.offset))a.offset={top:0,left:0};if(Object.isUndefined(a.offset.top))a.offset.top=0;if(Object.isUndefined(a.offset.left))a.offset.left=0;if(a.position=="auto"){Debug.write("Popup: auto-positioning");var b=document.viewport.getDimensions(),c=document.viewport.getScrollOffsets(),d=$(a.target).viewportOffset(),e=$(this.wrapper).getDimensions(),f=[0,0];if(Element.getStyle($(a.target),"position")=="absolute")f=element.getOffsetParent().viewportOffset();d.left=d[0]-f[0];d.top=d[1]-f[1]+c.top;f="top";var g="left";if(d.top-e.height-a.offset.top<0+c.top)f="bottom";if(d.left+e.width-a.offset.left>b.width-c.left)g="right";finalPos=this.position(f+g,{target:$(a.target),content:$(this.wrapper),offset:a.offset});if(this.options.stem==true)finalPos=this.positionStem(f+g,finalPos)}else{Debug.write("Popup: manual positioning");finalPos=this.position(a.position,{target:$(a.target),content:$(this.wrapper),offset:a.offset});if(this.options.stem==true)finalPos=this.positionStem(a.position,finalPos)}if(!Object.isUndefined(a.event)){$(a.target).observe(a.event,this.show.bindAsEventListener(this));a.event!="click"&&!Object.isUndefined(this.eventPairs[a.event])&&$(a.target).observe(this.eventPairs[a.event],this.hide.bindAsEventListener(this));$(this.wrapper).observe("mouseover",this.wrapperEvent.bindAsEventListener(this))}}}Debug.write("Popup: Left: "+finalPos.left+"; Top: "+finalPos.top);$(this.wrapper).setStyle("top: "+finalPos.top+"px; left: "+finalPos.left+"px; position: absolute;")},wrapperEvent:function(){if(this.timer.hide){clearTimeout(this.timer.hide);this.timer.hide=null;if(this.options.attach.event&&this.options.attach.event=="mouseover")if(this._tmpEvent==null){this._tmpEvent=this.hide.bindAsEventListener(this);$(this.wrapper).observe("mouseout",this._tmpEvent)}}},positionStem:function(a,b){var c={height:16,width:31},d={},e={};switch(a.toLowerCase()){case"topleft":d={marginBottom:c.height+"px"};e={bottom:-c.height+"px",left:"5px"};b.left-=15;break;case"topright":d={marginBottom:c.height+"px"};e={bottom:-c.height+"px",right:"5px"};b.left+=15;break;case"bottomleft":d={marginTop:c.height+"px"};e={top:-c.height+"px",left:"5px"};b.left-=15;break;case"bottomright":d={marginTop:c.height+"px"};e={top:-c.height+"px",right:"5px"};b.left+=15;break}
$(this.wrapper).setStyle(d);$(this.stem).setStyle(e).setStyle("z-index: 6000").addClassName(a.toLowerCase());return b},position:function(a,b){finalPos={};var c=$(b.target).viewportOffset(),d=$(b.target).getDimensions(),e=$(b.content).getDimensions(),f=document.viewport.getScrollOffsets(),g=b.offset,h=[0,0];if(Element.getStyle($(b.target),"position")=="absolute")h=element.getOffsetParent().viewportOffset();c.left=c[0]-h[0];c.top=c[1]-h[1];Prototype.Browser.Opera||(c.top+=f.top);switch(a.toLowerCase()){case"topleft":finalPos.top=c.top-e.height-d.height-g.top;finalPos.left=c.left+g.left;break;case"topright":finalPos.top=c.top-e.height-d.height-g.top;finalPos.left=c.left-(e.width-d.width)-g.left;break;case"bottomleft":finalPos.top=c.top+d.height+g.top;finalPos.left=c.left+g.left;break;case"bottomright":finalPos.top=c.top+d.height+g.top;finalPos.left=c.left-(e.width-d.width)-g.left;break}
return finalPos},createStem:function(){this.stem=(new Element("div",{id:this.id+"_stem"})).update("&nbsp;").addClassName("stem");this.wrapper.insert({top:this.stem})},setUpPane:function(){$("document_modal")||this.createDocumentModal();this.positionPane()},positionPane:function(){var a=$(this.wrapper).getDimensions(),b=document.viewport.getDimensions();document.viewport.getScrollOffsets();a={left:(b.width-a.width)/2,top:(b.height-a.height)/2/2};if(a.top<10)a.top=10;$(this.wrapper).setStyle("top: "+a.top+"px; left: "+a.left+"px; position: fixed;")},createDocumentModal:function(){var a=$("ipboard_body").getDimensions(),b=document.viewport.getDimensions(),c=[];c.height=b.height<a.height?a.height:b.height;c.width=b.width<a.width?a.width:b.width;a=(new Element("div",{id:"document_modal"})).addClassName("modal").hide();a.setStyle("width: "+c.width+"px; height: "+c.height+"px; position: absolute; top: 0px; left: 0px; z-index: 15000;");$$("body")[0].insert(a)},getObj:function(){return $(this.wrapper)}});ipb=new IPBoard;ipb.global.init();ipb.menus.init();;var _quickpm=window.IPBoard;_quickpm.prototype.quickpm={popupObj:null,sendingToUser:0,init:function(){Debug.write("Initializing ips.quickpm.js");document.observe("dom:loaded",function(){ipb.quickpm.initEvents()})},initEvents:function(){ipb.delegate.register(".pm_button",ipb.quickpm.launchPMform)},launchPMform:function(a,b){Debug.write("Launching PM form");pmInfo=b.id.match(/pm_([0-9a-z]+)_([0-9]+)/);pmInfo[2]||Debug.error("Could not find member ID in string "+b.id);if($("pm_popup_popup"))if(pmInfo[2]==ipb.quickpm.sendingToUser){try{$("pm_error_"+ipb.quickpm.sendingToUser).hide()}catch(c){}ipb.quickpm.popupObj.show();Event.stop(a);return}else{ipb.quickpm.popupObj.getObj().remove();ipb.quickpm.sendingToUser=null;ipb.quickpm.sendingToUser=pmInfo[2]}else ipb.quickpm.sendingToUser=pmInfo[2];ipb.quickpm.popupObj=new ipb.Popup("pm_popup",{type:"pane",modal:true,hideAtStart:true,w:"600px"});var d=ipb.quickpm.popupObj;new Ajax.Request(ipb.vars.base_url+"&app=members&module=ajax&secure_key="+ipb.vars.secure_hash+"&section=messenger&do=showQuickForm&toMemberID="+pmInfo[2],{method:"post",evalJSON:"force",onSuccess:function(e){if(e.responseJSON.error){switch(e.responseJSON.error){case"noSuchToMember":alert(ipb.lang.member_no_exist);break;case"cannotUsePMSystem":;case"nopermission":alert(ipb.lang.no_permission);break;default:alert(e.responseJSON.error);break}
ipb.quickpm.sendingToUser=0}else{d.update(e.responseJSON.success);d.positionPane();d.show();$(d.getObj()).select(".input_submit")[0]&&$(d.getObj()).select(".input_submit")[0].observe("click",ipb.quickpm.doSend);$(d.getObj()).select(".cancel")[0]&&$(d.getObj()).select(".cancel")[0].observe("click",ipb.quickpm.cancelForm)}}});Event.stop(a)},cancelForm:function(a){$("pm_error_"+ipb.quickpm.sendingToUser).hide();ipb.quickpm.popupObj.hide();Event.stop(a)},doSend:function(a){Debug.write("Sending");if(ipb.quickpm.sendingToUser){Event.stop(a);if($F("pm_subject_"+ipb.quickpm.sendingToUser).blank())ipb.quickpm.showError(ipb.lang.quickpm_enter_subject);else if($F("pm_textarea_"+ipb.quickpm.sendingToUser).blank())ipb.quickpm.showError(ipb.lang.quickpm_msg_blank);else{var b=ipb.quickpm.popupObj;if($(b.getObj()).select(".input_submit")[0])$(b.getObj()).select(".input_submit")[0].disabled=true;new Ajax.Request(ipb.vars.base_url+"&app=members&module=ajax&secure_key="+ipb.vars.secure_hash+"&section=messenger&do=PMSend&toMemberID="+ipb.quickpm.sendingToUser,{method:"post",parameters:{Post:$F("pm_textarea_"+ipb.quickpm.sendingToUser).encodeParam(),std_used:1,toMemberID:ipb.quickpm.sendingToUser,subject:$F("pm_subject_"+ipb.quickpm.sendingToUser).encodeParam()},evalJSON:"force",onSuccess:function(c){Object.isUndefined(c.responseJSON)&&alert(ipb.lang.action_failed);if(c.responseJSON.error){b.hide();ipb.quickpm.sendingToUser=0;Event.stop(a);switch(c.responseJSON.error){case"cannotUsePMSystem":;case"nopermission":alert(ipb.lang.no_permission);break;default:alert(c.responseJSON.error);break}}else if(c.responseJSON.inlineError){ipb.quickpm.showError(c.responseJSON.inlineError);if($(b.getObj()).select(".input_submit")[0])$(b.getObj()).select(".input_submit")[0].disabled=false}else if(c.responseJSON.status){b.hide();ipb.quickpm.sendingToUser=0;Event.stop(a);alert(ipb.lang.message_sent)}else Debug.dir(c.responseJSON)}})}}},showError:function(a){if(ipb.quickpm.sendingToUser&&$("pm_error_"+ipb.quickpm.sendingToUser)){$("pm_error_"+ipb.quickpm.sendingToUser).select(".message")[0].update(a);$("pm_error_"+ipb.quickpm.sendingToUser).visible()||new Effect.BlindDown($("pm_error_"+ipb.quickpm.sendingToUser),{duration:0.3})}}};ipb.quickpm.init();;var _editor=window.IPBoard,isRTL=isRTL?isRTL:false;_editor_rte=Class.create({_identifyType:function(){Debug.write("(Editor "+this.id+") This is the RTE class")},togglesource_pre_show_html:function(){},togglesource_post_show_html:function(){},editor_write_contents:function(a,b){if(a.blank()&&Prototype.Browser.Gecko)a="<br />";if(this.editor_document&&this.editor_document.initialized)this.editor_document.body.innerHTML=a;else{if(b)this.editor_document.designMode="on";this.editor_document=this.editor_window.document;this.editor_document.open("text/html","replace");this.editor_document.write(this.ips_frame_html.replace("{:content:}",a));this.editor_document.close();if(b){this.editor_document.body.contentEditable=true;this.editor_document.initialized=true}}},removeformat:function(){this.apply_formatting("unlink",false,false);this.apply_formatting("removeformat",false,false);var a=this.get_selection();if(a){a=this.strip_html(a);a=this.strip_empty_html(a);a=a.replace(/\r/g,"");a=a.replace(/\n/g,"<br />");a=a.replace(/<!--(.*?)--\>/g,"");a=a.replace(/&lt;!--(.*?)--&gt;/g,"");this.insert_text(a)}},editor_get_contents:function(){return this.editor_document.body.innerHTML},editor_set_content:function(a){if($(this.id+"_iframe"))this.editor_box=$(this.id+"_iframe");else{var b=new Element("iframe",{id:this.id+"_iframe",tabindex:0});Prototype.Browser.IE&&window.location.protocol=="https:"&&b.writeAttribute("src",this.options.file_path+"/index.html");this.items.text_obj.up().insert(b);this.editor_box=b}if(Prototype.Browser.IE)Object.isUndefined(a)||(a=a.replace(/&sect/g,"&amp;sect"));else this.editor_box.setStyle("border: 1px inset");b=ipb.Cookie.get("ips_rte_height");if(Object.isNumber(b)&&b>50){this.items.text_obj.setStyle({height:b+"px"});Debug.write("Set text_obj height to "+b)}b=this.items.text_obj.getDimensions();if(Object.isUndefined(b)||b.height==0)b.height=250;this.editor_box.setStyle({width:"100%",height:b.height+"px",className:this.items.text_obj.className});this.items.text_obj.hide();this.editor_window=this.editor_box.contentWindow;this.editor_document=this.editor_window.document;this.editor_write_contents(Object.isUndefined(a)||!a?this.items.text_obj.value:a,true);this.editor_document.editor_id=this.editor_id;this.editor_window.editor_id=this.editor_id;this.editor_window.has_focus=false},apply_formatting:function(a,b,c){b=Object.isUndefined(b)?false:b;c=Object.isUndefined(c)?true:c;if(Prototype.Browser.IE&&this.forum_fix_ie_newlines)if(a=="justifyleft"||a=="justifycenter"||a=="justifyright"){a=a.replace("justify","");this.wrap_tags_lite("["+a+"]","[/"+a+"]");return true}else if(a=="outdent"||a=="indent"||a=="insertorderedlist"||a=="insertunorderedlist"){this.editor_check_focus();var d=this.editor_document.selection,e=this.editor_document.selection.createRange(),f=e.htmlText.replace(/<p([^>]*)>(.*)<\/p>/i,"$2");if(d.type=="Text"||d.type=="None")e.pasteHTML(f+"<p />\n");else this.editor_document.body.innerHTML+="<p />"}if(Prototype.Browser.IE&&this._ie_cache!=null){this.editor_check_focus();this._ie_cache.select()}this.editor_document.execCommand(a,b,c);return false},get_selection:function(){var a=this._ie_cache?this._ie_cache:this.editor_document.selection.createRange();if(a.htmlText)return a.htmlText;else for(var b="",c=0;c<a.length;c++)b+=a.item(c).outerHTML;return b},editor_set_functions:function(){Event.observe(this.editor_document,"mouseup",this.events.editor_document_onmouseup.bindAsEventListener(this));Event.observe(this.editor_document,"keyup",this.events.editor_document_onkeyup.bindAsEventListener(this));Event.observe(this.editor_document,"keydown",this.events.editor_document_onkeydown.bindAsEventListener(this));Event.observe(this.editor_window,"blur",this.events.editor_window_onblur.bindAsEventListener(this));Event.observe(this.editor_window,"focus",this.events.editor_window_onfocus.bindAsEventListener(this))},set_context:function(a){if(this._showing_html)return false;this.button_update.each(function(b){var c=$(this.id+"_cmd_"+b);if(c!=null)try{var d=new String(this.editor_document.queryCommandState(b));if(c.readAttribute("state")!=d){c.writeAttribute("state",new String(d));this.set_button_context(c,c.readAttribute("cmd")==a?"mouseover":"mouseout")}}catch(e){Debug.write("#1 "+e)}}.bind(this));this.button_set_font_context();this.button_set_size_context()},button_set_font_context:function(a){changeto="";if(this._showing_html)return false;if(this.items.buttons.fontname){if(Object.isUndefined(a))a=this.editor_document.queryCommandValue("fontname")||"";if(a.blank()){if(!Prototype.Browser.IE&&window.getComputedStyle)a=this.editor_document.body.style.fontFamily}else if(a==null)a="";if(a!=this.font_state){var b=this.font_state=a;a=b.indexOf(",");if(a!=-1)b=b.substr(0,a);b=b.toLowerCase();changeto="";ipb.editor_values.get("primary_fonts").any(function(c){if(c.value.toLowerCase()==b){changeto=c.value;return true}else return false});changeto=changeto==""?this.fontoptions._default:changeto;this.items.buttons.fontname.update(changeto)}}},button_set_size_context:function(a){if(this.items.buttons.fontsize){if(Object.isUndefined(a))a=this.editor_document.queryCommandValue("fontsize");if(a==null||a=="")if(Prototype.Browser.Gecko)(a=this.convert_size(this.editor_document.body.style.fontSize,0))||(a="2");changeto="";if(a!=this.size_state){this.size_state=a;ipb.editor_values.get("font_sizes").any(function(b){if(parseInt(b)==parseInt(this.size_state)){changeto=b;return true}else return false}.bind(this));changeto=changeto==""?this.sizeoptions._default:changeto;this.items.buttons.fontsize.update(changeto)}}},insert_text:function(a){this.editor_check_focus();typeof this.editor_document.selection!="undefined"&&this.editor_document.selection.type!="Text"&&this.editor_document.selection.type!="None"&&this.editor_document.selection.clear();var b=this._ie_cache?this._ie_cache:this.editor_document.selection.createRange();b.pasteHTML(a);b.select();this._ie_cache=null},insert_emoticon:function(a,b,c){try{this.wrap_tags_lite(" "+(' <img src="'+(ipb.vars.emoticon_url+"/"+b)+'" class="bbc_emoticon" alt="'+this.unhtmlspecialchars(c)+'" />')," ")}catch(d){Debug.write("#2 "+d)}},togglesource:function(a,b){Event.stop(a);if(this._showing_html){if(b){this.editor_document.initialized=false;this.editor_write_contents($(this.id+"_htmlsource").value,true)}$(this.editor_box).show();$(this.items.controls).show();$(this.id+"_htmlsource").remove();$(this.id+"_ts_controls").remove();this._showing_html=false}else{this._showing_html=true;this.togglesource_pre_show_html();a=new Element("textarea",{id:this.id+"_htmlsource",tabindex:3});a.className=this.items.text_obj.className;this.items.text_obj.getDimensions();a.value=this.clean_html(this.editor_get_contents());b=ipb.editor_values.get("templates").togglesource.evaluate({id:this.id});$(this.items.text_obj).insert({after:a});$(a).insert({after:b});$(this.id+"_ts_update").writeAttribute("cmd","togglesource").writeAttribute("editor_id",this.id).observe("click",this.togglesource.bindAsEventListener(this,1));$(this.id+"_ts_cancel").writeAttribute("cmd","togglesource").writeAttribute("editor_id",this.id).observe("click",this.togglesource.bindAsEventListener(this,0));$(this.items.controls).hide();$(this.editor_box).hide()}this.editor_check_focus()},update_for_form_submit:function(){Debug.write("Updating for submit");this.items.text_obj.value=this.editor_get_contents();if(Prototype.Browser.WebKit){this.items.text_obj.value=this.items.text_obj.value.replace(/<span class="Apple-style-span" style="text-decoration: underline;">([^>]*)<\/span>/gi,"<u>$1</u>");this.items.text_obj.value=this.items.text_obj.value.replace(/<span class="Apple-style-span" style="text-decoration: line-through;">([^>]*)<\/span>/gi,"<strike>$1</strike>")}return true}});_editor_std=Class.create({_identifyType:function(){Debug.write("(Editor "+this.id+") This is the STD class")},editor_set_content:function(a){var b=this.items.text_obj.up().down("iframe",0);if(!Object.isUndefined(b)){var c=b.getDimensions();$(this.items.text_obj).setStyle({width:c.width,height:c.height}).show();$(b).setStyle("width: 0px; height: 0px; border: none;")}this.editor_box=this.editor_document=this.editor_window=this.items.text_obj;Object.isUndefined(a)||this.editor_write_contents(a);this.editor_document.editor_id=this.id;this.editor_window.editor_id=this.id;!Prototype.Browser.IE&&$(this.id+"_cmd_spellcheck")&&$(this.id+"_cmd_spellcheck").hide();$(this.id+"_cmd_removeformat")&&$(this.id+"_cmd_removeformat").hide();$(this.id+"_cmd_togglesource")&&$(this.id+"_cmd_togglesource").hide();$(this.id+"_cmd_justifyfull")&&$(this.id+"_cmd_justifyfull").hide();$(this.id+"_cmd_outdent")&&$(this.id+"_cmd_outdent").hide();$(this.id+"_cmd_switcheditor")&&$(this.id+"_cmd_switcheditor").hide()},editor_write_contents:function(a){this.items.text_obj.value=a},editor_get_contents:function(){return this.editor_document.value},apply_formatting:function(a,b,c){switch(a){case"bold":;case"italic":;case"underline":this.wrap_tags(a.substr(0,1),false);return;case"justifyleft":;case"justifycenter":;case"justifyright":this.wrap_tags(a.substr(7),false);return;case"indent":this.wrap_tags(a,false);return;case"createlink":this.get_selection()?this.wrap_tags("url",c):this.wrap_tags("url",c,c);return;case"fontname":this.wrap_tags("font",c);return;case"fontsize":this.wrap_tags("size",c);return;case"forecolor":this.wrap_tags("color",c);return;case"backcolor":this.wrap_tags("background",c);return;case"insertimage":this.wrap_tags("img",false,c);return;case"strikethrough":this.wrap_tags("s",false);return;case"superscript":this.wrap_tags("sup",false);return;case"subscript":this.wrap_tags("sub",false);return;case"removeformat":return}},editor_set_functions:function(){Event.observe(this.editor_document,"keypress",this.events.editor_document_onkeypress.bindAsEventListener(this));Event.observe(this.editor_window,"focus",this.events.editor_window_onfocus.bindAsEventListener(this));Event.observe(this.editor_window,"blur",this.events.editor_window_onblur.bindAsEventListener(this))},set_context:function(){},get_selection:function(){return Object.isUndefined(this.editor_document.selectionStart)?document.selection&&document.selection.createRange||this._ie_cache?this._ie_cache?this._ie_cache.text:document.selection.createRange().text:window.getSelection?window.getSelection()+"":false:this.editor_document.value.substr(this.editor_document.selectionStart,this.editor_document.selectionEnd-this.editor_document.selectionStart)},insert_text:function(a){this.editor_check_focus();if(Object.isUndefined(this.editor_document.selectionStart))if(document.selection&&document.selection.createRange||this._ie_cache){var b=this._ie_cache?this._ie_cache:document.selection.createRange();b.text=a.replace(/\r?\n/g,"\r\n");b.select();Debug.write("Insert 2")}else{this.editor_document.value+=a;Debug.write("Insert 3")}else{b=this.editor_document.selectionStart+0;var c=this.editor_document.scrollTop,d=b+a.length;if(Prototype.Browser.Opera){var e=a.match(/\n/g);try{d+=parseInt(e.length)}catch(f){Debug.write("#3 "+f)}}this.editor_document.value=this.editor_document.value.substr(0,this.editor_document.selectionStart)+a+this.editor_document.value.substr(this.editor_document.selectionEnd);if(a.match(new RegExp("\\"+this.open_brace+"(\\S+?)\\"+this.close_brace+"\\"+this.open_brace+"/(\\S+?)\\"+this.close_brace))){if(Prototype.Browser.Gecko)this.editor_document.scrollTop=c}else{this.editor_document.selectionStart=b;this.editor_document.selectionEnd=d;this.editor_document.scrollTop=c;Debug.write("Insert 0")}this.editor_document.setSelectionRange(b,d);Debug.write("Insert 1")}this._ie_cache=null},insert_emoticon:function(a,b,c){this.editor_check_focus();c=this.unhtmlspecialchars(c);this.wrap_tags_lite(" "+c," ")},insertorderedlist:function(){this.insertlist("ol")},insertunorderedlist:function(){this.insertlist("ul")},insertlist:function(a){var b,c="<li>",d="</li>",e="";if(this.use_bbcode){e=new RegExp("([\r\n]+|^[\r\n]*)(?!\\[\\*\\]|\\[\\/?list)(?=[^\r\n])","gi");b=a=="ol"?"[list=1]\n":"[list]\n";a="[/list]";c="[*]";d=""}else{e=new RegExp("([\r\n]+|^[\r\n]*)(?!<li>|<\\/?ol|ul)(?=[^\r\n])","gi");b=a=="ol"?"<ol>\n":"<ul>\n";a=a=="ol"?"</ol>\n":"</ul>\n"}if(text=this.get_selection()){text=b+text.replace(e,"\n"+c+"$1"+d)+"\n"+a;if(this.use_bbcode)text=text.replace(new RegExp("\\[\\*\\][\r\n]+","gi"),c);this.insert_text(text)}else{b=b;for(e="";val=prompt(ipb.lang.editor_enter_list,"");)e+=c+val+d+"\n";if(e){b+=e;b+=a;this.insert_text(b)}}},removeformat:function(){var a=this.get_selection();if(a){a=this.strip_html(a);this.insert_text(a)}},unlink:function(){var a=this.get_selection();if(a!==false){if(a.match(""))a=this.use_bbcode?a.replace(/\[url=([^\]]+?)\]([^\[]+?)\[\/url\]/ig,"$2"):a.replace(/<a href=['\"]([^\"']+?)['\"]([^>]+?)?>(.+?)<\/a>/ig,"$3");this.insert_text(a)}},undo:function(){this.history_record_state(this.editor_get_contents());this.history_time_shift(-1);if((text=this.history_fetch_recording())!==false)this.editor_document.value=text},redo:function(){this.history_time_shift(1);if((text=this.history_fetch_recording())!==false)this.editor_document.value=text},update_for_form_submit:function(){return true}});if(USE_RTE){Debug.write("Extending with RTE");_type=_editor_rte}else{Debug.write("Extending with STD");_type=_editor_std}_editor.prototype.editor=Class.create(_type,{initialize:function(a,b,c,d){this.id=a;this.is_rte=b;this.use_bbcode=!b;this.events=null;this.options=[];this.items=[];this.settings={};this.close_brace=this.open_brace="";this.initialized=this.allow_advanced=0;this.ips_frame_html="";this.forum_fix_ie_newlines=1;this.has_focus=null;this.history_recordings=[];this.history_pointer=-1;this._ie_cache=null;this._loading=this._showing_html=false;this.original=$H();this.hidden_objects=[];this.fontoptions=$A();this.sizeoptions=$A();this.size_state=this.font_state=null;this.palettes={};this.defaults={};this.key_handlers=[];this.emoticons_loaded=this.showing_sidebar=false;this.options=Object.extend({file_path:"",forum_fix_ie_newlines:1,char_set:"UTF-8",ignore_controls:[],button_update:[]},d||{});this.button_update=$A(["bold","italic","underline","justifyleft","justifycenter","justifyright","insertorderedlist","insertunorderedlist","superscript","subscript","strikethrough"].concat(this.options.button_update));this.values=ipb.editor_values;this.items.text_obj=$(this.id+"_textarea");this.items.buttons=$A();this.items.controls=$(this.id+"_controls");this.open_brace=this.use_bbcode?"[":"<";this.close_brace=this.use_bbcode?"]":">";this.allow_advanced=this.use_bbcode?0:1;this.doc_body=$$("body")[0];this.events=new _editor_events;this._identifyType();this.values.get("bbcodes")&&$(this.id+"_cmd_otherstyles")&&this.buildCustomStyles();this.items.text_obj.up("form")&&this.items.text_obj.up("form").observe("submit",function(){this.update_for_form_submit()}.bindAsEventListener(this));this.init(c);Debug.write("All editor initialization complete")},init:function(a){try{if(!this.initialized){if($(this.id+"_wysiwyg_used"))$(this.id+"_wysiwyg_used").value=parseInt(this.is_rte);if(ipb.Cookie.get("emoticon_sidebar")=="1"&&$(this.id+"_sidebar")){this.buildEmoticons();$(this.id+"_sidebar").show();$("editor_"+this.id).addClassName("with_sidebar");ipb.Cookie.set("emoticon_sidebar",1,1);this.showing_sidebar=true}this.ips_frame_html=this.get_frame_html();this.editor_set_content(a);this.editor_set_functions();this.editor_set_controls();this.initialized=true}}catch(b){Debug.error("#4 "+b)}},buildCustomStyles:function(){var a=false,b=false,c=ipb.editor_values.get("templates").toolbar.evaluate({id:this.id,toolbarid:"3"});$(this.id+"_toolbar_2").insert({after:c});this.init_editor_menu($(this.id+"_cmd_otherstyles"));this.values.get("bbcodes").each(function(d){if(d.value.image.blank()){$(this.id+"_popup_otherstyles_menu").insert(ipb.editor_values.get("templates").menu_item.evaluate({id:this.id,cmd:d.key,title:d.value.title}));b=true}else{$(this.id+"_toolbar_3").insert(ipb.editor_values.get("templates").button.evaluate({id:this.id,cmd:d.key,title:d.value.title,img:d.value.image}));a=true}if(!(d.value.useoption=="0"&&d.value.single_tag=="1")){var e=new Element("div",{id:this.id+"_palette_otherstyles_"+d.key});e.addClassName("ipb_palette").addClassName("extended");e.writeAttribute("styleid",d.key);var f=this.values.get("templates").generic.evaluate({id:this.id+"_"+d.key,title:d.value.title,example:d.value.example,option_text:d.value.menu_option_text||"",value_text:d.value.menu_content_text||""});e.update(f);this.doc_body.insert({top:e});d.value.useoption=="0"&&e.select(".optional").invoke("remove");d.value.single_tag=="1"&&e.select(".tagcontent").invoke("remove");this.palettes["otherstyles_"+d.key]=new ipb.Menu($(this.id+"_cmd_custom_"+d.key),e,{stopClose:true,offsetX:0,offsetY:42,positionSource:$(this.id+"_cmd_otherstyles")});e.down('input[type="submit"]').observe("click",this.events.handle_custom_onclick.bindAsEventListener(this))}$(this.id+"_cmd_custom_"+d.key).observe("click",this.events.handle_custom_command.bindAsEventListener(this,d.key))}.bind(this));a&&$(this.id+"_toolbar_3").show();b&&$(this.id+"_cmd_otherstyles").show()},resize_to:function(a){var b=function(){};if(Prototype.Browser.Opera&&$(this.id+"_emoticon_holder")){b=$(this.id+"_emoticon_holder").getHeight();var c=(this.is_rte?$(this.editor_box).getHeight():$(this.items.text_obj).getHeight())-a;b=b-c;$(this.id+"_emoticon_holder").setStyle("height: "+b+"px");b=function(){$(this.id+"_emoticon_holder").setStyle("height: auto;")}.bind(this)}try{if(this.is_rte){new Effect.Morph($(this.editor_box),{style:"height: "+a+"px",duration:0.3,afterFinish:b});$(this.items.text_obj).setStyle("height: "+a+"px")}else{new Effect.Morph($(this.items.text_obj),{style:"height: "+a+"px",duration:0.3,afterFinish:b});$(this.editor_box)&&$(this.editor_box).setStyle("height: "+a+"px")}}catch(d){Debug.write("#5 "+d)}},get_frame_html:function(){var a="";a+='<html id="'+this.id+'_html">\n';a+="<head>\n";a+='<meta http-equiv="content-type" content="text/html; charset='+this.options.char_set+'" />';a+="<style type='text/css' media='all'>\n";a+="body {\n";a+="\tbackground: #FFFFFF;\n";a+="\tmargin: 0px;\n";a+="\tpadding: 4px;\n";a+="\tfont-family: Verdana, arial, sans-serif;\n";a+="\tfont-size: 9pt;\n";a+="}\n";a+="</style>\n";if(isRTL&&rtlFull){a+="<link rel='stylesheet' type='text/css' media='screen' href='"+rtlFull+"' />\n";if(rtlIe&&Prototype.Browser.IE){a+="<!--[if lte IE 7]>\n";a+="<link rel='stylesheet' type='text/css' media='screen' href='"+rtlIe+"' />\n";a+="<![endif]--\>\n"}}a+="</head>\n";a+="<body class='withRTL'>\n";a+="{:content:}\n";a+="</body>\n";a+="</html>";return a},editor_check_focus:function(){if(this.is_rte){Debug.write("Focussing RTE");try{this.editor_window.focus()}catch(a){Debug.write("Could not focus editor window")}}else{Debug.write("Focussing STD Textarea");this._ie_cache||this.items.text_obj.focus()}},editor_set_controls:function(){controls=$(this.id+"_controls").select(".rte_control").each(function(a){if(a.id)if(!this.options.ignore_controls.include(a.id.toLowerCase())){if(a.hasClassName("rte_button"))this.init_editor_button(a);else if(a.hasClassName("rte_menu")&&!a.hasClassName("rte_special"))this.init_editor_menu(a);else if(a.hasClassName("rte_palette"))this.init_editor_palette(a);else return;this.set_control_unselectable(a)}}.bind(this));if($(this.id+"_resizer")){this.init_editor_button($(this.id+"_cmd_r_small"));this.set_control_unselectable($(this.id+"_cmd_r_small"));this.init_editor_button($(this.id+"_cmd_r_big"));this.set_control_unselectable($(this.id+"_cmd_r_big"))}},set_button_context:function(a,b,c){if(this._showing_html)return false;if(Object.isUndefined(c))c="button";if(b=="mousedown"&&(a.readAttribute("cmd")=="undo"||a.readAttribute("cmd")=="redo"))return false;switch(a.readAttribute("state")){case"true":switch(b){case"mouseout":this.editor_set_ctl_style(a,"button","selected");break;case"mouseover":;case"mousedown":;case"mouseup":this.editor_set_ctl_style(a,c,"down");break}
break;default:switch(b){case"mouseout":this.editor_set_ctl_style(a,c,"normal");break;case"mousedown":this.editor_set_ctl_style(a,c,"down");break;case"mouseover":;case"mouseup":this.editor_set_ctl_style(a,c,"hover");break}
break}},editor_set_ctl_style:function(a,b,c){if(a.readAttribute("mode")!=c){var d="";if(b=="menu")d="_menu";else if(b=="menubutton")d="_menubutton";d+=a.readAttribute("colorname")?"_color":"";d+=a.readAttribute("emo_id")?"_emo":"";a.writeAttribute("mode",c);try{switch(c){case"normal":a.addClassName("rte_normal"+d).removeClassName("rte_hover").removeClassName("rte_selected");break;case"hover":a.addClassName("rte_hover"+d).removeClassName("rte_normal").removeClassName("rte_selected");break;case"selected":;case"down":a.addClassName("rte_selected"+d).removeClassName("rte_normal").removeClassName("rte_hover");break}}catch(e){Debug.write("#6 "+e)}}},set_control_unselectable:function(a){if($(a)){$(a).descendants().each(function(b){b.writeAttribute("unselectable","on")});$(a).writeAttribute("unselectable","on")}},init_editor_button:function(a){a.writeAttribute("cmd",a.id.replace(this.id+"_cmd_",""));a.writeAttribute("editor_id",this.id);this.items.buttons[a.readAttribute("cmd")]=a;a.writeAttribute("state",false);a.writeAttribute("mode","normal");a.writeAttribute("real_type","button");a.observe("click",this.events.button_onmouse_event.bindAsEventListener(this));a.observe("mousedown",this.events.button_onmouse_event.bindAsEventListener(this));a.observe("mouseover",this.events.button_onmouse_event.bindAsEventListener(this));a.observe("mouseout",this.events.button_onmouse_event.bindAsEventListener(this))},init_editor_menu:function(a){a.writeAttribute("cmd",a.id.replace(this.id+"_cmd_",""));a.writeAttribute("editor_id",this.id);this.items.buttons[a.readAttribute("cmd")]=a;var b=new Element("ul",{id:this.id+"_popup_"+a.readAttribute("cmd")+"_menu"});b.writeAttribute("cmd",a.readAttribute("cmd")).addClassName("ipbmenu_content");b.hide();if(a.hasClassName("rte_font")){this.fontoptions._default=a.innerHTML;ipb.editor_values.get("primary_fonts").each(function(d){var e=new Element("li",{id:this.id+"_fontoption_"+d.key});e.setStyle('font-family: "'+d.value+'"; cursor: pointer').addClassName("fontitem");e.update(d.value);$(e).observe("click",this.events.font_format_option_onclick.bindAsEventListener(this));b.insert(e);this.fontoptions[d.key]=e}.bind(this));a.insert({after:b})}else if(a.hasClassName("rte_fontsize")){this.sizeoptions._default=a.innerHTML;ipb.editor_values.get("font_sizes").each(function(d){var e=new Element("li",{id:this.id+"_sizeoption_"+d});e.setStyle("font-size: "+this.convert_size(d,1)+"px; cursor: pointer").addClassName("fontitem");e.update(d);$(e).observe("click",this.events.font_format_option_onclick.bindAsEventListener(this));b.insert(e);b.addClassName("fontsizes");this.sizeoptions.push(d)}.bind(this));a.insert({after:b})}else a.hasClassName("rte_special")&&a.insert({after:b});var c=function(){this.editor_check_focus();this.preserve_ie_range();Debug.write("Preserved IE Range")}.bind(this);new ipb.Menu($(a),b,{},{beforeOpen:c})},init_editor_palette:function(a){a.writeAttribute("cmd",a.id.replace(this.id+"_cmd_",""));a.writeAttribute("editor_id",this.id);this.items.buttons[a.readAttribute("cmd")]=a;wrap=new Element("div",{id:this.id+"_palette_"+a.readAttribute("cmd")});wrap.writeAttribute("cmd",a.readAttribute("cmd")).addClassName("ipb_palette");wrap.hide();opt={};switch(a.readAttribute("cmd")){case"forecolor":;case"backcolor":var b=(new Element("table",{id:this.id+"_"+a.readAttribute("cmd")+"_palette"})).addClassName("rte_colors"),c=new Element("tbody");b.insert(c);var d=null,e=null,f="";for(i=0;i<ipb.editor_values.get("colors").length;i++){f=ipb.editor_values.get("colors")[i];if(i%ipb.editor_values.get("colors_perrow")==0){d=new Element("tr");c.insert(d)}e=new Element("td",{id:this.id+"_"+a.readAttribute("cmd")+"_color_"+f});e.setStyle("background-color: #"+f).writeAttribute("colorname",f);d.insert(e);$(e).observe("click",this.events.color_cell_onclick.bindAsEventListener(this))}wrap.insert(b).addClassName("color_palette");a.insert({after:wrap});break;case"link":;case"image":;case"email":;case"media":if(Object.isUndefined(ipb.editor_values.get("templates")[a.readAttribute("cmd")])){a.hide();return}try{wrap.update(ipb.editor_values.get("templates")[a.readAttribute("cmd")].evaluate({id:this.id}));wrap.down('input[type="submit"]').observe("click",this.events.palette_submit.bindAsEventListener(this))}catch(g){Debug.write("#7 "+g)}this.doc_body.insert({top:wrap});if(a.readAttribute("cmd")=="link"){try{this.defaults.link_text=$F(this.id+"_urltext");this.defaults.link_url=$F(this.id+"_url")}catch(h){Debug.write("#8 "+h)}$(a).observe("click",this.events.link_onclick.bindAsEventListener(this))}if(a.readAttribute("cmd")=="image"){try{this.defaults.img=$F(this.id+"_img")}catch(j){Debug.write("#15 "+j)}$(a).observe("click",this.events.image_onclick.bindAsEventListener(this))}if(a.readAttribute("cmd")=="email"){try{this.defaults.email_text=$F(this.id+"_emailtext");this.defaults.email=$F(this.id+"_email")}catch(k){Debug.write("#8 "+k)}$(a).observe("click",this.events.email_onclick.bindAsEventListener(this))}if(a.readAttribute("cmd")=="media"){try{this.defaults.media=$F(this.id+"_media")}catch(l){Debug.write("#17 "+l)}$(a).observe("click",this.events.media_onclick.bindAsEventListener(this))}this.key_handlers[a.readAttribute("cmd")]=false;break;default:this.items.buttons[a.readAttribute("cmd")]=null;a.hide();wrap.remove();break}
if(a.readAttribute("title")){title=new Element("div");title.update(a.readAttribute("title")).addClassName("rte_title");wrap.insert({top:title})}a.readAttribute("cmd").endsWith("color")||(opt={stopClose:true});$(a).observe("mouseover",this.events.palette_button_onmouseover.bindAsEventListener(this));$(a).observe("mouseover",this.events.palette_onmouse_event.bindAsEventListener(this));$(a).observe("mouseout",this.events.palette_onmouse_event.bindAsEventListener(this));b=function(){this.editor_check_focus();this.preserve_ie_range();Debug.write("Preserved IE Range")}.bind(this);this.palettes[a.readAttribute("cmd")]=new ipb.Menu($(a),wrap,opt,{beforeOpen:b})},convert_size:function(a,b){if(b==1)switch(a){case 1:return 9;case 2:return 13;case 3:return 15;case 4:return 17;case 5:return 21;case 6:return 26;case 7:return 36;default:return 13}else switch(a){case"7.5pt":;case"9px":return 1;case"13px":return 2;case"15px":return 3;case"17px":return 4;case"21px":return 5;case"26px":return 6;case"36px":return 7;default:return""}},format_text:function(a,b,c){b.startsWith("resize_");if(b=="switcheditor")try{ipb.switchEditor(this.id)}catch(d){Debug.error("#9 "+d)}!this.is_rte&&b!="redo"&&this.history_record_state(this.editor_get_contents());this.editor_check_focus();if(this[b])var e=this[b](a);else try{e=this.apply_formatting(b,false,typeof c=="undefined"?true:c)}catch(f){Debug.warn("#10 "+f);e=false}!this.is_rte&&b!="undo"&&this.history_record_state(this.editor_get_contents());this.set_context(b);this.editor_check_focus();return e},spellcheck:function(){if(Prototype.Browser.IE)try{this.rte_mode?(new ActiveXObject("ieSpell.ieSpellExtension")).CheckDocumentNode(this.editor_document):(new ActiveXObject("ieSpell.ieSpellExtension")).CheckAllLinkedDocuments(this.editor_document)}catch(a){if(a.number==-2146827859){if(confirm(ipb.lang.js_rte_erroriespell?ipb.lang.js_rte_erroriespell:"ieSpell not detected.  Click Ok to go to download page."))window.open("http://www.iespell.com/download.php","Download")}else alert(ipb.lang.js_rte_errorloadingiespell?ipb.lang.js_rte_errorloadingiespell:"Error Loading ieSpell: Exception "+a.number)}},wrap_tags:function(a,b,c){var d=a;if(!this.use_bbcode)switch(a){case"url":a="a href";d="a";break;case"email":a="a href";d="a";b="mailto:"+b;break;case"img":a="img src";d="";break;case"font":a="font face";d="font";break;case"size":a="font size";d="font";break;case"color":a="font color";d="font";break;case"background":a="font bgcolor";d="font";break;case"indent":a=d="blockquote";break;case"left":;case"right":;case"center":b=a;a="div align";d="div";break}if(Object.isUndefined(c)){c=this.get_selection();c=c===false?"":new String(c)}if(b===true)if(b=prompt(ips_language_arrayp.js_rte_optionals?ips_language_arrayp.js_rte_optionals:"Enter the optional arguments for this tag",""))a=this.open_brace+a+'="'+b+'"'+this.close_brace;else return false;else a=b!==false?this.open_brace+a+'="'+b+'"'+this.close_brace:this.open_brace+a+this.close_brace;this.insert_text(a+c+(d!=""?this.open_brace+"/"+d+this.close_brace:""));return false},wrap_tags_lite:function(a,b,c){selected_text="";if(Object.isUndefined(c)||c==0){selected_text=this.get_selection();selected_text=selected_text===false?"":new String(selected_text)}this.insert_text(a+selected_text+b);return false},preserve_ie_range:function(){if(Prototype.Browser.IE&&document.selection)this._ie_cache=this.is_rte?this.editor_document.selection.createRange():document.selection.createRange()},clean_html:function(a){if(a.blank()||Object.isUndefined(a))return a;a=a.replace(/<br>/ig,"<br />");a=a.replace(/<p>(\s+?)?<\/p>/ig,"");a=a.replace(/<p><hr \/><\/p>/ig,"<hr />");a=a.replace(/<p>&nbsp;<\/p><hr \/><p>&nbsp;<\/p>/ig,"<hr />");a=a.replace(/<(p|div)([^&]*)>/ig,"\n<$1$2>\n");a=a.replace(/<\/(p|div)([^&]*)>/ig,"\n</$1$2>\n");a=a.replace(/<br \/>(?!<\/td)/ig,"<br />\n");a=a.replace(/<\/(td|tr|tbody|table)>/ig,"</$1>\n");a=a.replace(/<(tr|tbody|table(.+?)?)>/ig,"<$1>\n");a=a.replace(/<(td(.+?)?)>/ig,"\t<$1>");a=a.replace(/<p>&nbsp;<\/p>/ig,"<br />");a=a.replace(/<br \/>/ig,"<br />\n");a=a.replace(/<br>/ig,"<br />\n");a=a.replace(/<td><br \/>\n<\/td>/ig,"<td><br /></td>");a=a.replace(/<script/g,"&lt;script");a=a.replace(/<\/script>/g,"&lt;/script&gt;");a=a.replace(/^[\s\n\t]+/g,"");a=a.replace(/[\s\n\t]+$/g,"");return a=a.replace(/<br \/>$/g,"")},strip_empty_html:function(a){return a=a.replace("<([^>]+?)></([^>]+?)>","")},strip_html:function(a){return a=a.replace(/<\/?([^>]+?)>/ig,"")},history_record_state:function(a){if(this.history_recordings[this.history_pointer]!=a){this.history_pointer++;this.history_recordings[this.history_pointer]=a;Object.isUndefined(this.history_recordings[this.history_pointer+1])||(this.history_recordings[this.history_pointer+1]=null)}},unhtmlspecialchars:function(a){a=a.replace(/&quot;/g,'"');a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">");return a=a.replace(/&amp;/g,"&")},htmlspecialchars:function(a){a=a.replace(/&/g,"&amp;");a=a.replace(/"/g,"&quot;");a=a.replace(/</g,"&lt;");return a=a.replace(/>/g,"&gt;")},history_time_shift:function(a){var b=this.history_pointer+a;if(b>=0&&this.history_recordings[b]!=null&&typeof this.history_recordings[b]!="undefined")this.history_pointer+=a},history_fetch_recording:function(){return!Object.isUndefined(this.history_recordings[this.history_pointer])&&this.history_recordings[this.history_pointer]!=null?this.history_recordings[this.history_pointer]:false},ipb_quote:function(){this.wrap_tags_lite("[quote]","[/quote]",0)},ipb_code:function(){this.wrap_tags_lite("[code]","[/code]",0)},toggleEmoticons:function(){if(this.showing_sidebar){$(this.id+"_sidebar").hide();$("editor_"+this.id).removeClassName("with_sidebar");ipb.Cookie.set("emoticon_sidebar",0,0);this.showing_sidebar=false}else{this.emoticons_loaded?$(this.id+"_emoticon_holder").show():this.buildEmoticons();$(this.id+"_sidebar").show();$("editor_"+this.id).addClassName("with_sidebar");ipb.Cookie.set("emoticon_sidebar",1,1);this.showing_sidebar=true}},buildEmoticons:function(){var a=(new Element("table",{id:this.id+"_emoticons_palette"})).addClassName("rte_emoticons"),b=new Element("tbody");a.insert(b);var c="1",d=0;ipb.editor_values.get("emoticons").each(function(e){if(d%2==0){tr=(new Element("tr")).addClassName("row"+c);b.insert(tr);c=c=="1"?"2":"1"}d++;var f=e.value.split(","),g=new Element("img",{id:"smid_"+f[0],src:ipb.vars.emoticon_url+"/"+f[1]});td=(new Element("td",{id:this.id+"_emoticons_emote_"+f[0]})).setStyle("cursor: pointer; text-align: center").addClassName("emote");td.writeAttribute("emo_id",f[0]);td.writeAttribute("emo_img",f[1]);td.writeAttribute("emo_code",e.key);td.insert(g);tr.insert(td);$(td).observe("click",this.events.emoticon_onclick.bindAsEventListener(this))}.bind(this));$(this.id+"_emoticon_holder").update(a).show();this.emoticons_loaded=true;$(this.id+"_showall_emoticons")&&$(this.id+"_showall_emoticons").observe("click",this.showAllEmoticons.bindAsEventListener(this));$(this.id+"_close_sidebar")&&$(this.id+"_close_sidebar").observe("click",this.toggleEmoticons.bindAsEventListener(this))},showAllEmoticons:function(){var a=Object.isUndefined(inACP)||inACP==false?ipb.vars.base_url:ipb.vars.front_url;a+="app=forums&amp;module=ajax&amp;section=emoticons&amp;editor_id="+this.id+"&amp;secure_key="+ipb.vars.secure_hash;new Ajax.Request(a.replace(/&amp;/g,"&"),{method:"get",onSuccess:function(b){$(this.id+"_emoticon_holder").update(b.responseText);if($(this.id+"_showall_bar")){$(this.id+"_showall_bar").hide();$(this.id+"_emoticon_holder").addClassName("no_bar")}}.bind(this)})}});if((Prototype.Browser.Gecko||Prototype.Browser.WebKit)&&USE_RTE){_editor.prototype.editor.prototype.ORIGINAL_editor_set_content=_editor.prototype.editor.prototype.editor_set_content;_editor.prototype.editor.prototype.ORIGINAL_apply_formatting=_editor.prototype.editor.prototype.apply_formatting;Debug.write("Adding mozilla-specific methods");_editor.prototype.editor.addMethods({_moz_test:function(){return"Test: "+this.id},togglesource_pre_show_html:function(){this.editor_document.designMode="off"},togglesource_post_show_html:function(){this.editor_document.designMode="on"},editor_set_content:function(a){this.ORIGINAL_editor_set_content(a);Event.observe(this.editor_document,"keypress",this.events.editor_document_onkeypress.bindAsEventListener(this));if($(this.id+"_cmd_spellcheck")){$(this.id+"_cmd_spellcheck").hide();this.hidden_objects[this.id+"_cmd_spellcheck"]=1}if(this.use_bbcode&&$(this.id+"_cmd_justifyfull")){$(this.id+"_cmd_justifyfull").hide();this.hidden_objects[this.id+"_cmd_justifyfull"]=1}try{var b=parseInt(window.pageYOffset);this.editor_document.execCommand("inserthtml",false," ");this.editor_document.execCommand("undo",false,null);scroll(0,b)}catch(c){Debug.write("#11 "+c)}},editor_set_functions:function(){Event.observe(this.editor_document,"mouseup",this.events.editor_document_onmouseup.bindAsEventListener(this));Event.observe(this.editor_document,"keyup",this.events.editor_document_onkeyup.bindAsEventListener(this));Event.observe(this.editor_document,"keydown",this.events.editor_document_onkeydown.bindAsEventListener(this));Event.observe(this.editor_window,"focus",this.events.editor_window_onfocus.bindAsEventListener(this));Event.observe(this.editor_window,"blur",this.events.editor_window_onblur.bindAsEventListener(this))},apply_formatting:function(a,b,c){if(a!="redo"){this.editor_document.execCommand("inserthtml",false," ");this.editor_document.execCommand("undo",false,null)}this.editor_document.execCommand("useCSS",false,true);this.editor_document.execCommand("styleWithCSS",false,false);return this.ORIGINAL_apply_formatting(a,b,c)},get_selection:function(){var a=this.editor_window.getSelection();this.editor_check_focus();return this.moz_read_nodes((a?a.getRangeAt(0):this.editor_document.createRange()).cloneContents(),false)},moz_add_range:function(a,b){this.editor_check_focus();var c=this.editor_window.getSelection(),d=this.editor_document.createRange();d.selectNodeContents(a);if(b){d.setEnd(a,b);d.setStart(a,b)}c.removeAllRanges();c.addRange(d)},moz_read_nodes:function(a,b){var c="",d=/_moz/i;switch(a.nodeType){case Node.ELEMENT_NODE:;case Node.DOCUMENT_FRAGMENT_NODE:var e;if(b){e=!a.hasChildNodes();c="<"+a.tagName.toLowerCase();for(var f=a.attributes,g=0;g<f.length;++g){var h=f.item(g);!h.specified||h.name.match(d)||h.value.match(d)||(c+=" "+h.name.toLowerCase()+'="'+h.value+'"')}c+=e?" />":">"}for(g=a.firstChild;g;g=g.nextSibling)c+=this.moz_read_nodes(g,true);if(b&&!e)c+="</"+a.tagName.toLowerCase()+">";break;case Node.TEXT_NODE:c=this.htmlspecialchars(a.data);break}
return c},moz_goto_parent_then_body:function(a){for(var b=a;a.parentNode!=null&&a.parentNode.nodeName=="HTML";)a=a.parentNode;if(a)for(var c=0;c<a.childNodes.length;c++)if(a.childNodes[c].nodeName=="BODY")return a.childNodes[c];return b},moz_insert_node_at_selection:function(a,b){this.editor_check_focus();var c=this.editor_window.getSelection(),d=c?c.getRangeAt(0):this.editor_document.createRange();c.removeAllRanges();d.deleteContents();var e=d.startContainer;d=d.startOffset;b=b?b:0;if(e.nodeName=="HTML")e=this.moz_goto_parent_then_body(e);switch(e.nodeType){case Node.ELEMENT_NODE:f=a.nodeType==Node.DOCUMENT_FRAGMENT_NODE?a.firstChild:a;e.insertBefore(a,e.childNodes[d]);this.moz_add_range(f,b);break;case Node.TEXT_NODE:if(a.nodeType==Node.TEXT_NODE){b=d+a.length;e.insertData(d,a.data);d=this.editor_document.createRange();d.setEnd(e,b);d.setStart(e,b);c.addRange(d)}else{e=e.splitText(d);var f;f=a.nodeType==Node.DOCUMENT_FRAGMENT_NODE?a.firstChild:a;e.parentNode.insertBefore(a,e);this.moz_add_range(f,b)}break}
c.removeAllRanges()},insert_text:function(a,b){fragment=this.editor_document.createDocumentFragment();holder=this.editor_document.createElement("span");for(holder.innerHTML=a;holder.firstChild;)fragment.appendChild(holder.firstChild);a=parseInt(b)>0?b:0;this.moz_insert_node_at_selection(fragment,a)},insert_emoticon:function(a,b,c){this.editor_check_focus();try{var d=ipb.vars.emoticon_url+"/"+b;this.editor_document.execCommand("InsertImage",false,d);var e=this.editor_document.getElementsByTagName("img");if(e.length>0)for(a=0;a<=e.length;a++)if(!Object.isUndefined(e[a])&&e[a].src.match(new RegExp(d+"$")))if(!e[a].getAttribute("alt")){e[a].setAttribute("alt",this.unhtmlspecialchars(c));e[a].setAttribute("class","bbc_emoticon")}}catch(f){Debug.write("#12 "+f)}this.emoticon_window_id!=""&&typeof this.emoticon_window_id!="undefined"&&this.emoticon_window_id.focus()}})}if(Prototype.Browser.Opera&&USE_RTE){_editor.prototype.editor.prototype.ORIGINAL_editor_set_content=_editor.prototype.editor.prototype.editor_set_content;_editor.prototype.editor.addMethods({editor_set_content:function(a){this.ORIGINAL_editor_set_content(a);this.editor_document.body.style.height="95%";Event.observe(this.editor_document,"keypress",this.events.editor_document_onkeypress.bindAsEventListener(this));$(this.id+"_cmd_spellcheck").hide();this.hidden_objects[this.id+"_cmd_spellcheck"]=1;if(this.use_bbcode){$(this.id+"_cmd_justifyfull").hide();this.hidden_objects[this.id+"_cmd_justifyfull"]=1}try{var b=parseInt(window.pageYOffset);this.editor_document.execCommand("inserthtml",false,"-");this.editor_document.execCommand("undo",false,null);scroll(0,b)}catch(c){Debug.write("#13 "+c)}},insert_text:function(a){this.editor_document.execCommand("insertHTML",false,a)},get_selection:function(){var a=this.editor_window.getSelection();this.editor_check_focus();a=a?a.getRangeAt(0):this.editor_document.createRange();return document.implementation.createLSSerializer().writeToString(a.cloneContents())},editor_set_functions:function(){Event.observe(this.editor_document,"mouseup",this.events.editor_document_onmouseup.bindAsEventListener(this));Event.observe(this.editor_document,"keyup",this.events.editor_document_onkeyup.bindAsEventListener(this));Event.observe(this.editor_window,"focus",this.events.editor_window_onfocus.bindAsEventListener(this));Event.observe(this.editor_window,"blur",this.events.editor_window_onblur.bindAsEventListener(this))}})}_editor_events=Class.create({handle_custom_command:function(a,b){Event.stop(a);a=$(Event.element(a)).hasClassName("specialitem")?$(Event.element(a)):$(Event.element(a)).up(".specialitem");if($(a)){b=$(a).id.replace(this.id+"_cmd_custom_","");var c=this.values.get("bbcodes").get(b);Debug.write(b);if(c.single_tag=="1"&&c.useoption=="0"){this.wrap_tags_lite("["+c.tag+"]","",1);ipb.menus.registered.get(this.id+"_cmd_otherstyles").doClose()}else{var d=this.get_selection();try{window.setTimeout(function(){if(c.useoption=="1"&&c.single_tag=="1")$(this.id+"_"+b+"_option")&&$(this.id+"_"+b+"_option").focus();else{if(d)$(this.id+"_"+b+"_text").value=d;$(this.id+"_"+b+"_option")?$(this.id+"_"+b+"_option").focus():$(this.id+"_"+b+"_text").activate()}}.bind(this),200)}catch(e){Debug.write(e)}}}},handle_custom_onclick:function(a){Debug.write("Here 5");var b=Event.element(a);b.hasClassName("ipb_palette")||(b=Event.findElement(a,".ipb_palette"));a=b.readAttribute("styleid");if(!(!a||Object.isUndefined(this.values.get("bbcodes").get(a)))){b=this.values.get("bbcodes").get(a);Debug.write("Here 4");if(b.useoption=="1"&&b.optional_option=="0"&&$F(this.id+"_"+a+"_option").blank()){alert(ipb.lang.option_is_empty);try{$(this.id+"_"+a+"_option").focus()}catch(c){}}else{Debug.write("Here 3");if(b.useoption=="1"&&b.single_tag=="1"){var d=$F(this.id+"_"+a+"_option");b.optional_option=="1"&&d.blank()?this.wrap_tags_lite("["+b.tag+"]","",1):this.wrap_tags_lite("["+b.tag+"='"+d+"']","",1)}else{Debug.write("Here 1");var e=$F(this.id+"_"+a+"_text");Debug.write("Here 2");d=$(this.id+"_"+a+"_option")?$F(this.id+"_"+a+"_option"):"";b.optional_option=="1"&&d.blank()||b.useoption=="0"?this.wrap_tags_lite("["+b.tag+"]"+e,"[/"+b.tag+"]",1):this.wrap_tags_lite("["+b.tag+"='"+d+"']"+e,"[/"+b.tag+"]",1)}this.palettes["otherstyles_"+a].doClose()}}},editor_document_onmouseup:function(){Debug.write("Mouse up");ipb.menus.closeAll();this.set_context()},editor_document_onkeyup:function(){this.set_context()},editor_document_onkeydown:function(a){if(this.forum_fix_ie_newlines&&Prototype.Browser.IE&&a.keyCode==Event.KEY_RETURN){a=["Indent","Outdent","JustifyLeft","JustifyCenter","JustifyRight","InsertOrderedList","InsertUnorderedList"];for(i=0;i<a.length;i++)if(this.editor_document.queryCommandState(a[i]))return true;a=this.editor_document.selection;var b=this.editor_document.selection.createRange(),c=b.htmlText.replace(/<p([^>]*)>(.*)<\/p>/i,"$2");if(a.type=="Text"||a.type=="None")b.pasteHTML("<br />"+c+"\n");else this.editor_document.innerHTML+="<br />\n";this.editor_window.event.returnValue=false;b.select();this.editor_check_focus()}},editor_document_onkeypress:function(a){if(a.ctrlKey){switch(String.fromCharCode(a.charCode).toLowerCase()){case"b":cmd="bold";break;case"i":cmd="italic";break;case"u":cmd="underline";break;default:return}
Event.stop(a);this.apply_formatting(cmd,false,null);return false}},editor_window_onfocus:function(){this.has_focus=true},editor_window_onblur:function(){this.has_focus=false},button_onmouse_event:function(a){elem=Event.element(a).hasClassName("rte_control")?Event.element(a):$(Event.element(a)).up(".rte_control");Debug.write(elem.readAttribute("cmd"));if(a.type=="click")if(elem.readAttribute("cmd").startsWith("custom_"))return;else if(elem.readAttribute("cmd")=="help"){window.open(ipb.vars.base_url+"&app=forums&module=extras&section=legends&do=bbcode","bbcode","status=0,toolbar=0,width=1024,height=800,scrollbars=1");Event.stop(a);return false}else if(elem.readAttribute("cmd").startsWith("r_")){var b=$(this.id+"_textarea").getHeight();elem.readAttribute("cmd")=="r_small"?this.resize_to(b-100):this.resize_to(b+100)}else elem.readAttribute("cmd")=="emoticons"?this.toggleEmoticons(a):this.format_text(a,elem.readAttribute("cmd"),false,true);Event.stop(a);this.set_button_context(elem,a.type)},font_format_option_onclick:function(a){elem=Event.element(a).hasClassName("fontitem")?Event.element(a):Event.element(a).up(".fontitem");cmd=$(elem).up(".ipbmenu_content").readAttribute("cmd");this.format_text(a,cmd,elem.innerHTML)},color_cell_onclick:function(a){elem=Event.element(a);cmd=$(elem).up(".ipb_palette").readAttribute("cmd");this.format_text(a,cmd,"#"+elem.readAttribute("colorname"));this.palettes[cmd].doClose()},palette_button_onmouseover:function(a){elem=Event.element(a).hasClassName("rte_palette")?Event.element(a):$(Event.element(a)).up(".rte_palette");elem.setStyle("cursor: pointer;")},palette_onmouse_event:function(a){elem=Event.element(a).hasClassName("rte_control")?Event.element(a):$(Event.element(a)).up(".rte_control");a.type=="mouseover"?$(elem).addClassName("rte_hover"):$(elem).removeClassName("rte_hover")},palette_return_key:function(){},palette_submit:function(a){elem=Event.element(a);if(palette=elem.up(".ipb_palette")){cmd=palette.readAttribute("cmd");Debug.write($(elem).id+" "+$(palette).id+" "+cmd);switch(cmd){case"link":var b=$F(this.id+"_url");a=$F(this.id+"_urltext");if(b=="http://"||b.blank())return;if(a.blank())a=b;this.wrap_tags("url",b,a);break;case"image":a=$F(this.id+"_img");if(a=="http://"||a.blank())return;this.is_rte?this.wrap_tags("img",a,""):this.wrap_tags("img",false,a);break;case"email":b=$F(this.id+"_email");a=$F(this.id+"_emailtext");if(b.blank()||b.indexOf("@")==-1)return;if(a.blank())a=b;this.wrap_tags("email",b,a);break;case"media":b=$F(this.id+"_media");if(b.blank())return;this.is_rte?this.wrap_tags_lite("[media]"+b,"[/media]"):this.wrap_tags("media",false,b);break}
this.palettes[cmd].doClose()}},emoticon_onclick:function(a){Event.stop(a);var b=Event.element(a).up(".emote");if(!b)return false;this.insert_emoticon(b.readAttribute("emo_id"),b.readAttribute("emo_img"),b.readAttribute("emo_code"),a)},link_onclick:function(){var a=this.get_selection(),b=null;try{if(a){Debug.write("**selection: "+a);if(a.match(/<img/)||a.match(/\[img\]/)){this.is_rte||(a=a.gsub(/<img src=['"]([^'"]+?)['"]\s+?\/>/,function(d){return"[img]"+d[1]+"[/img]"}));$(this.id+"_url").value=this.defaults.link_url;$(this.id+"_urltext").value=a}else if(a.match(/[A-Za-z]+:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/)){$(this.id+"_url").value=a.strip();$(this.id+"_urltext").value=this.defaults.link_text;b=$(this.id+"_urltext")}else{$(this.id+"_urltext").value=a.strip();$(this.id+"_url").value=this.defaults.link_url;b=$(this.id+"_url")}}else{$(this.id+"_urltext").value=this.defaults.link_text;$(this.id+"_url").value=this.defaults.link_url;b=$(this.id+"_url")}if(!this.key_handlers.url){$(this.id+"_url").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));$(this.id+"_urltext").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));this.key_handlers.url=true}window.setTimeout(function(){$(b).activate()}.bind(this),200)}catch(c){Debug.write("#13 "+c)}},image_onclick:function(){var a=this.get_selection();a=a&&!a.startsWith("<IMG")?a:this.defaults.img;try{$(this.id+"_img").value=a;if(!this.key_handlers.image){$(this.id+"_img").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));this.key_handlers.image=true}window.setTimeout(function(){$(this.id+"_img").activate()}.bind(this),200)}catch(b){Debug.write("#14 "+b)}},media_onclick:function(){var a=this.get_selection();a=a?a:this.defaults.media;try{$(this.id+"_media").value=a;if(!this.key_handlers.media){$(this.id+"_media").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));this.key_handlers.media=true}window.setTimeout(function(){$(this.id+"_media").activate()}.bind(this),200)}catch(b){Debug.write("#18 "+b)}},email_onclick:function(){var a=this.get_selection(),b=$(this.id+"_email");try{if(a)if(a.match(/([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+/)){$(this.id+"_email").value=a.strip();$(this.id+"_emailtext").value=this.defaults.email_text;b=$(this.id+"_emailtext")}else{$(this.id+"_emailtext").value=a.strip();$(this.id+"_email").value=this.defaults.email}else{$(this.id+"_emailtext").value=this.defaults.email_text;$(this.id+"_email").value=this.defaults.email}if(!this.key_handlers.email){$(this.id+"_email").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));$(this.id+"_emailtext").observe("keypress",this.events.palette_return_key.bindAsEventListener(this));this.key_handlers.email=true}window.setTimeout(function(){$(b).activate()}.bind(this),200)}catch(c){Debug.write("#16 "+c)}},show_emoticon_sidebar:function(){var a=Object.isUndefined(inACP)||inACP==false?ipb.vars.base_url:ipb.vars.front_url;a+="app=forums&amp;module=ajax&amp;section=emoticons&amp;editor_id="+this.id;new Ajax.Request(a.replace(/&amp;/g,"&"),{method:"get",onSuccess:function(b){$("editor_"+this.id).addClassName("with_sidebar");var c=$("editor_"+this.id).down(".sidebar");c.update(this.values.get("templates").emoticon_wrapper.evaluate({id:this.id}));$(this.id+"_emoticon_holder").update(b.responseText);c.show();this.palettes.emoticons.doClose()}.bind(this)})},addEmoticon:function(a,b,c){try{this.insert_emoticon("",c,a,"")}catch(d){Debug.error(d)}}});;var _topic=window.IPBoard;_topic.prototype.topic={totalChecked:0,inSection:"",postcache:[],poll:[],pollPopups:[],init:function(){Debug.write("Initializing ips.topic.js");document.observe("dom:loaded",function(){if(ipb.topic.inSection=="topicview"){if($("show_filters")){$("show_filters").observe("click",ipb.topic.toggleFilters);$("filter_form").hide()}ipb.topic.preCheckPosts();ipb.delegate.register(".multiquote",ipb.topic.toggleMultimod);ipb.delegate.register(".delete_post",ipb.topic.confirmSingleDelete);ipb.delegate.register(".edit_post",ipb.topic.ajaxEditShow);ipb.delegate.register(".toggle_post",ipb.topic.ajaxTogglePostApprove);ipb.delegate.register("input.post_mod",ipb.topic.checkPost);ipb.delegate.register('a[rel="bookmark"]',ipb.topic.showLinkToTopic)}});Event.observe(window,"load",function(){$$(".post",".poll").each(function(a){ipb.global.findImgs($(a))})})},submitPostModeration:function(a){if($F("tact")=="delete")confirm(ipb.lang.delete_confirm)||Event.stop(a)},submitTopicModeration:function(a){if($F("topic_moderation")=="03")confirm(ipb.lang.delete_confirm)||Event.stop(a)},ajaxTogglePostApprove:function(a,c){Event.stop(a);var b=c.id.replace(/toggle(text)?_post_/,"");if(b){var d=$("post_id_"+b).hasClassName("moderated")?1:0;new Ajax.Request(ipb.vars.base_url+"app=forums&module=ajax&section=topics&do=postApproveToggle&p="+b+"&t="+ipb.topic.topic_id+"&f="+ipb.topic.forum_id+"&approve="+d,{method:"post",evalJSON:"force",parameters:{md5check:ipb.vars.secure_hash},onSuccess:function(e){if(e.responseJSON.error)switch(e.responseJSON.error){case"notopic":alert(ipb.lang.no_permission);break;case"nopermission":alert(ipb.lang.no_permission);break}else if(d){$("post_id_"+b).removeClassName("moderated");$("toggletext_post_"+b).update(ipb.lang.unapprove)}else{$("post_id_"+b).addClassName("moderated");$("toggletext_post_"+b).update(ipb.lang.approve)}}})}},ajaxEditShow:function(a,c){if(a.ctrlKey==true||a.metaKey==true||a.keyCode==91)return false;Event.stop(a);var b=[];b.button=c;if(b.button){if(b.button.readAttribute("_editing")=="1")return false;b.pid=b.button.id.replace("edit_post_","");b.tid=ipb.topic.topic_id;b.fid=ipb.topic.forum_id;b.post=$("post_id_"+b.pid).down(".post");ipb.topic.postcache[b.pid]=b.post.innerHTML;url=ipb.vars.base_url+"app=forums&module=ajax&section=topics&do=editBoxShow&p="+b.pid+"&t="+b.tid+"&f="+b.fid;if(Prototype.Browser.IE7)window.location="#entry"+b.pid;else new Effect.ScrollTo(b.post,{offset:-50});new Ajax.Request(url,{method:"post",parameters:{md5check:ipb.vars.secure_hash},onSuccess:function(d){if(d.responseText=="nopermission"||d.responseText=="NO_POST_FORUM"||d.responseText=="NO_EDIT_PERMS")alert(ipb.lang.no_permission);else if(d.responseText=="error")alert(ipb.lang.action_failed);else{b.button.writeAttribute("_editing","1");b.post.update(d.responseText);b.pid="e"+b.pid;ipb.editors[b.pid]=new ipb.editor(b.pid,USE_RTE);$("edit_save_"+b.pid)&&$("edit_save_"+b.pid).observe("click",ipb.topic.ajaxEditSave);$("edit_switch_"+b.pid)&&$("edit_switch_"+b.pid).observe("click",ipb.topic.ajaxEditSwitch);$("edit_cancel_"+b.pid)&&$("edit_cancel_"+b.pid).observe("click",ipb.topic.ajaxEditCancel)}}});Debug.write(url)}},ajaxEditSwitch:function(a){Event.stop(a);if(a=Event.element(a).id.replace("edit_switch_e","")){var c=ipb.vars.base_url+"app=forums&module=post&section=post&do=edit_post&f="+ipb.topic.forum_id+"&t="+ipb.topic.topic_id+"&p="+a+"&st="+ipb.topic.start_id+"&_from=quickedit";try{ipb.editors["e"+a].update_for_form_submit();var b=$F("e"+a+"_textarea")}catch(d){Debug.error(d);return}form=new Element("form",{action:c,method:"post"});textarea=new Element("textarea",{name:"Post"});reason=new Element("input",{name:"post_edit_reason"});md5check=new Element("input",{type:"hidden",name:"md5check",value:ipb.vars.secure_hash});textarea.value=Prototype.Browser.Opera?b:b.replace(/&/g,"&amp;");reason.value=$("post_edit_reason")?$("post_edit_reason").value:"";form.insert(md5check).insert(textarea).insert(reason).hide();$$("body")[0].insert(form);form.submit()}},ajaxEditSave:function(a){Event.stop(a);var c=Event.element(a).id.replace("edit_save_e","");if(c){try{ipb.editors["e"+c].update_for_form_submit();var b=$F("e"+c+"_textarea")}catch(d){Debug.error(d);Debug.dir(ipb.editors);return}if(b.blank())alert(ipb.lang.post_empty);else{a=null;var e="",g="";if($("add_edit"))a=$F("add_edit");if($("post_edit_reason"))e=$F("post_edit_reason");if($("post_htmlstatus"))g=$F("post_htmlstatus");new Ajax.Request(ipb.vars.base_url+"app=forums&module=ajax&section=topics&do=editBoxSave&p="+c+"&t="+ipb.topic.topic_id+"&f="+ipb.topic.forum_id,{method:"post",evalJSON:"force",encoding:ipb.vars.charset,parameters:{md5check:ipb.vars.secure_hash,Post:b.encodeParam(),add_edit:a,post_edit_reason:e.encodeParam(),post_htmlstatus:g},onSuccess:function(f){if(f.responseJSON.error){if($("error_msg_e"+c)){$("error_msg_e"+c).update(f.responseJSON.error);new Effect.BlindDown($("error_msg_e"+c),{duration:0.4})}else alert(f.responseJSON.error);return false}else{$("edit_post_"+c).writeAttribute("_editing","0");$("post_id_"+c).down(".post").update(f.responseJSON.successString);ipb.global.findImgs($("post_id_"+c).down(".post"));prettyPrint()}}})}}},ajaxEditCancel:function(a){Event.stop(a);if(a=Event.element(a).id.replace("edit_cancel_e",""))if(ipb.topic.postcache[a]){$("post_id_"+a).down(".post").update(ipb.topic.postcache[a]);ipb.editors[a]=null;$("edit_post_"+a).writeAttribute("_editing","0")}},preCheckPosts:function(){if($("selectedpidsJS")){(pids=$F("selectedpidsJS").split(","))&&pids.each(function(a){if(!a.blank()){ipb.topic.totalChecked++;if($("checkbox_"+a))$("checkbox_"+a).checked=true}});ipb.topic.updatePostModButton()}},checkPost:function(a,c){Debug.write("Check post");remove=$A();data=$F("selectedpidsJS");pids=data!=null?data.split(",")||$A():$A();if(c.checked==true){pids.push(c.id.replace("checkbox_",""));ipb.topic.totalChecked++}else{remove.push(c.id.replace("checkbox_",""));ipb.topic.totalChecked--}pids=pids.uniq().without(remove).join(",");ipb.Cookie.set("modpids",pids,0);$F("selectedpidsJS").value=pids;ipb.topic.updatePostModButton()},updatePostModButton:function(){if($("mod_submit")){if(ipb.topic.totalChecked==0)$("mod_submit").disabled=true;else $("mod_submit").disabled=false;$("mod_submit").value=ipb.lang.with_selected.replace("{num}",ipb.topic.totalChecked)}},showLinkToTopic:function(a,c){_t=prompt(ipb.lang.copy_topic_link,$(c).readAttribute("href"));Event.stop(a)},confirmSingleDelete:function(a){confirm(ipb.lang.delete_post_confirm)||Event.stop(a)},toggleMultimod:function(a,c){Event.stop(a);try{quoted=ipb.Cookie.get("mqtids").split(",").compact()}catch(b){quoted=$A()}id=c.id.replace("multiq_","");if(c.hasClassName("selected")){c.removeClassName("selected");quoted=quoted.uniq().without(id).join(",")}else{c.addClassName("selected");quoted.push(id);quoted=quoted.uniq().join(",")}ipb.Cookie.set("mqtids",quoted,0)},toggleFilters:function(){if($("filter_form")){Effect.toggle($("filter_form"),"blind",{duration:0.2});Effect.toggle($("show_filters"),"blind",{duration:0.2})}},setPostHidden:function(a){if($("post_id_"+a).select(".post_wrap")[0]){$("post_id_"+a).select(".post_wrap")[0].hide();$("unhide_post_"+a)&&$("unhide_post_"+a).observe("click",ipb.topic.showHiddenPost)}},showHiddenPost:function(a){link=Event.findElement(a,"a");id=link.id.replace("unhide_post_","");if($("post_id_"+id).select(".post_wrap")[0]){elem=$("post_id_"+id).select(".post_wrap")[0];new Effect.Parallel([new Effect.BlindDown(elem),new Effect.Appear(elem)],{duration:0.5,afterFinish:function(){ipb.global.findImgs($(elem))}})}if($("post_id_"+id).select(".post_ignore")[0]){ignoreElem=$("post_id_"+id).select(".post_ignore")[0];ignoreElem.hide()}Event.stop(a)},scrollToPost:function(a){a&&Object.isNumber(a)&&$("entry"+a).scrollTo()},showVoters:function(a,c,b){Event.stop(a);if(ipb.topic.poll[c]&&ipb.topic.poll[c][b]){a=ipb.templates.poll_voters.evaluate({title:ipb.topic.poll[c][b].name,content:ipb.topic.poll[c][b].users});ipb.topic.pollPopups[c+"_"+b]=new ipb.Popup("b_voters_"+c+"_"+b,{type:"balloon",initial:a,stem:true,hideAtStart:false,attach:{target:$("l_voters_"+c+"_"+b),position:"auto",event:"click"},w:"500px"})}}};ipb.topic.init();;ipb.lang['blog_revert_header']="Are you sure you want to revert your header?";ipb.lang['idm_msg_email']="You did not enter an email address to send the email to";ipb.lang['idm_invalid_file']="Invalid File";ipb.lang['idm_msg_text']="You did not enter any text to email to the user";ipb.lang['fail_config']="Failed to save configuration";ipb.lang['fail_cblock']="Failed to save content block changes";ipb.lang['option_is_empty']="This tag's option cannot be left empty!";ipb.lang['js_rte_errorloadingiespell']="Error loading ieSpell. Exception: ";ipb.lang['prof_update_tooltip']="Update my status";ipb.lang['js_rte_erroriespell']="ieSpell was not detected. Click OK to go to the download page.";ipb.lang['prof_update_button']="Update";ipb.lang['prof_comment_mod']="Your comment was added, but requires approval by this member before it will be displayed";ipb.lang['prof_comment_empty']="You must enter a comment";ipb.lang['prof_comment_perm']="You do not have permission to post comments on this profile";ipb.lang['enter_unlimited_names']="Enter names";ipb.lang['save_folder']=">";ipb.lang['enter_x_names']="Enter up to [x] names";ipb.lang['invalid_folder_name']="The folder name is invalid";ipb.lang['confirm_delete']="Are you sure you want to delete this folder? ALL messages in it will be deleted. This cannot be undone!";ipb.lang['confirm_empty']="Are you sure you want to empty this folder?";ipb.lang['must_enter_name']="You must enter a name";ipb.lang['cant_delete_folder']="You can't delete a protected folder!";ipb.lang['folder_protected']="Cannot perform that action on a protected folder";ipb.lang['delete_pm_confirm']="Are you sure you wish to permanently delete this conversation?";ipb.lang['folder_not_found']="Cannot find that folder";ipb.lang['delete_pm_many_confirm']="Are you sure you wish to delete these conversations?";ipb.lang['delete_reply_confirm']="Are you sure you want to delete this reply?";ipb.lang['reached_max_folders']="You have reached the maximum number of allowed folders";ipb.lang['upload_queue']="You have attempted to queue too many files. The number of files you can queue is: ";ipb.lang['message_sent']="Message Sent";ipb.lang['pending']="Pending";ipb.lang['upload_skipped']="Upload Skipped";ipb.lang['uploading']="Uploading...";ipb.lang['upload_done']="Done (uploaded [total])";ipb.lang['upload_progress']="Uploaded [done] of [total]";ipb.lang['silly_server']="The server returned an error during upload";ipb.lang['upload_limit_hit']="Upload limit exceeded";ipb.lang['upload_no_file']="No file was selected for upload";ipb.lang['upload_failed']="This upload failed";ipb.lang['upload_too_big']="This file was too big to upload";ipb.lang['invalid_mime_type']="You aren't permitted to upload this kind of file";ipb.lang['switch_to_advanced']="Try our advanced uploader which supports multiple file uploading (modern browser required)";ipb.lang['trouble_uploading']="Trouble uploading?";ipb.lang['post_empty']="Your post is empty";ipb.lang['att_select_files']="Select files";ipb.lang['click_to_attach']="Click To Attach Files";ipb.lang['editor_enter_list']="Enter list item (or hit Cancel to finish list)";ipb.lang['poll_stats']="You may add [q] more question(s), with [c] choices per question";ipb.lang['delete_topic_confirm']="Are you sure you want to delete this topic?";ipb.lang['click_to_show_opts']="Click to configure post options";ipb.lang['unapprove']="Unapprove";ipb.lang['with_selected']="With Selected ({num})";ipb.lang['approve']="Approve";ipb.lang['poll_no_more_q']="You cannot add any more questions to this poll!";ipb.lang['poll_no_more_choices']="You cannot add any more choices to this question";ipb.lang['poll_not_enough_choices']="One or more of your questions doesn't contain enough choices. Each question must contain at least 2 choices!";ipb.lang['is_spammer']="This account has been flagged as a spam account";ipb.lang['set_as_spammer']="Are you sure you want to flag this user as a spam account?";ipb.lang['copy_topic_link']="Copy the permalink below to store the direct address to this post in your clipboard";ipb.lang['delete_post_confirm']="Are you sure you want to delete this post?";ipb.lang['vote_updated']="Vote updated!";ipb.lang['vote_success']="Vote saved!";ipb.lang['pass_too_long']="&#10007; Your password is too long (max. 32 characters)";ipb.lang['pass_too_short']="&#10007; Your password is too short (min. 3 characters)";ipb.lang['pass_doesnt_match']="&#10007; The passwords you entered don't match";ipb.lang['email_banned']="&#10007; This email address has been banned";ipb.lang['invalid_email']="&#10007; This isn't a valid address";ipb.lang['email_in_use']="&#10007; This email address is in use";ipb.lang['email_doesnt_match']="&#10007; The addresses you entered don't match";ipb.lang['invalid_chars']="&#10007; This field contains invalid characters";ipb.lang['not_available']="&#10007; This name is taken!";ipb.lang['too_long']="&#10007; The name you entered is too long";ipb.lang['idm_comment_empty']="Comment is empty";ipb.lang['too_short']="&#10007; The name you entered is too short";ipb.lang['is_required']="&#10007; This field is required";ipb.lang['available']="&#10004; Available!";ipb.lang['rtg_already']="You've already rated this entry";ipb.lang['rtg_topic_locked']="This topic is locked";ipb.lang['rtg_good']="Good";ipb.lang['rtg_awesome']="Awesome!";ipb.lang['rtg_poor']="Poor";ipb.lang['rtg_ok']="Okay";ipb.lang['rtg_nbad']="Not Bad";ipb.lang['member_no_exist']="Message Sent";ipb.lang['member_no_exist']="That member does not exist!";ipb.lang['friend_already']="This member is already on your friends list";ipb.lang['cannot_readd_friend']="You cannot re-add this friend for five minutes after removing them";ipb.lang['delete_confirm']="Are you sure you want to continue?";ipb.lang['no_permission']="You do not have permission for this action";ipb.lang['error']="Error";ipb.lang['error_security']="Security Error";ipb.lang['action_failed']="Action failed";ipb.lang['error_occured']="An error occurred";ipb.lang['loading']="Loading...";ipb.lang['post_empty_post']="Sorry, you can't submit a blank post. Please enter some text in the editor box";ipb.lang['post_empty_title']="You must enter a topic title!";ipb.lang['post_empty_username']="You must enter a username";ipb.lang['gallery_rotate_failed']="There was an error rotating the image";ipb.lang['go_to_category']="Go to this category";ipb.lang['max_notes_reached']="You cannot add any more notes to this image, because you have reached the maximum number allowed";ipb.lang['note_confirm_delete']="Are you sure you want to delete this note?";ipb.lang['note_save_empty']="Your note cannot be empty; click the Delete link for this note if you do not wish to keep it";ipb.lang['required_data_missing']="Some required data was missing";ipb.lang['note_no_permission_e']="You do not have permission to edit this note";ipb.lang['note_no_permission_a']="You do not have permission to add notes to this image";ipb.lang['note_no_permission_d']="You don't have permission to delete notes";ipb.lang['blog_cat_exists']="That category already exists";ipb.lang['blog_uncategorized']="Uncategorized";ipb.lang['quickpm_enter_subject']="Please enter a subject";ipb.lang['quickpm_msg_blank']="Your message is blank";ipb.lang['usercp_photo_upload']="You have not selected a file to upload";