/******************************************
* Websanova.com
*
* Resources for web entrepreneurs
*
* @author Websanova
* @copyright Copyright (c) 2012 Websanova.
* @license This wTooltip jQuery plug-in is dual licensed under the MIT and GPL licenses.
* @link http://www.websanova.com
* @docs http://www.websanova.com/plugins/websanova/tooltip
* @version Version 1.4
*
******************************************/
(function(d){var c={position:"default",timeToStop:null,color:"cream",opacity:0.8,title:null,fadeIn:0,fadeOut:0,delayIn:0,delayOut:0,width:null,height:null,offsetX:8,offsetY:9};d.fn.wTooltip=function(e){e=d.extend({},c,e||{});return this.each(function(){var g=d(this);e.title=e.title||g.attr("title")||"No title set";var f=new a();var h=new b(e,f,g);h.generate();h.appendToBody();g.removeAttr("title");if(e.position=="default"){g.mousestop(function(i){h.move(i);h.hoverOn()},{timeToStop:e.timeToStop,onMouseout:function(){h.hoverOff()},onStopMove:function(){h.hoverOff()}})}else{if(e.position=="mouse"){g.mouseover(function(){h.hoverOn()}).mouseout(function(){h.hoverOff()}).mousemove(function(i){h.move(i)})}else{g.mouseover(function(){h.setBestPosition(g);h.hoverOn()}).mouseout(function(){h.hoverOff()})}}})};function a(){return this}a.prototype={set:function(e,f){this.timer=setTimeout(e,f)},clear:function(){clearTimeout(this.timer)}};function b(f,e){this.tooltip=null;this.hover=false;this.shown=false;this.settings=f;this.eventScheduler=e;return this}b.prototype={generate:function(){if(this.tooltip){return this.tooltip}var f=d('
'+this.settings.title+"
").css({width:this.settings.width||"",height:this.settings.height||"",whiteSpace:this.settings.width==null&&this.settings.height==null?"nowrap":"normal"});var e=d('').css({opacity:this.settings.opacity});this.tooltip=d('').append(d('').append(d('').append(e).append(f))).addClass("_wTooltip_"+this.settings.color);return this.tooltip},appendToBody:function(){d("body").append(this.tooltip)},show:function(){var e=this;this.tooltip.fadeIn(this.settings.fadeIn,function(){e.shown=true;if(!e.hover){e.hide()}})},hide:function(){var e=this;e.eventScheduler.set(function(){e.tooltip.fadeOut(e.settings.fadeOut,function(){e.shown=false})},e.settings.delayOut)},move:function(i){var g=d(window).width();var l=d(window).height();var f=i.pageX+this.settings.offsetX;var k=i.pageY+this.settings.offsetY;var h=this.tooltip.outerWidth();var j=this.tooltip.outerHeight();if(f-d(window).scrollLeft()+h>g){f=f-this.settings.offsetX*2-h}if(k-d(window).scrollTop()+j>l){k=k-this.settings.offsetY*2-j}this.tooltip.css({left:f,top:k})},isOverflow:function(j,i){var g=(j+this.settings.offsetX+this.tooltip.outerWidth())-(d(window).scrollLeft()+d(window).width());var e=j-d(window).scrollLeft();var f=(i+this.settings.offsetY+this.tooltip.outerHeight())-(d(window).scrollTop()+d(window).height());var h=i-d(window).scrollTop();overflowTotal=0;if(g>0){overflowTotal+=g}if(e<0){overflowTotal+=Math.abs(e)}if(f>0){overflowTotal+=f}if(h<0){overflowTotal+=Math.abs(h)}return overflowTotal},getOffset:function(i,n){var m=n.substring(0,1);var f=n.substring(1,2);var r=i.offset();var l=r.left;var q=r.top;var o=i.outerWidth();var k=i.outerHeight();var e=d(window).width();var s=d(window).height();var j=this.tooltip.outerWidth();var g=this.tooltip.outerHeight();var h=null;var p=null;if(!(m=="m"&&f=="m")){if(m=="t"){p=q-g-this.settings.offsetY}else{if(m=="b"){p=q+k+this.settings.offsetY}else{if(f=="t"){p=q+this.settings.offsetY}else{if(f=="b"){p=q+k-g-this.settings.offsetY}else{if(f=="m"){p=q-(g-k)/2}}}}}if(m=="l"){h=l-j-this.settings.offsetX}else{if(m=="r"){h=l+o+this.settings.offsetX}else{if(f=="l"){h=l+this.settings.offsetX}else{if(f=="r"){h=l-(j-o)-this.settings.offsetX}else{if(f=="c"){h=l-(j-o)/2}}}}}}return{left:h,top:p}},setBestPosition:function(i){var j={lt:["lt","lm","lb","rt","rm","rb","tl","tc","tr","bl","bc","br","mm"],lm:["lm","lt","lb","rm","rt","rb","tl","tc","tr","bl","bc","br","mm"],lb:["lb","lm","lt","rb","rm","rt","bl","bc","br","tl","tc","tr","mm"],rt:["rt","rm","rb","lt","lm","lb","tr","tc","tl","br","bc","bl","mm"],rm:["rm","rt","rb","lm","lt","lb","tr","tc","tl","br","bc","bl","mm"],rb:["rb","rm","rt","lb","lm","lt","br","bc","bl","tr","tc","tl","mm"],tl:["tl","tc","tr","bl","bc","br","lt","lm","lb","rt","rm","rb","mm"],tc:["tc","tl","tr","bc","bl","br","lt","lm","lb","rt","rm","rb","mm"],tr:["tr","tc","tl","br","bc","bl","rt","rm","rb","lt","lm","lb","mm"],bl:["bl","bc","br","tl","tc","tr","lb","lm","lt","rb","rm","rt","mm"],bc:["bc","bl","br","tc","tl","tr","lb","lm","lt","rb","rm","rt","mm"],br:["br","bc","bl","tr","tc","tl","rb","rm","rt","lb","lm","lt","mm"]};var f=null;var h=null;var g=null;var k=null;var e=j[this.settings.position];for(index in e){k=this.getOffset(i,e[index]);f=this.isOverflow(k.left,k.top);if(g==null||f