text: !function(e){var a=!1;e(document).ajaxStart(function(){a===!0&&xhr.abort(),a=!0}),e(document).ajaxComplete(function(){a=!1}),e(".formSubmit").on("click",function(a){a.preventDefault(),e(this).closest("form").submit()}),e(document).ajaxError(function(a,t){500==t.status&&e(".result-modal").removeClass("succ").addClass("fail").html("<p> sorry there's an Internel Server Error 500 </p>").fadeIn(400).delay(3e3).fadeOut(400)}),e("form.ajax").ajaxSubmit(),e("form.ajaxModal").ajaxSubmitWithModal(),e(".ajaxQuickSubmit").on("click",function(a){a.preventDefault(),a.stopPropagation(),e(this).ajaxQSubmit()}),e(".normalAJAX").on("click",function(a){a.preventDefault();var t=e(this),l=t.data("content"),n=t.data("url");t.ajaxRequest({url:n,data:l},function(a){a.done?e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})}),e(".reloadAJAX").on("click",function(a){a.preventDefault();var t=e(this),l=t.data("content"),n=t.data("url");t.ajaxRequest({url:n,data:l},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){location.reload(!0)},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})}),e(".ajaxQuickDeleteSkill").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("skill",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/deleteSkill",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){t.parents(".delete-wrapper").fadeOut(400,function(){e(this).remove()})},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".ajaxQuickDeleteEdTitle").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("EdTitle",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/deleteEdTitle",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){t.parents(".delete-wrapper").fadeOut(400,function(){e(this).remove()})},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".delete-reply").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("reply",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/deleteReply",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){t.parents(".delete-wrapper").fadeOut(400,function(){e(this).remove()})},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".deleteThread").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deleteThread",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/deleteThread",data:a},function(a){a.done?e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".deleteThreadFF").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deleteThread",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/deleteThreadFromForums",data:a},function(a){a.done?e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".deleteMsg").on("submit",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deleteMessages",function(){var a=t.attr("action"),l=t.serialize();t.ajaxRequest({url:a,data:l},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){e(".ticket.checked").fadeOut(400,function(){e(this).remove()})},3e3)):(e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){location.reload(!0)},3e3))})})}),e(".deleteSingleMsg").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deleteMessages",function(){var a=t.attr("data-get");t.ajaxRequest({url:"ajax/deleteMessage",data:a},function(a){a.done?e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".deleteDraft").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deleteDraft",function(){var a=t.attr("data-content");t.ajaxRequest({url:"ajax/deleteDraft",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),t.closest(".draft-modal").delay(3e3).fadeOut(400,function(){e(this).remove()})):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e("#getReceiver").on("blur",function(){var a=e(this),t=a.val();t.length>0&&a.ajaxRequest({url:"ajax/getUser",data:"id="+t},function(l){l.done?(a.next().hide(),e('<a href="profile/'+t+'" class="receiverHolder">'+l.done+'</a>&nbsp;<a class="icon-cancel" id="cancel-rec"></a>').insertAfter("#getReceiver"),a.hide(),e("#cancel-rec").on("click",function(){e(".receiverHolder").remove(),e(this).remove(),a.show()})):e(".not-found").text(l.error).show()})}),e(".buy-item").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("buyItem",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/buyItem",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){location.reload(!0)},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e(".consume-item").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("consumeItem",function(){var a=t.data("content");t.ajaxRequest({url:"ajax/consumeItem",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){location.reload(!0)},3e3)):e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})})}),e("#desactivate-acc").on("click",function(a){a.preventDefault();var t=e(this);t.ajaxConfirm("deactivateAccount",function(){var a="token="+t.attr("data-token");t.ajaxRequest({url:"ajax/deactivateUser",data:a},function(a){a.done?(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeout(function(){e(".ticket.checked").fadeOut(400,function(){e(this).remove()})},3e3)):(e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400),setTimeOut(function(){location.reload(!0)},3e3))})})}),e(".followUnfollow").on("click",function(a){a.preventDefault();var t=e(this),l=t.data("content"),n=t.attr("id");t.ajaxRequest({url:"ajax/"+n,data:l},function(a){if(a.done)if(e(".result-modal").removeClass("fail").addClass("succ").html("<p>"+a.done+"</p>").fadeIn(400).delay(3e3).fadeOut(400),"followUser"==n){var l=t.text(),o=e(".followUnfollow").attr("data-trigger");t.text(o).attr("id","unfollowUser").attr("data-trigger",l)}else{var l=t.text(),o=e(".followUnfollow").attr("data-trigger");t.text(o).attr("id","followUser").attr("data-trigger",l)}else e(".result-modal").removeClass("succ").addClass("fail").html("<p>"+a.error+"</p>").fadeIn(400).delay(3e3).fadeOut(400)})}),e(".page-swapper").on("change",function(){window.location.href=e(this).val()}),e("a.disabled").on("click",function(e){e.preventDefault()}),e(".notifications").one("click",function(){e(this).ajaxRequest({url:"ajax/seeNotifications"})}),e(".reportTrigger").on("click",function(){var a=e(this),t=e("#report-panel");e("#reported").attr("value",a.data("reported")),e("#type").attr("value",a.data("type")),t.find(".ajax-loader").empty(),t.find("textarea").removeClass("error").val("")}),e(".load-more").on("click",function(a){if(a.preventDefault(),e(this).hasClass("disabled"))return!1;var t=e(this),l=t.parents("form.more"),n=l.attr("action"),o=l.serialize(),d=l.find(".holder");l.find(".container").append('<div class="temp"><img src="img/loader.gif" /></div>'),t.ajaxRequest({url:n,data:o,dataType:"html"},function(a){l.find(".temp").remove();var t=e(a);l.find(".container").append(t).find(".temp").fadeIn().children().unwrap(),d.val(Number(d.val())+1),l.find(".no-more").length&&l.find(".load-more").addClass("disabled")})});var t=e(".checkboxTickets").size();e(".checkboxTickets").on("change",function(){if($this=e(this),$this.is(":checked")){$this.parents(".ticket").addClass("checked");var a=0;e(".checkboxTickets").each(function(){return e(this).prop("checked")?(a++,a==t&&e(".selectAll").prop("checked",!0),void 0):!1})}else $this.parents(".ticket").removeClass("checked"),e(".selectAll").prop("checked",!1)}),e(".selectAll").on("change",function(){$this=e(this),$this.is(":checked")?(e(".selectAll").prop("checked",!0),e(".checkboxTickets").each(function(){e(this).prop("checked",!0),e(".ticket").addClass("checked")})):(e(".selectAll").prop("checked",!1),e(".checkboxTickets").each(function(){e(this).prop("checked",!1),e(".ticket").removeClass("checked")}))}),e(".external").each(function(){var a=new RegExp(location.host),t=e(this);t.find("a").each(function(){a.test(e(this).attr("href"))||e(this).addClass("externalLink")})}),e(".externalLink").on("click",function(a){a.preventDefault();var t=e("#externalLink"),l=e(this).attr("href");centerPanel(t),e(".overlay").show(),t.hide().fadeIn(400),e(window).resize(function(){centerPanel(t)}),e(document).keyup(function(a){var l=a.keyCode||a.which;"27"==l&&(e(".overlay").hide(),t.hide())}),e(".overlay, .cancel").on("click",function(a){a.preventDefault(),e(".overlay").hide(),t.hide()}),t.find(".linkHolder").html(l),t.find(".theLink").attr("href",l)}),e(".attch-holder").on("submit",function(a){a.preventDefault();var t=e(this),l=t.attr("action"),n=new FormData(t[0]),o=t.find(".upload-loader");n.append("bsc_atc_current",e(".attachmentsBus").val()),o.fadeIn(400),e.ajax({url:l,type:"POST",data:n,dataType:"json",async:!0,processData:!1,contentType:!1,success:function(a){e(".att-rslt").html(""),a.succeed.length>0&&e(".succ-attch").show(),e.each(a.succeed,function(a,t){e(".succ-attch").append('<div class="attach-item">'+t.name+" <small>"+t.size+"</small></div>")}),a.failed.length>0&&e(".fail-attch").show(),e.each(a.failed,function(a,t){e(".fail-attch").append('<div class="attach-item">'+t.name+" <small>"+t.size+'</small> - <span><bdo dir="auto">'+t.error+"</bdo></span></div>")}),e(".attachmentsBus").val(a.data)},error:function(){alert("something went wrong !")},complete:function(){o.hide()}})})}(jQuery);