/* This includes 3 files: bubbletip.js, popover.js, userfields.js */

jQuery(document).ready(function(){var o=1;jQuery(document).on("mouseover","[rel^=bubbletip_]",function(){var l=jQuery(this),e="",t="";if(l.attr("rel").match("bubbletip_user_")){var i=l.attr("rel").replace(/bubbletip_user_(\d+).*/g,"$1");e="bubble_cache_user_"+i,t="&userid="+i}else if(l.attr("rel").match("bubbletip_comment_")){var r=l.attr("rel").replace(/bubbletip_comment_(\d+).*/,"$1");e="bubble_cache_comment_"+r,t="&commentid="+r}if(""!=e){l.attr("id","bubblelink"+o);var u="bubbletip_info_"+o;jQuery("body").append('<div id="'+u+'" style="display:none;"></div>');var a={showOnInit:!0,deltaShift:0,delayHide:1};if(0==jQuery("#"+e).length){jQuery("body").append('<div id="'+e+'" style="display:none;"></div>');var b=jQuery("#"+e),n=jQuery("#"+u);jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_user_bubbletip&blog="+blog_id+t,success:function(e){if(ajax_response_is_correct(e)){if(e=ajax_debug_clear(e),n.html(e),b.html(e),0==n.find("img").width()){var t=n.find("div.center"),i=t.attr("w"),r=parseInt(t.attr("h"))+9;t.attr("style","width:"+i+"px;height:"+r+"px;")}l.hasClass("hide_bubbletip")&&(a.showOnInit=!1,l.removeClass("hide_bubbletip")),l.bubbletip(n,a),l.attr("rel",l.attr("rel").replace(/bubbletip_(user_|comment_)[\d\s]+/g,""))}}})}else""!=jQuery("#"+e).html()?(jQuery("#"+u).html(jQuery("#"+e).html()),l.bubbletip(jQuery("#"+u),a),l.attr("rel",l.attr("rel").replace(/bubbletip_(user_|comment_)[\d\s]+/g,""))):jQuery("#"+u).remove();o++}}),jQuery(document).on("mouseleave","[rel^=bubbletip_]",function(){jQuery(this).addClass("hide_bubbletip")})});var evo_tooltip_number=1;jQuery(document).on("mouseover","[data-popover]",function(){if(jQuery(this).data("tooltip-init"))return!0;jQuery(this).attr("title",""),jQuery(this).find("span").removeAttr("title");var e=jQuery(this).data("popover");jQuery("body").append('<div id="evo_tooltip_box_'+evo_tooltip_number+'" style="display:none;max-width:200px;text-align:left">'+e+"</div>");var t=jQuery(this).data("placement");t=t||"right",jQuery("body").width()-jQuery(this).position().left<220&&(t="left");var i=jQuery("#evo_tooltip_box_"+evo_tooltip_number);jQuery(this).bubbletip(i,{showOnInit:!0,deltaDirection:t,deltaShift:0}),jQuery(this).data("tooltip-init",1),evo_tooltip_number++}),jQuery(document).ready(function(){var b=1;jQuery(document).on("focus","[rel^=ufdf_]",function(){var t=jQuery(this),e="";if(!t.hasClass("bubblefield")){var i=t.attr("rel").replace("ufdf_","");e="bubble_cache_field_"+i}if(""!=e){var r="bubbletip_field_"+b;jQuery("body").append('<div id="'+r+'" style="display:none;"></div>');var l={bindShow:"focus",bindHide:"blur",calculateOnShow:!0,showOnInit:!0,deltaDirection:"right",deltaShift:-16};if(0==jQuery("#"+e).length){jQuery("body").append('<div id="'+e+'" style="display:none"></div>');var u=jQuery("#"+e),a=jQuery("#"+r);jQuery.ajax({type:"POST",url:htsrv_url+"anon_async.php",data:"action=get_field_bubbletip&field_ID="+i,success:function(e){ajax_response_is_correct(e)&&(e=ajax_debug_clear(e),a.html(e),u.html(e),t.hasClass("hide_bubbletip")&&(l.showOnInit=!1,t.removeClass("hide_bubbletip")),t.bubbletip(a,l),a.attr("style","cursor:pointer"),a.click(function(){t.next().find("span.icon:first").click()})),t.addClass("bubblefield")}})}else""!=jQuery("#"+e).html()?(jQuery("#"+r).html(jQuery("#"+e).html()),t.bubbletip(jQuery("#"+r),l),jQuery("#"+r).attr("style","cursor:pointer"),jQuery("#"+r).click(function(){t.next().find("span.icon:first").click()}),t.addClass("bubblefield")):jQuery("#"+r).remove();b++}}),jQuery(document).on("blur","[rel^=ufdf_]",function(){jQuery(this).addClass("bubblefield")})});