/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
(function(A,B){A("[data-role=page]").live("pagecreate",function(H){A("a.scrolltop").click(function(){A.mobile.silentScroll();return false});A("[data-role='vbpagenav']").vbpagenav();A("[data-role='imagereg']").imagereg();A('[name="preview"]').siblings("a").unbind().click(function(I){A("<input>").attr({type:"hidden",id:"previewinput",name:"preview",value:"1"}).appendTo("form");A(this).closest("form").submit()});A("a.newreplylink").unbind().click(function(I){A(".qr_defaultcontainer").show();A.mobile.silentScroll(A(".qr_defaultcontainer").last().position().top);return false});A('.quickreplycontainer [name="cancel"]').siblings("a").unbind().click(function(J){var I=A(this).closest(".quickreplycontainer");if(I.hasClass("qr_defaultcontainer")){I.hide()}else{I.remove()}return false});A("a.quickreply").unbind().click(function(I){var J=A(this).attr("id").substr(3);if(!A("#qrcontainer_"+J).length){E(this,"")}return false});A("a.quickreplyquote").unbind().click(function(I){var J=A(this).attr("id").substr(5);if(!A("#qrcontainer_q_"+J).length){A.ajax({type:"POST",url:"ajax.php?do=getquotes&p="+J,data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=getquotes&p="+J,success:G,dataType:"xml",context:A(this)})}return false});function G(J){var I=A(J).find("quotes").text();if(I){E(this,I)}}function E(L,K){var M=A(L).attr("id").substr(3);var J=A(".qr_defaultcontainer").last().clone(true).attr("id","qrcontainer_"+M).removeClass("qr_defaultcontainer");J.find('input[name="p"]').val(M);var I=J.find('textarea[name="message"]');if(K.length){I.val(K)}I.data("textinput",null).textinput();J.insertAfter(A(L).closest("div.postfoot")).show();J.siblings(".quickreplycontainer").remove()}var F=/do=(postreply|postthread)/gi;if(F.test(A(this).attr("id"))&&A(".postbit").length){A(this).data("lastScroll",A(".postbit").last().position().top+A(".postbit").last().outerHeight())}A("a.tablink").unbind("click").click(function(){var I=A(this);var K=I.attr("id").substr(4);var J=I.parents("[data-role=content]").find(".page-"+K);if(!J.length){A("[data-role=page]").animationComplete(function(){A("a.tablink").removeClass("ui-btn-active");A("a.tab-"+K).not(".tablinklist").addClass("ui-btn-active");var L=A(".page-"+K);L.removeClass("hidden").show().siblings(".tabbody").addClass("hidden");L.find(".ui-listview").listview("refreshthumbs")});return true}if(I.hasClass("ui-btn-active")){return false}if(I.hasClass("tablinklist")){A("a.tablink").not(".tablinklist").removeClass("ui-btn-active")}else{I.addClass("ui-btn-active").parent().siblings("li").find("a").removeClass("ui-btn-active")}J.removeClass("hidden").show().siblings(".tabbody").addClass("hidden");J.find(".ui-listview").listview("refreshthumbs");return false});A(".navbar").each(function(){var I=A(this).siblings("div.pagetitle");if(I.length){I.after(A(this))}});A("a.dismiss").click(function(){var I=A(this).attr("id").substr(14);A.ajax({type:"POST",url:"ajax.php?do=dismissnotice",data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=dismissnotice&noticeid="+I,success:D,dataType:"xml",context:A(this)})});function D(I){var J=A(I).find("dismissed").text();A("li.navbar_notice_"+J).remove()}if(typeof FB!=="undefined"){FB.init({appId:FB_appid,status:true,cookie:true,xfbml:false});A("#fb_regloginbtn").click(function(){if(FB.getSession(true)){C()}else{FB.login(function(I){if(I.session){C()}},this.loginperms)}return false});A("#fb_reglogoutbtn").click(function(){FB.logout(C);return false});A("#facebookassociate").click(function(){A("#vb_login_username").val(A("#facebookusername").val());A("#vb_login_password").val(A("#facebookpassword").val());A("#facebookassociateform").submit();return false});A('[name="link"]').siblings("a").unbind().click(function(I){A("<input>").attr({type:"hidden",id:"linkinput",name:"link",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});A('[name="nolink"]').siblings("a").unbind().click(function(I){A("<input>").attr({type:"hidden",id:"nolinkinput",name:"nolink",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});A('[name="deny"]').siblings("a").unbind().click(function(I){A("<input>").attr({type:"hidden",id:"denyinput",name:"deny",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});function C(){var I=window.top.location.href.replace(/#.*/,"");var J=(window.top.location.search.substring(1)?"&":"?");window.top.location=I+J+"dofbredirect=1"+window.top.location.hash}}})})(jQuery,this);(function(A,B){A.widget("mobile.imagereg",A.mobile.widget,{options:{theme:null},_create:function(){var D=this.element,E=this.options,C=this;D.find("#refresh_imagereg").removeClass("hidden").click(this,this.fetch_image);D.find("#imagereg").click(this,this.fetch_image);D.ajaxError(function(H,I,G,F){alert("error in: "+G.url+" \nerror:\n"+I.responseText)})},fetch_image:function(D){var C=D.data.element;D.preventDefault();C.find("#progress_imagereg").removeClass("hidden");A.ajax({type:"POST",url:"ajax.php?do=imagereg",data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=imagereg&hash="+C.find("#hash").val(),success:D.data.handle_ajax_response,dataType:"xml",context:D.data})},handle_ajax_response:function(D){var E=this.element;E.find("#progress_imagereg").addClass("hidden");if(D){var C=A(D).find("error").text();if(C){alert(C)}else{var F=A(D).find("hash").text();if(F){E.find("#hash").val(F);E.find("#imagereg").attr("src","image.php?"+SESSIONURL+"type=hv&hash="+F)}}}}})})(jQuery);(function(A,B){A.widget("mobile.vbpagenav",A.mobile.widget,{lowpage:1,highpage:1,numberoflinks:1,height:20,navbuttonwidth:20,pagenumberwidth:20,useqmark:false,options:{theme:null,pagenumber:1,totalpages:1,address:"",address2:"",anchor:""},_create:function(){var E=this.element,I=this.options,C=this;if(I.address.search(/\?/)==-1){this.useqmark=true}else{this.useqmark=false}var F=/\\?&?(page|pagenumber)=?\d+/gi;I.address=I.address.replace(F,"");A("<div>").addClass("ui-vbpagenav-pagenumbers").appendTo(E);var G=A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page=1"+(I.anchor?"#"+I.anchor:""),role:"button"}).text("first").addClass("ui-vbpagenav-first").appendTo(E).buttonMarkup({theme:I.theme,icon:"arrow-l",iconpos:"notext",corners:false,shadow:false,iconshadow:true}).click(function(){if(I.pagenumber==1){return false}return true});this.height=parseInt(G.css("height"))+parseInt(G.css("padding-top"))+parseInt(G.css("padding-bottom"))+parseInt(G.css("border-top-width"))+parseInt(G.css("border-bottom-width"));this.navbuttonwidth=parseInt(G.css("width"))+parseInt(G.css("padding-left"))+parseInt(G.css("padding-right"))+parseInt(G.css("border-left-width"))+parseInt(G.css("border-right-width"));A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page="+I.totalpages+(I.anchor?"#"+I.anchor:""),role:"button"}).text("first").addClass("ui-vbpagenav-last").appendTo(E).buttonMarkup({theme:I.theme,icon:"arrow-r",iconpos:"notext",corners:false,shadow:false,iconshadow:true}).click(function(){if(I.pagenumber==I.totalpages){return false}return true});var H=E.find("div.ui-vbpagenav-pagenumbers");var D=A("<a>",{href:"#",role:"button"}).text("#").addClass("ui-vbpagenav-pagenumber").buttonMarkup({theme:I.theme,corners:false,inline:true,shadow:false,iconshadow:true}).addClass("ui-btn-icon-notext").appendTo(H);this.pagenumberwidth=parseInt(D.css("width"))+parseInt(D.css("padding-left"))+parseInt(D.css("padding-right"))+parseInt(D.css("border-left-width"))+parseInt(D.css("border-right-width"));D.remove();A("[data-role=page]").live("pageshow pagecreate orientationchange resize",function(){C.refresh()})},refresh:function(){var J=this.options,G=this.element,D=this;var I=G.find("div.ui-vbpagenav-pagenumbers");var C=A(document).width();this.numberoflinks=parseInt((C-this.navbuttonwidth*2)/this.pagenumberwidth)+1;this.lowpage=J.pagenumber-parseInt(this.numberoflinks*1.5)+1;if(this.lowpage<1){this.lowpage=1}this.highpage=J.pagenumber+parseInt(this.numberoflinks*1.5)+1;if(this.highpage>J.totalpages){this.highpage=J.totalpages}var F=C/2;var H=F-(J.pagenumber-this.lowpage+0.5)*this.pagenumberwidth;if(H>this.navbuttonwidth||((this.highpage-this.lowpage+1)*this.pagenumberwidth)<C-this.navbuttonwidth*2){H=this.navbuttonwidth}else{if((this.highpage-J.pagenumber+0.5)*this.pagenumberwidth+this.navbuttonwidth<F){H+=F-((this.highpage-J.pagenumber+0.5)*this.pagenumberwidth+this.navbuttonwidth)}}I.css("left",H.toString()+"px");I.empty();for(var E=this.lowpage;E<=this.highpage;E++){D._buildPagenumber(E,false)}I.live("swipeleft",function(){D.swipeleft()}).live("swiperight",function(){D.swiperight()});G.live("swipeleft",function(){D.swipeleft()}).live("swiperight",function(){D.swiperight()})},swipeleft:function(){var I=this.options,G=this.element,E=this;var H=G.find("div.ui-vbpagenav-pagenumbers");var D=A(document).width();var F,C;if((this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left>D-this.navbuttonwidth){C=this.highpage;this.highpage=this.highpage+this.numberoflinks-1;if(this.highpage>I.totalpages){this.highpage=I.totalpages}for(i=C+1;i<=this.highpage;i++){E._buildPagenumber(i,false)}F=(this.numberoflinks-2)*this.pagenumberwidth;if((this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left-F<D-this.navbuttonwidth){F=(this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left-D+this.navbuttonwidth}H.css("left",function(J,K){return(parseInt(K)-F).toString()+"px"})}},swiperight:function(){var H=this.options,E=this.element,C=this;var G=E.find("div.ui-vbpagenav-pagenumbers");var D,F;if(G.offset().left==this.navbuttonwidth){F=this.lowpage;this.lowpage=this.lowpage-this.numberoflinks+1;if(this.lowpage<1){this.lowpage=1}for(i=F-1;i>=this.lowpage;i--){C._buildPagenumber(i,true)}}D=(this.numberoflinks-2)*this.pagenumberwidth;if(G.offset().left+D>this.navbuttonwidth){D=this.navbuttonwidth-G.offset().left}G.css("left",function(I,J){if(D){return(parseInt(J)+D).toString()+"px"}return this.navbuttonwidth+"px"})},_buildPagenumber:function(F,D){var I=this.options,E=this.element,C=this;var H=E.find("div.ui-vbpagenav-pagenumbers");var G=A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page="+F+(I.anchor?"#"+I.anchor:""),role:"button"}).text(F.toString()).addClass("ui-vbpagenav-pagenumber").buttonMarkup({theme:I.theme,corners:false,inline:true,shadow:false,iconshadow:true}).addClass("ui-btn-icon-notext").live("swipeleft",function(){C.swipeleft()}).live("swiperight",function(){C.swiperight()});if(D){G.prependTo(H)}else{G.appendTo(H)}if(F==I.pagenumber){G.removeClass("ui-btn-up-d").addClass("ui-btn-up-e").click(function(){return false})}}})})(jQuery);(function(A,B){A.widget("mobile.listview",A.mobile.listview,{_itemApply:function(E,F){var C=this;F.find(".ui-li-count").addClass("ui-btn-up-"+(E.data("counttheme")||this.options.countTheme)+" ui-btn-corner-all");F.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading");F.find("p, dl").addClass("ui-li-desc");F.find("img.ui-li-thumb").each(function(){A(this).one("load",function(){C._refreshthumb(this)}).each(function(){if(this.complete){A(this).trigger("load")}});A(this).closest("li").addClass(A(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")});F.find("img.ui-li-icon").each(function(){A(this).closest("li").addClass(A(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")});var D=F.find(".ui-li-aside");if(D.length){D.each(function(G,H){A(H).prependTo(A(H).parent())})}if(A.support.cssPseudoElement||!A.nodeName(F[0],"ol")){return }},refresh:function(G){this._createSubPages();var I=this.options,F=this.element,E=this,H=F.data("dividertheme")||I.dividerTheme,C=F.children("li"),D=A.support.cssPseudoElement||!A.nodeName(F[0],"ol")?0:1;if(D){F.find(".ui-li-dec").remove()}C.attr({role:"option",tabindex:"-1"});C.first().attr("tabindex","0");C.each(function(M){var K=A(this),L="ui-li";if(!G&&K.hasClass("ui-li")){return }var J=K.find("a");if(J.length){K.buttonMarkup({wrapperEls:"div",shadow:false,corners:false,iconpos:"right",icon:K.data("icon")||"arrow-r",theme:I.theme});J.first().addClass("ui-link-inherit")}else{if(K.data("role")==="list-divider"){L+=" ui-li-divider ui-btn ui-bar-"+H;K.attr("role","heading");if(D){D=1}}else{L+=" ui-li-static ui-btn-up-"+I.theme}}if(M===0){if(I.inset){L+=" ui-corner-top";K.add(K.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").addClass("ui-corner-tl")}}else{if(M===C.length-1){if(I.inset){L+=" ui-corner-bottom";K.add(K.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").addClass("ui-corner-bl")}}}if(D&&L.indexOf("ui-li-divider")<0){K.find(".ui-link-inherit").first().addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+(D++)+". </span>")}K.addClass(L);if(!G){E._itemApply(F,K)}})},refreshthumbs:function(){var F=this.options,E=this.element,D=this,C=E.children("li");C.each(function(H){var G=A(this);G.find("img.ui-li-thumb").each(function(){D._refreshthumb(this)})})},_refreshthumb:function(C){A(C).removeAttr("width").removeAttr("height").css({width:"",height:""});if(C.width>C.height&&C.width>=80){C.height=C.height*80/C.width;C.width=80}else{if(C.width<=C.height&&C.height>=80){C.width=C.width*80/C.height;C.height=80}}if(C.width<=80){A(C).css("left",((100-C.width)/2)+"px")}if(C.height<=80){var D=C;setTimeout(function(){var E=A(D).parents(".ui-btn-inner").first().innerHeight();A(D).css("top",((E-D.height)/2)+"px")},80)}}})})(jQuery);