").attr("class","ui-ztooltip-callout").appendTo(w)),r=H(h.callout,x)):x=void 0;return w}(e);if(n){var a=void 0;o.originalEvent?a=h.callout&&!h.ajaxContent?k(o):{left:o.pageX+10,top:o.pageY+10}:((a=e.offset()).left+=e.width(),a.top+=e.height()),a=_(a,e,d),clearTimeout(l),clearTimeout(u),l=setTimeout(function(){if(e.is(":visible")||e.is("option")){if(h.ajaxContent){var t=c("
").attr("class","ui-ztooltip-content-loading");c(w).find(".ui-ztooltip-ajaxcontent").append(t),u=setTimeout(function(){c.ajax({type:"GET",url:h.ajaxContent,data:"",success:function(t){c(w).find(".ui-ztooltip-ajaxcontent").html(t)},error:function(){c(w).find(".ui-ztooltip-ajaxcontent").empty()}})})}h.timeout&&h.autohide&&(s=setTimeout(function(){F(o)},parseInt(h.timeout))),n.show(1,function(){z[i?"html":"text"](p),x.css(r),(a=O(o,n,a,e))&&n.css(a),h.calloutHideMode&&w.find(".ui-ztooltip-callout").hide()})}},f)}}(t,o),v=e,(m=o).on("click.ztooltip",function(t){F()}),o.off("mouseout.ztooltip").on("mouseout.ztooltip",function(t){h.timeout&&clearTimeout(s),a&&clearTimeout(a),a=setTimeout(function(){h.autohide&&(o.unbind("mousemove"),F(t))},200),E(o,!0)}),n._documentEle.off("mousedown.ztooltip").on("mousedown.ztooltip",function(t){h.autohide&&(o.unbind("mousemove"),F(t)),E(o,!0)}),h.mousetrack&&o.off("mousemove.ztooltip").on("mousemove.ztooltip",function(t){!function(t,o){var e=c(w),i=(e.width(),e.height(),h.callout&&!h.ajaxContent?k(t):{left:t.pageX+5,top:t.pageY+5});i=O(t,w,i,o),e.width()+parseInt(i.left)>this._windowWidth&&e.width(this._windowWidth-(parseInt(i.left)+50));e.css(i)}(t,o)})}})}function E(t,n){var o=n?t.data("parents"):t.parents("[title]");n?t.data("parents",void 0):(o.push(t),t.data("parents",o)),o&&c.each(o,function(t,o){var e="",i=(o=c(o)).attr("title");n?e=i!=o.data("title")&&""!=i?i:o.data("title"):o.data("title",i),o.attr("title",e)})}function _(t,o,e,i){var n=h.callout?h.callout:i,a=o.offset(),l=a.left,u=a.top;return o.is("option")&&(l=o.parent("select").offset().left,u=o.parent("select").offset().top+o.offset.top),n&&(-1!=n.indexOf("north")?(h.mouseEnter||h.mousetrack||(t.left="northwest"===n?l:"northeast"===n?l-(e.width()-o.outerWidth()):l-8-(e.width()/2-8)+o.outerWidth()/2),t.top=u+o.outerHeight()+9):-1!=n.indexOf("south")?(t.left="southwest"===n?l:"southeast"===n?l-(e.width()-o.outerWidth()):l-8-(e.width()/2-8)+o.outerWidth()/2,t.top=u-e.outerHeight()-9):"west"===n?(t.left=parseInt(l+o.outerWidth()+9),t.top=u-e.height()/2+o.outerHeight()/2):"east"===n&&(t.left=parseInt(l-e.width()-9),t.top=u-e.height()/2+o.outerHeight()/2)),t}function H(t,o){if(!w)return!1;var e={};o.removeAttr("class").attr("class","ui-ztooltip-callout ui-ztooltip-callout-"+T[t]);var i=o.outerWidth(),n=o.outerHeight(),a=d.width(),l=d.height();switch(t){case"north":e={left:a/2-i/2+"px",top:"-"+(n-1)+"px"};break;case"west":e={left:"-"+(i-1)+"px",top:l/2-n/2+"px"};break;case"east":e={left:a-1+"px",top:l/2-n/2+"px"};break;case"south":e={left:a/2-i/2+"px",top:l-1+"px"};break;case"northeast":e={left:a-2*i+"px",top:"-"+(n-1)+"px"};break;case"northwest":e={left:i+"px",top:"-"+(n-1)+"px"};break;case"southwest":e={left:i+"px",top:l-1+"px"};break;case"southeast":e={left:a-2*i+"px",top:l-1+"px"};break;default:o.addClass("ui-ztooltip-callout-top"),e={left:i+"px",top:"-"+(n-1)+"px"}}return e}var i={north:function(t){return{left:t.pageX-t.tooltipWidth/2,top:t.pageY+(t.calloutHeight+t._OFFSET)}},west:function(t){return{left:t.pageX+(t.calloutWidth+t._OFFSET),top:t.pageY-t.tooltipHeight/2}},east:function(t){return{left:t.pageX-(t.calloutWidth+t._OFFSET)-t.tooltipWidth,top:t.pageY-t.tooltipHeight/2}},south:function(t){return{left:t.pageX-t.tooltipWidth/2,top:t.pageY-(t.calloutHeight+t._OFFSET)-t.tooltipHeight}},northeast:function(t){return{left:t.pageX-(t.tooltipWidth-(t.calloutWidth+t.calloutWidth/2)),top:t.pageY+t.calloutHeight+t._OFFSET}},northwest:function(t){return{left:t.pageX-(t.calloutWidth+t.calloutWidth/2),top:t.pageY+t.calloutHeight+t._OFFSET}},southwest:function(t){return{left:t.pageX-(t.calloutWidth+t.calloutWidth/2),top:t.pageY-(t.calloutHeight+t._OFFSET)-t.tooltipHeight}},southeast:function(t){return{left:t.pageX-(t.tooltipWidth-(t.calloutWidth+t.calloutWidth/2)),top:t.pageY-(t.calloutHeight+t._OFFSET)-t.tooltipHeight}},defaultFn:function(t){return i.north(t,t.calloutHeight,t.calloutWidth)}};function k(t){t.tooltipWidth=w.outerWidth(),t.tooltipHeight=w.height();if(t._OFFSET=10,!w)return!1;var o=w.find(".ui-ztooltip-callout");t.calloutWidth=o.outerWidth(),t.calloutHeight=o.outerHeight();var e=i[h.callout];return e||(e=i.defaultFn),e(t)}function F(t){w&&("html"===h.contentType&&h.isContentElementId&&c(w).find("#"+h.content).appendTo("body").hide(),c(w).remove(),w=void 0)}function O(t,o,e,i){if(o&&e){var n,a=e.top-this._documentEle.scrollTop(),l=e.left-this._documentEle.scrollLeft(),u=l+o.width(),s=a+o.height(),r=void 0;if(u>=this._windowWidth?(e.left=this._windowWidth-(o.outerWidth(!0)+5),e.left+o.width()-i.offset().left<=15&&(h.callout="east"),r=h.callout):l<0&&(e.left=e.left+5-l,i.offset().left+i.width()-this._documentEle.scrollLeft()<=20&&(h.callout="west"),r=h.callout),s>=this._windowEle.height()?(e.top=i.offset().top-o.outerHeight()-9,r="south",n=a):a<0&&(e.top=i.offset().top+i.outerHeight()+9,r="north",n=a),r)!function(t,o,e,i,n,a,l){var u=h.callout?h.callout:o;switch(o){case"north":u="south"==u?"north":"southeast"==u?"northeast":"southwest"==u?"northwest":u;break;case"south":u="north"==u?"south":"northeast"==u?"southeast":"northwest"==u?"southwest":u;break;case"west":u="east"==u?"west":u;break;case"east":u="west"==u?"east":u}(function(t,o,e,i,n,a,l,u){if(e){h.callout=o;var s=e.position();u&&((s=H(o,e))||(s=e.position())),"east"===o||"west"===o?(s=H(o,e),a=_(a,c(t.target),i,n)):"northwest"===o||"northeast"===o||"southwest"===o||"southeast"===o?s=H(o,e):l<0?(s.left=i.width()/2-e.outerWidth()/2+l-5,s.left<=10&&(s.left=10)):(s.left=i.width()/2-e.outerWidth()/2+(l-a.left),i.width()-s.left<=20&&(s.left=i.width()-20)),s&&e.css(s)}})(t,u,e,i,o,n,a,l)}(t,r,o.find(".ui-ztooltip-callout"),o,e,l,n)}return e}c.fn.ztooltip=function(t,o,e){var i=c(this);b=c.extend({},y,"object"==typeof t&&t),i.data("z-ztooltip")?"remove"===t&&F():(n(i),i.data("z-ztooltip",!0))},c.fn.ztooltip.remove=F,!$Support.isMobileWidth()&&$Support.isIframeContentLoaded()&&c(document).ztooltip()});LSDragDrop={onDropEvent:function(e,i,a){if(-1!=e)try{i.preventDefault();var t=a||i.dataTransfer.files;this.nooffiles=t.length,this.pos=0,this.uploadFile(e,t)}catch(e){}},uploadFile:function(a,t,e,i){var o=this,s=(new Date).getTime(),l=null!=e?e:"chat_attachment",n={progress:function(e,i){$UI.showUploadProgress({fileobj:t[o.pos-1],prgval:e,msgid:i,att_type:l},a)},complete:function(){r()},success:function(){r()}};function r(){$UI.hideUploadProgress(s),$Support.Util.handleCallbacks("chat.file",{}),o.pos
",t=this.files.length,a=2
"},insertText:function(e){var t=document.getSelection();return window.clipboardData?(document.selection.createRange().pasteHTML(e),!0):!!(document.queryCommandEnabled("insertText")&&0\?\/]/g,"-")).substring(0,100),this.Filename=s,this.ext=r,l.attr("fileextn",r),l.find(".file-name").val(s),l.find("#pasteimgcomment").focus(),this.bindHandler(l),this.setPreview(l,i)}},bindHandler:function(e){e.find(".file-name").on("blur",function(){""!=$(this).val()?PasteImage.Filename=$(this).val():$(this).val(PasteImage.Filename)}).on("keydown",function(){$(this).removeClass("bdrbot_red")})},generateName:function(e,t){var a=e.type,n=a.substring(a.indexOf("/")+1,a.length);return"Image - "+this.getcurrTime()+"."+n},getcurrTime:function(){var e=new Date,t="",a=e.getHours(),n=e.getMinutes(),i=12\?\/]$/.test(r)||""==r)return!1;if(100')},a.readAsDataURL(t)},handlepasteimage:function(e){var t=parseInt(e.attr("mcount")),a=t-e.val().length,n=a<0?" redtxt":"",i=a<0?LSResource.getRealValue("common.count.error",""+t):a+" ";e.parent().find(".messagecount").show().removeClass("redtxt").addClass(n).text(i)}};