(function($){$.fn.dynTip=function(options){var defaults={tipHtml:'<div id="dyn_tip"></div>',tipEtiket:'title',tipContainer:'#dyn_tip',tipIc:'#dyn_tip',tipTop:10,tipLeft:10};var options=$.extend(defaults,options);var koordinatlar=new Array(2);var dyn_tip=null;if(options.tipContainer!="#dyn_tip"&&options.tipIc=="#dyn_tip"){options.tipIc=options.tipContainer;}if(options.tipTop<5){options.tipTop=5;}if(options.tipLeft<5){options.tipLeft=5;}if(!$(options.tipContainer).length){$('body').append(options.tipHtml);$(options.tipContainer).css("position","absolute");$(options.tipContainer).css("z-index","999");$(options.tipContainer).hide();}this.hover(function(){dyn_tip=$(this).attr(options.tipEtiket);if(dyn_tip!=""){$(this).attr(options.tipEtiket,'');$(options.tipIc).html(dyn_tip);$(options.tipContainer).stop(true,true).fadeIn("fast");$(this).mousemove(function(m){koordinatlar=hesapla(m);$(options.tipContainer).css('top',koordinatlar["top"]);$(options.tipContainer).css('left',koordinatlar["left"]);});}},function(){if(dyn_tip!=null){$(this).attr(options.tipEtiket,dyn_tip);$(options.tipIc).html("");$(options.tipContainer).stop(true,true).fadeOut("fast");dyn_tip=null;}});function hesapla(m){var w=$(window).width()-($(options.tipContainer).outerWidth(true)+(m.pageX)+options.tipLeft);var h=$(window).height()-($(options.tipContainer).outerHeight(true)+(m.pageY-$(window).scrollTop())+options.tipTop);var hesapTop=(m.pageY+options.tipTop)+"px";var hesapLeft=(m.pageX+options.tipLeft)+"px";var hesap=new Array(2);if(w<0){hesapLeft=((m.pageX-options.tipLeft)-$(options.tipContainer).outerWidth(true))+"px";}if(h<0){hesapTop=((m.pageY-options.tipTop)-$(options.tipContainer).outerHeight(true))+"px";}hesap["top"]=hesapTop;hesap["left"]=hesapLeft;return hesap;};};})(jQuery);
$(document).ready(function(){$(".dyn_tip").dynTip();});
