
(function($){jQuery.fn.toolTipLight=function(options){var defaults={contentClass:'.extends-tooltip.container',width:250,cursorLeftOffset:15,cursorTopOffset:0};var option=$.extend(defaults,options);var tipIco=$(this);var ttClone='';var ttContent=$('#toolTipLight-content');var windowSize=getWindowSize();if(ttContent.length==0){createTipContent();}
tipIco.live('mouseenter',function(e){showToolTip($(this),e);}).live('mousemove',function(e){updatePopupPosition(e);}).live('mouseleave',function(){hideToolTip();});function createTipContent(){ttContent=$(document.createElement('div')).attr({'id':'toolTipLight-content'}).css({'position':'absolute','top':0,'left':0,'background':'#F0F0F0','border':'1px #C8C8C8 solid','padding':'10px','font-size':'11px','width':parseInt(option.width)+'px','display':'none','z-index':'999','box-shadow':'0px 0px 5px #888'});$('body').append(ttContent);}
function showToolTip(obj,e){ttClone=obj.next(option.contentClass).clone().css({'display':'block'});ttContent.html(ttClone);ttContent.show();updatePopupPosition(e);}
function updatePopupPosition(event){if(windowSize.width<event.pageX+ttContent.width+option.cursorLeftOffset){ttContent.css("left",event.pageX-ttContent.width-option.cursorLeftOffset);}else{ttContent.css("left",event.pageX+option.cursorLeftOffset);}
if(event.clientY-ttContent.height-option.cursorTopOffset<0){ttContent.css("top",event.pageY+option.cursorTopOffset);}else{ttContent.css({"top":event.pageY-option.cursorTopOffset});}}
function hideToolTip(){ttContent.hide();ttContent.children().remove();}
function getWindowSize(){return{scrollLeft:$(window).scrollLeft(),scrollTop:$(window).scrollTop(),width:$(window).width(),height:$(window).height()};}};})(jQuery);
