(function(d){d.cluetip={version:"1.1pre"};var e,g,L,q,s,D,S,E,F="appendTo",G="body";d.fn.cluetip=function(c,t){function V(e,c){var h=e.dropShadow&&e.dropShadowSteps?+e.dropShadowSteps:0;if(d.support.boxShadow){var b=h===0?"0 0 ":"1px 1px ";d("#cluetip").css(d.support.boxShadow,b+h+"px rgba(0,0,0,0.5)");return!1}b=d("#cluetip .cluetip-drop-shadow");if(h==b.length)return b;b.remove();for(var b=[],a=0;a<h;)b[a++]='<div style="top:'+a+"px;left:"+a+'px;"></div>';return c=d(b.join("")).css({position:"absolute",
backgroundColor:"#000",zIndex:m-1,opacity:0.1}).addClass("cluetip-drop-shadow").prependTo("#cluetip")}typeof c=="object"&&(t=c,c=null);if(c=="destroy")return this.removeData("cluetip").unbind(".cluetip");t=d.extend(!0,{},d.fn.cluetip.defaults,t||{});if(!d("#cluetip").length){d('<div id="cluetip"><div id="cluetip-outer" class="ui-cluetip-outer"><h3 id="cluetip-title" class="ui-widget-header ui-cluetip-header"></h3><div id="cluetip-inner" class="ui-widget-content ui-cluetip-content"></div></div><div id="cluetip-extra"></div><div id="cluetip-arrows" class="cluetip-arrows"></div></div>')[F](G).hide();
var m=+t.cluezIndex;e=d("#cluetip").css({position:"absolute"});L=d("#cluetip-outer").css({position:"relative",zIndex:m});g=d("#cluetip-inner");q=d("#cluetip-title");s=d("#cluetip-arrows");D=d('<div id="cluetip-waitimage"></div>').css({position:"absolute"}).insertBefore(e).hide()}var X=(parseInt(e.css("paddingLeft"),10)||0)+(parseInt(e.css("paddingRight"),10)||0);this.each(function(u){function W(){return!1}var h=this,b=d(this),a=d.extend(!0,{},t,d.metadata?b.metadata():d.meta?b.data():{}),M=!1;m=+a.cluezIndex;
b.data("cluetip",{title:h.title,zIndex:m});var A=!1,F=0,k=b.attr(a.attribute),H=a.cluetipClass;if(!k&&!a.splitTitle&&!c)return!0;a.local&&a.localPrefix&&(k=a.localPrefix+k);a.local&&a.hideLocal&&k&&d(k+":first").hide();var r=parseInt(a.topOffset,10),x=parseInt(a.leftOffset,10),n,T,N=isNaN(parseInt(a.height,10))?"auto":/\D/g.test(a.height)?a.height:a.height+"px",O,v,i,I,P,U=parseInt(a.width,10)||275,l=U+X+a.dropShadowSteps,J=this.offsetWidth,w,j,o,B,C,p=a.attribute!="title"?b.attr(a.titleAttribute):
"";a.splitTitle&&(p==void 0&&(p=""),C=p.split(a.splitTitle),p=C.shift());a.escapeTitle&&(p=p.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;"));var Q=function(f){if(!a.onActivate(b))return!1;A=!0;e.removeClass().css({width:U});k==b.attr("href")&&b.css("cursor",a.cursor);a.hoverClass&&b.addClass(a.hoverClass);v=b.offset().top;w=b.offset().left;o=f.pageX;I=f.pageY;h.tagName.toLowerCase()!="area"&&(O=d(document).scrollTop(),B=d(window).width());if(a.positionBy=="fixed")j=J+w+x,e.css({left:j});
else{j=J>w&&w>l||w+J+l+x>B?w-l-x:J+w+x;if(h.tagName.toLowerCase()=="area"||a.positionBy=="mouse"||J+l>B)o+20+l>B?(e.addClass(" cluetip-"+H),j=o-l-x>=0?o-l-x-parseInt(e.css("marginLeft"),10)+parseInt(g.css("marginRight"),10):o-l/2):j=o+x;var y=j<0?f.pageY+r:f.pageY;e.css({left:j>0&&a.positionBy!="bottomTop"?j:o+l/2>B?B/2-l/2:Math.max(o-l/2,0),zIndex:b.data("cluetip").zIndex});s.css({zIndex:b.data("cluetip").zIndex+1})}T=d(window).height();if(c)typeof c=="function"&&(c=c.call(h)),g.html(c),z(y);else if(C){f=
C.length;g.html(f?C[0]:"");if(f>1)for(var i=1;i<f;i++)g.append('<div class="split-body">'+C[i]+"</div>");z(y)}else if(!a.local&&k.indexOf("#")!==0)if(/\.(jpe?g|tiff?|gif|png)(?:\?.*)?$/i.test(k))g.html('<img src="'+k+'" alt="'+p+'" />'),z(y);else if(M&&a.ajaxCache)g.html(M),z(y);else{var t=a.ajaxSettings.beforeSend,m=a.ajaxSettings.error,n=a.ajaxSettings.success,q=a.ajaxSettings.complete,f=d.extend(!0,{},a.ajaxSettings,{cache:!1,url:k,beforeSend:function(f){t&&t.call(h,f,e,g);L.children().empty();
a.waitImage&&D.css({top:I+20,left:o+20,zIndex:b.data("cluetip").zIndex-1}).show()},error:function(a,b){A&&(m?m.call(h,a,b,e,g):g.html("<i>sorry, the contents could not be loaded</i>"))},success:function(b,f){M=a.ajaxProcess.call(h,b);A&&(n&&n.call(h,b,f,e,g),g.html(M))},complete:function(a,b){q&&q.call(h,a,b,e,g);var f=g[0].getElementsByTagName("img");E=f.length;for(var c=0,i=f.length;c<i;c++)f[c].complete&&E--;E&&!d.browser.opera?d(f).bind("load error",function(){E--;E<1&&(D.hide(),A&&z(y))}):(D.hide(),
A&&z(y))}});d.ajax(f)}else a.local&&(f=d(k+(/#\S+$/.test(k)?"":":eq("+u+")")).clone(!0).show(),a.localIdSuffix&&f.attr("id",f[0].id+a.localIdSuffix),g.html(f),z(y))},z=function(f){e.addClass("cluetip-"+H);if(a.truncate){var c=g.text().slice(0,a.truncate)+"...";g.html(c)}p?q.show().html(p):a.showTitle?q.show().html("&nbsp;"):q.hide();a.sticky&&(c=d('<div id="cluetip-close"><a href="#">'+a.closeText+"</a></div>"),a.closePosition=="bottom"?c.appendTo(g):a.closePosition=="title"?c.prependTo(q):c.prependTo(g),
c.bind("click.cluetip",function(){K();return!1}),a.mouseOutClose?e.bind("mouseleave.cluetip",function(){K()}):e.unbind("mouseleave.cluetip"));c="";L.css({zIndex:b.data("cluetip").zIndex,overflow:N=="auto"?"visible":"auto",height:N});n=N=="auto"?Math.max(e.outerHeight(),e.height()):parseInt(N,10);i=v;P=O+T;a.positionBy=="fixed"?i=v-a.dropShadowSteps+r:j<o&&Math.max(j,0)+l>o||a.positionBy=="bottomTop"?v+n+r>P&&I-O>n+r?(i=I-n-r,c="top"):(i=I+r,c="bottom"):i=v+n+r>P?n>=T?O:P-n-r:b.css("display")=="block"||
h.tagName.toLowerCase()=="area"||a.positionBy=="mouse"?f-r:v-a.dropShadowSteps;c==""&&(j<w?c="left":c="right");f=" clue-"+c+"-"+H+" cluetip-"+H;H=="rounded"&&(f+=" ui-corner-all");e.css({top:i+"px"}).attr({className:"ui-widget ui-widget-content ui-cluetip"+f});a.arrows?(f=v-i-a.dropShadowSteps,s.css({top:/(left|right)/.test(c)&&j>=0&&f>0?f+"px":/(left|right)/.test(c)?0:""}).show()):s.hide();(S=V(a))&&S.length&&S.hide().css({height:n,width:U,zIndex:b.data("cluetip").zIndex-1}).show();e.hide()[a.fx.open](a.fx.openSpeed||
0);d.fn.bgiframe&&e.bgiframe();a.delayedClose>0&&(F=setTimeout(K,a.delayedClose));a.onShow.call(h,e,g)},R=function(){A=!1;D.hide();if(!a.sticky||/click|toggle/.test(a.activation))K(),clearTimeout(F);a.hoverClass&&b.removeClass(a.hoverClass)},K=function(){L.parent().hide().removeClass();a.onHide.call(h,e,g);b.removeClass("cluetip-clicked");p&&b.attr(a.titleAttribute,p);b.css("cursor","");a.arrows&&s.css({top:""})};d(document).bind("hideCluetip",function(){K()});if(/click|toggle/.test(a.activation))b.bind("click.cluetip",
function(a){e.is(":hidden")||!b.is(".cluetip-clicked")?(Q(a),d(".cluetip-clicked").removeClass("cluetip-clicked"),b.addClass("cluetip-clicked")):R(a);this.blur();return!1});else if(a.activation=="focus")b.bind("focus.cluetip",function(a){b.attr("title","");Q(a)}),b.bind("blur.cluetip",function(a){b.attr("title",b.data("thisInfo").title);R(a)});else{b[a.clickThrough?"unbind":"bind"]("click",W);var G=function(c){if(a.tracking==!0){var d=j-c.pageX,h=i?i-c.pageY:v-c.pageY;b.bind("mousemove.cluetip",function(a){e.css({left:a.pageX+
d,top:a.pageY+h})})}};d.fn.hoverIntent&&a.hoverIntent?b.hoverIntent({sensitivity:a.hoverIntent.sensitivity,interval:a.hoverIntent.interval,over:function(a){Q(a);G(a)},timeout:a.hoverIntent.timeout,out:function(a){R(a);b.unbind("mousemove.cluetip")}}):b.bind("mouseenter.cluetip",function(a){Q(a);G(a)}).bind("mouseleave.cluetip",function(a){R(a);b.unbind("mousemove.cluetip")});b.bind("mouseover.cluetip",function(){b.attr("title","")}).bind("mouseleave.cluetip",function(){b.attr("title",b.data("cluetip").title)})}});
return this};(function(){d.support=d.support||{};for(var c=document.createElement("div").style,e=["boxShadow"],g=["moz","Moz","webkit","o"],m=0,q=e.length;m<q;m++){var u=e[m],s=u.charAt(0).toUpperCase()+u.slice(1);if(typeof c[u]!=="undefined")d.support[u]=u;else for(var h=0,b=g.length;h<b;h++)if(typeof c[g[h]+s]!=="undefined"){d.support[u]=g[h]+s;break}}})();d.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:!1,localPrefix:null,localIdSuffix:null,
hideLocal:!0,attribute:"rel",titleAttribute:"title",splitTitle:"",escapeTitle:!1,showTitle:!0,cluetipClass:"default",hoverClass:"",waitImage:!0,cursor:"help",arrows:!1,dropShadow:!0,dropShadowSteps:6,sticky:!1,mouseOutClose:!1,activation:"hover",clickThrough:!0,tracking:!1,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"fadeIn",openSpeed:"3000"},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(){return!0},onShow:function(){},onHide:function(){},ajaxCache:!0,
ajaxProcess:function(c){return c=c.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,"").replace(/<(link|meta)[^>]+>/g,"")},ajaxSettings:{dataType:"html"},debug:!1};d.cluetip.setup=function(c){if(c&&c.insertionType&&c.insertionType.match(/appendTo|prependTo|insertBefore|insertAfter/))F=c.insertionType;if(c&&c.insertionElement)G=c.insertionElement}})(jQuery);
