/*
 
 Singulink JS Library: Fluid Highlight, v3.2 (June 6. 2011) 
 Copyright (C) Singulink (TM) (http://www.singulink.com)
 Tested with jQuery 1.4.2

 If you would like to use our plugins, please contact us:
 http://www.singulink.com/Contact?subject=jQuery%20Plug-ins

*/
var g=null;
(function(c){c.fn.extend({Any:function(){return c(this).length>0}});c.fn.extend({Single:function(){return c(this).length===1}});c.fn.extend({SingleOrDefault:function(){return c(this).length>=0}});c.fn.extend({AtLeast:function(f){return c(this).length>=f}});c.fn.extend({AtMost:function(f){return c(this).length<=f}});c.fn.extend({fluidHighlight:function(f,k,l){function j(b,m){if(b&&b.Single()){var d;d=b.offset();var e=c(a.offsetParent()).offset();d={width:b.attr("offsetWidth")+a.options.padding,left:d.left-
e.left,top:d.top-e.top};m?a.animate(d,{duration:a.options.duration},{easing:a.options.easing}):a.css(d);a.css("visibility")==="hidden"&&a.css("visibility","visible")}}var e={c:"Highlight",k:"HighlightTargets",j:"FrozenTarget",h:"UpdateLayout",q:"sjs-layout-dependent",l:".sjs-layout-dependent"};if(f==="option"){f=c(this).data(e.c);if(!f.Single())throw"Fluid Highlight Plugin has not been initialized.";if(!k)throw"No param option value was given.";l&&(f.options[k]=l);return f.options[k]}var a=c(this),
h=g,i=g;a.i=function(){var b=a.data(e.k);b===void 0&&(b=c(a.options.targetSelector),a.data(e.k,b));return b};a.g=function(){var b=c("."+a.options.currentElementClass);b.Any()||(b=a.i().first());return b.first()};a.a=new function(){this.f=function(b){a.data(e.j,b)};this.m=function(){return a.data(e.j)}};a.h=function(b){j(a.g());if(!b||!b.Single())return b;var c=b.parents(e.l).first(),d=c.data(e.c);if(!c.Single()||!d.Single())return b;var f=d.a.m();b.is(":hidden")?f&&d.b?c.bind(d.options.resetAction,
function(){delayReset=setTimeout(function(){clearTimeout(delayReset);delayReset=g;d.a.f(g);c.unbind(d.options.resetAction);c.bind(a.options.resetAction,d.d);d.b||d.d()},d.options.resetTime)}):(d.a.f(g),d.d()):(!f||f.get(0)!=c.get(0)&&c.find(e.l).Any())&&d.a.f(c);return b};a.o=function(b){if(!b.find(".sjs-layout-dependent").Any()){var e=a.options.currentElementClass;c("."+e).removeClass(e);b.addClass(e)}};a.p=function(b){if(b&&b.Single())a.b=!0,h&&(clearTimeout(h),h=g),i=setTimeout(function(){a.b=
!0;clearTimeout(i);i=g;a.stop(!0,!1);j(b,!0)},a.options.responseTime)};a.d=function(){a.b=!1;i&&(clearTimeout(i),i=g);h=setTimeout(function(){clearTimeout(h);h=g;a.stop(!0,!1);var b=a.a.m();b?j(b,!0):j(a.g(),!0)},a.options.resetTime)};if(!a.Single())throw"There must be one and only be one 'highlight' element selected.";a.options=c.extend({},{targetSelector:".target",currentElementClass:"currentItem",duration:"fast",easing:"easeout",padding:0,hoverAction:"mouseenter",resetAction:"mouseleave",responseTime:150,
resetTime:300},f);a.b=!1;a.a.f(g);j(a.g());a.i().each(function(b,f){return c(f).addClass(e.q).data(e.c,a).data(e.h,a.h).bind("click",function(b){a.o(c(b.currentTarget))}).bind(a.options.hoverAction,function(b){a.p(c(b.currentTarget))}).bind(a.options.resetAction,a.d)});return a.data(e.c,a)}})})(jQuery);

