/* 
* Project: HoverTip - v11.1020
* Author: Phil, based on work from that other guy ... from CSS-World.
* Description: HoverTip will search the DOM for any element with a class of "hovertip" and apply the hovertip styles to it.
*
* Required: an element with a title attribute.
* Optional: custom attributes: nametag and imgtag.
* nametag is used as a title element in the hover window
* imgtag is used for a path to an image, with an image nothing is displayed
*
*	Options:
*	xOffset - (default:-20) - The name is misleading, this is the amount above or below the cursor that the hoverTip will start. Negative numbers will place it below the cursor
*	yOffset - (default:-400) - Also misleading, this is where the hoverTip will start to the left or right of the cursor. Negative numbers will place it to the left.
*	zIndex - (default:10) - Sets the z-index of the hoverTip to help with layout bugs
*	siteName - (default:NordicTrack) - Used with the image paths below
*	cdnImagePath - (default:http://img.iconcdn.com) - The location of your CDN image folder
*	fullImagePath - (default:"") The location or path to your image folder
*
* Example usage:
* $.hovertip({'zIndex':30,'siteName':'ProForm'});
* <a href="javascript:void(null);" class="hovertip" title="This text will appear when you hover over it.">Details</a>
*
* Needed:
* Need to add a click/tap event to trigger window for touch devices 
*
* Known Bugs:
* No support for Touch devices, you can't hover, you don't see it
*
*/
(function(a){a.fn.hoverTip=function(d){var b={xOffset:-20,yOffset:-400,zIndex:20001,imgTag:"",siteName:"NordicTrack",cdnImagePath:"http://img.iconcdn.com/",fullImagePath:""};a("head").append("<style>#hovertip{position:absolute;z-index: "+b.zIndex+";border-top:1px solid #f6f6f6;border-right:1px solid #bbb;border-left:1px solid #ddd;border-bottom:1px solid #848484;border-radius:10px;background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0.29,#fff),color-stop(0.65,#eee));background-image:-moz-linear-gradient(center top,#fff 29%,#eee 65%);color:#000;display:none;width:416px;font-size:11px;font-family:ariel,helvetica,sans-serif;-moz-box-shadow:1px 4px 5px #8e8e8e;-webkit-box-shadow:1px 4px 5px #8e8e8e;box-shadow:1px 4px 5px #8e8e8e}#ht{padding:10px 5px}#ht-left{width:130px;float:left;border-radius:10px 0 0 10px}#ht-left img{padding:14px;width:100px}#ht-right{margin-left:135px;padding:10px 5px}#ht-right li{list-style-type:none}</style>");
return this.each(function(){d&&a.extend(b,d);$this=a(this);$this.hover(function(c){this.t=this.title;imgTag=a(this).attr("imgtag");nameTag=a(this).attr("nametag");nameTag==void 0&&(nameTag="");this.title="";imgTag==""||imgTag==" "||imgTag==void 0?a("body").append("<div id='hovertip'><div id='ht'><div style='font-weight:bold;font-size:125%'>"+nameTag+"</div><div style='margin-top:15px'>"+this.t+"</div></div></div>"):a("body").append("<div id='hovertip'><div id='ht-left'><img src='"+b.cdnImagePath+
b.siteName+"/images/"+imgTag+"' alt='"+nameTag+"' /></div><div id='ht-right'><div style='font-weight:bold;font-size:125%'>"+nameTag+"</div><div style='margin-top:15px'>"+this.t+"</div></div></div>");c.pageX+b.yOffset<1?a("#hovertip").css("top",c.pageY-b.xOffset+"px").css("left","1px").fadeIn("fast"):a("#hovertip").css("top",c.pageY-b.xOffset+"px").css("left",c.pageX+b.yOffset+"px").fadeIn("fast")},function(){this.title=this.t;a("#hovertip").remove()});$this.mousemove(function(c){c.pageX+b.yOffset<
1?a("#hovertip").css("top",c.pageY-b.xOffset+"px").css("left","1px"):a("#hovertip").css("top",c.pageY-b.xOffset+"px").css("left",c.pageX+b.yOffset+"px")})})}})(jQuery);

