(function(f){var e;var j,i,h,d,g,k,c;f.fn.cluetip=function(m,l){if(typeof m=="object"){l=m;m=null}return this.each(function(J){var v=f(this);var G=f.extend(false,{},f.fn.cluetip.defaults,l||{},f.metadata?v.metadata():f.meta?v.data():{});var p=false;var z=parseInt(G.cluezIndex,10)-1;var Q=0;v.isActive=false;if(!v.ctbound){v.bind("inactivate.cluetip",W);v.bind("showTip.cluetip",function(Z){w({pageX:0,pageY:0})});v.ctbound=true}if(!f("#cluetip").length){i=f('<div id="cluetip-inner"></div>');d=f('<h3 id="cluetip-title"></h3>');h=f('<div id="cluetip-outer"></div>').append(i).prepend(d);j=f('<div id="cluetip"></div>').css({zIndex:G.cluezIndex}).append(h).append('<div id="cluetip-extra"></div>')[b](a).hide();f('<div id="cluetip-waitimage"></div>').css({position:"absolute",zIndex:z-1}).insertBefore("#cluetip").hide();j.css({position:"absolute",zIndex:z});h.css({position:"relative",zIndex:z+1});g=f('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex:z+1}).appendTo("#cluetip")}var I=(G.dropShadow)?+G.dropShadowSteps:0;if(!k){k=f([]);for(var T=0;T<I;T++){k=k.add(f("<div></div>").css({zIndex:z-T-1,opacity:0.1,top:1+T,left:1+T}))}k.css({position:"absolute",backgroundColor:"#000"}).prependTo(j)}var E=v.attr(G.attribute),s=G.cluetipClass;if(!E&&!G.splitTitle&&!m){return true}if(G.local&&G.hideLocal){f(E+":first").hide()}var F=parseInt(G.topOffset,10),B=parseInt(G.leftOffset,10);var A,R;var x=isNaN(parseInt(G.height,10))?"auto":(/\D/g).test(G.height)?G.height:G.height+"px";var n,t,K,X,M,S;var y=isNaN(parseInt(G.width,10))?275:parseInt(G.width,10);var U=y+(parseInt(j.css("paddingLeft"))||0)+(parseInt(j.css("paddingRight"))||0)+I;var C=this.offsetWidth;var u,L,Y,N,o;var P;var H=(G.attribute!="title")?v.attr(G.titleAttribute):"";if(G.splitTitle){if(H==undefined){H=""}P=H.split(G.splitTitle);H=P.shift()}var r;var w=function(ad){if(!G.onActivate(v)){return false}if(e){clearTimeout(e);e=0}if(v.isActive){return}j.unbind("mouseenter mouseleave");j.hover(function(ag){jQuery("#products").trigger("stop");w(ag)},function(ag){jQuery("#products").trigger("start");V(ag)});v.isActive=true;j.removeClass().css({width:y});if(E==v.attr("href")){v.css("cursor",G.cursor)}v.attr("title","");if(G.hoverClass){v.addClass(G.hoverClass)}t=K=v.offset().top;u=v.offset().left;N=ad.pageX;M=ad.pageY;if(v[0].tagName.toLowerCase()!="area"){n=f(document).scrollTop();o=f(window).width()}if(C<5){C=v[0].offsetWidth}if(G.positionBy=="center"||G.positionBy=="centerX"){L=Math.floor((C-U)/2)+u+B;if(L<1){L=1}else{if(L+U>o){L=o-U}}j.css({left:L})}else{if(G.positionBy=="fixed"){L=C+u+B;j.css({left:L})}else{L=(C>u&&u>U)||u+C+U+B>o?u-U-B:C+u+B;if(v[0].tagName.toLowerCase()=="area"||G.positionBy=="mouse"||C+U>o){if(N+20+U>o){j.addClass(" cluetip-"+s);L=(N-U-B)>=0?N-U-B-parseInt(j.css("marginLeft"),10)+parseInt(i.css("marginRight"),10):N-(U/2)}else{L=N+B}}var aa=L<0?ad.pageY+F:ad.pageY;j.css({left:(L>0&&G.positionBy!="bottomTop")?L:(N+(U/2)>o)?o/2-U/2:Math.max(N-(U/2),0)})}}R=f(window).height();if(m){i.html(m);O(aa)}else{if(P){var ab=P.length;for(var ac=0;ac<ab;ac++){if(ac==0){i.html(P[ac])}else{i.append('<div class="split-body">'+P[ac]+"</div>")}}O(aa)}else{if(!G.local&&E.indexOf("#")!=0){if(p&&G.ajaxCache){i.html(p);O(aa)}else{var ae=G.ajaxSettings;ae.url=E;ae.beforeSend=function(){h.children().empty();if(G.waitImage){f("#cluetip-waitimage").css({top:M+20,left:N+20}).show()}};ae.error=function(){if(v.isActive){i.html("<i>sorry, the contents could not be loaded</i>")}};ae.success=function(ag){p=G.ajaxProcess(ag);if(v.isActive){i.html(p)}};ae.complete=function(){c=f("#cluetip-inner img").length;if(c&&!f.browser.opera){f("#cluetip-inner img").load(function(){c--;if(c<1){f("#cluetip-waitimage").hide();if(v.isActive){O(aa)}}})}else{f("#cluetip-waitimage").hide();if(v.isActive){O(aa)}}};f.ajax(ae)}}else{if(G.local){var af=f(E+":first");var Z=f.fn.wrapInner?af.wrapInner("<div></div>").children().clone(true):af.html();f.fn.wrapInner?i.empty().append(Z):i.html(Z);O(aa)}}}}};var O=function(ab){j.addClass("cluetip-"+s);if(G.truncate){var ac=i.text().slice(0,G.truncate)+"...";i.html(ac)}function Z(){}H?d.show().html(H):(G.showTitle)?d.show().html("&nbsp;"):d.hide();if(G.sticky){var aa=f('<div id="cluetip-close"><a href="#">'+G.closeText+"</a></div>");(G.closePosition=="bottom")?aa.appendTo(i):(G.closePosition=="title")?aa.prependTo(d):aa.prependTo(i);aa.click(function(){D();return false});if(G.mouseOutClose){if(f.fn.hoverIntent&&G.hoverIntent){j.hoverIntent({over:Z,timeout:G.hoverIntent.timeout,out:function(){aa.trigger("click")}})}else{j.hover(Z,function(){aa.trigger("click")})}}else{}}var ad="";h.css({overflow:x=="auto"?"visible":"auto",height:x});A=x=="auto"?Math.max(j.outerHeight(),j.height()):parseInt(x,10);X=K;S=n+R;if(G.positionBy=="center"||G.positionBy=="centerY"){X=Math.floor((v.outerHeight()-A)/2)+K+F}else{if(G.positionBy=="fixed"){X=K-G.dropShadowSteps+F}else{if((L<N&&Math.max(L,0)+U>N)||G.positionBy=="bottomTop"){if(K+A+F>S&&M-n>A+F){X=M-A-F;ad="top"}else{X=M+F;ad="bottom"}}else{if(K+A+F>S){X=(A>=R)?n:S-A-F}else{if(v.css("display")=="block"||v[0].tagName.toLowerCase()=="area"||G.positionBy=="mouse"){X=ab-F}else{X=K-G.dropShadowSteps}}}}}if(ad==""){L<u?ad="left":ad="right"}j.css({top:X+"px"}).removeClass().addClass("clue-"+ad+"-"+s).addClass(" cluetip-"+s);if(G.arrows){var ae=(K-X-G.dropShadowSteps);g.css({top:(/(left|right)/.test(ad)&&L>=0&&ae>0)?ae+"px":/(left|right)/.test(ad)?0:""}).show()}else{g.hide()}k.hide();j.hide()[G.fx.open](G.fx.open!="show"&&G.fx.openSpeed);if(G.dropShadow){k.css({height:A,width:y}).show()}if(f.fn.bgiframe){j.bgiframe()}if(G.delayedClose>0){Q=setTimeout(D,G.delayedClose)}G.onShow(j,i)};var V=function(){if(G.closeAfter){if(e){if(!G.onScheduleClose(j)){return false}clearTimeout(e);e=0}e=setTimeout(W,G.closeAfter)}else{W()}};function W(Z){if(!G.onClose(j)){return false}v.isActive=false;f("#cluetip-waitimage").hide();if(!G.sticky||(/click|toggle/).test(G.activation)){D();clearTimeout(Q)}if(G.hoverClass){v.removeClass(G.hoverClass)}f(".cluetip-clicked").removeClass("cluetip-clicked")}var D=function(){v.isActive=false;if(e){clearTimeout(e);e=0}j.unbind("mouseenter mouseleave");h.parent().hide().removeClass().end().children().empty();if(H){v.attr(G.titleAttribute,H)}v.css("cursor","");if(G.arrows){g.css({top:""})}};if((/click|toggle/).test(G.activation)){v.click(function(Z){if(j.is(":hidden")||!v.is(".cluetip-clicked")){w(Z);f(".cluetip-clicked").removeClass("cluetip-clicked");v.addClass("cluetip-clicked")}else{V(Z)}this.blur();return false})}else{if(G.activation=="focus"){v.focus(function(Z){w(Z)});v.blur(function(Z){V(Z)})}else{v.click(function(){if(v.attr("href")&&v.attr("href")==E&&!G.clickThrough){return false}});var q=function(Z){if(G.tracking==true){var ab=L-Z.pageX;var aa=X?X-Z.pageY:K-Z.pageY;v.mousemove(function(ac){j.css({left:ac.pageX+ab,top:ac.pageY+aa})})}};if(f.fn.hoverIntent&&G.hoverIntent){v.mouseover(function(){v.attr("title","")}).hoverIntent({sensitivity:G.hoverIntent.sensitivity,interval:G.hoverIntent.interval,over:function(Z){w(Z);q(Z)},timeout:G.hoverIntent.timeout,out:function(Z){V(Z);v.unbind("mousemove")}})}else{v.hover(function(Z){w(Z);q(Z)},function(Z){V(Z);v.unbind("mousemove")})}}}})};f.fn.cluetip.defaults={width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:false,tracking:false,delayedClose:0,closeAfter:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(l){return true},onShow:function(l,m){},onScheduleClose:function(l){return true},onClose:function(l){return true},ajaxCache:true,ajaxProcess:function(l){l=l.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g,"").replace(/<(link|title)(.|\s)*?\/(link|title)>/g,"");return l},ajaxSettings:{dataType:"html"},debug:false};var b="appendTo",a="body";f.cluetip={};f.cluetip.setup=function(l){if(l&&l.insertionType&&(l.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){b=l.insertionType}if(l&&l.insertionElement){a=l.insertionElement}}})(jQuery);