(function(a){a.topPosition=function(){return typeof window.pageYOffset!="undefined"?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;};a.leftPosition=function(){return typeof window.pageXOffset!="undefined"?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;
};a.fn.absoluteLeft=function(){var b=this.offset();return b.left;};a.fn.absoluteMiddleLeft=function(){var c=this.absoluteLeft();var b=this.width();return c+b/2;};a.fn.absoluteTop=function(){var b=this.offset();return b.top;};a.fn.absoluteMiddleTop=function(){var c=this.absoluteTop();var b=this.height();
return c+b/2;};a.fn.adaptiveScreen=function(e,b){var m=document.documentElement;var n=self.innerWidth||(m&&m.clientWidth)||document.body.clientWidth;var i=self.clientHeight||(m&&m.clientHeight)||document.body.clientHeight;var f=a.topPosition();var l=a.leftPosition();var k=e||this.absoluteLeft();var j=b||this.absoluteTop();
var c=this.height();var g=this.width();var o=i-j-c+f;if(o<0){j=i-c+f;}if(j<0){j=0;}var d=n*1-k*1-g*1+l*1;if(d<0){k=n-g+l-20;}if(k<0){k=0;}this.css({left:k+"px",top:j+"px"});return{left:k,top:j};};a.fn.tipShow=function(e){e=e.clone().show();a("#JT").remove();a("body").append("<div id='JT' ><iframe id='JTiframe' class='boxMask' frameborder='0'></iframe><div id='JT_copy'></div></div>");
a("#JT").hover(function(){},function(){a(this).tipClose();});a("#JT_copy").empty().append(e);var d=this.offset();var c=d.left-30;var b=d.top-20;a("#JT").show();a("#JT").css({left:c+"px",top:b+"px"});a("#JT").adaptiveScreen(c,b);a("#JT").show();};a.fn.tipClose=function(){a("#JT").remove();};a.fn.hoverTip=function(e){var d=this;
var i=null;function g(){d.bind("mousemove.hovertip",b);d.bind("mouseout.hovertip",f);a(".close",e).bind("click.hovertip",f);}function c(){e.hide();d.unbind("mousemove.hovertip",b);d.unbind("mouseout.hovertip",f);a(".close",e).unbind("click.hovertip",f);if(i){window.clearInterval(i);}}function f(){e.hide();
if(i){window.clearInterval(i);}}function b(){e.show();if(i){window.clearInterval(i);}i=window.setInterval(f,10000);}function h(j){if(e.is(":hidden")){j.hide();}else{j.show();e.hide();}e=j;}g();return{show:b,close:f,clean:c,init:g,change:h};};})(jQuery);
