var bt_options=new Object();bt_options.position="BOTH";$.fn.botips=function(a){bt_options.position=a.position;$(this).createTips();$(window).resize(function(){$(".bottips").each(function(){$(this).hideTip($("#bottips_"+this.rel));$(this).positionTip($("#bottips_"+this.rel),$("#bottips_arrow_"+this.rel))})});$(window).scroll(function(){$(".bottips").each(function(){$(this).hideTip($("#bottips_"+this.rel));$(this).positionTip($("#bottips_"+this.rel),$("#bottips_arrow_"+this.rel))})})};$.fn.hideTip=function(a){a.css("visibility","hidden")};$.fn.positionTip=function(a,l){var e=new Object();e.w=$(window).width();e.h=$(window).height();var g=$(window).scrollTop();var i=new Object();i.w=$(this).width();i.h=$(this).height();var b=new Object();b.w=a.width();b.h=a.height();var f=new Object();f.w=l.width();f.h=l.height();var c=$(this).offset();if(bt_options.position=="LEFT"){var h="Left"}else{if(bt_options.position=="RIGHT"){h="Right"}else{var h="Left";if(c.left>0+b.w){h="Left"}else{h="Right"}}}if(h=="Left"){var p=-(b.w+f.w);var k=-(p)-f.w;l.attr("class","bottips_arrow_left")}else{if(h=="Right"){var p=i.w+f.w;var k=0-f.w;l.attr("class","bottips_arrow_right")}}var n=-b.h/2;var j=b.h/2;var m=c.top+n-g;var o=false;if(m<=0){n=n-m;j=j+m;o=true}var d=c.top+b.h-g;if(d>e.h&&!o){n=e.h-(c.top+b.h-g);j=0-n}l.css({top:j+"px",left:k+"px"});a.css({top:n+"px",left:p+"px"})};$.fn.createTips=function(){$(".bottips").each(function(){var c=false;var b=0;var e=0;$(this).find("img").each(function(){c=true;b=$(this).attr("height");e=$(this).attr("width")});if(c){$(this).height(b);$(this).width(e)}$(this).mouseenter(function(){$("#bottips_"+this.rel).css("visibility","visible")});$(this).mouseleave(function(){$("#bottips_"+this.rel).css("visibility","hidden")});var a=$("<div>").attr({"class":"bottips_container",id:"bottips_"+this.rel});a.css("visibility","hidden");var g=$("<div>").attr({"class":"bottips_arrow_left",id:"bottips_arrow_"+this.rel});var h=$("<div>").attr({"class":"bottips_top"});var f=$("<div>").attr({"class":"bottips_content"});f.html($("#"+this.rel).html());var d=$("<div>").attr({"class":"bottips_bottom"});a.append(h,f,d,g);$(this).append(a);$(this).positionTip(a,g);$("#"+this.rel).remove()})};
