(function(b){function c(g,f,o){var m=o.relative?g.position().top:g.offset().top,n=o.relative?g.position().left:g.offset().left,l=o.position[0];m-=f.outerHeight()-o.offset[0];n+=g.outerWidth()+o.offset[1];var k=f.outerHeight()+g.outerHeight();if(l=="center"){m+=k/2}if(l=="bottom"){m+=k}l=o.position[1];g=f.outerWidth()+g.outerWidth();if(l=="center"){n-=g/2}if(l=="left"){n-=g}return{top:m,left:n}}function a(A,z){var y=this,w=A.add(y),x,v=0,t=0,n=A.attr("title"),g=d[z.effect],p,f=A.is(":input"),B=f&&A.is(":checkbox, :radio, select, :button, :submit"),C=A.attr("type"),o=z.events[C]||z.events[f?B?"widget":"input":"def"];if(!g){throw'Nonexistent effect "'+z.effect+'"'}o=o.split(/,\s*/);if(o.length!=2){throw"Tooltip: bad events configuration for "+C}A.bind(o[0],function(e){clearTimeout(v);if(z.predelay){t=setTimeout(function(){y.show(e)},z.predelay)}else{y.show(e)}}).bind(o[1],function(e){clearTimeout(t);if(z.delay){v=setTimeout(function(){y.hide(e)},z.delay)}else{y.hide(e)}});if(n&&z.cancelDefault){A.removeAttr("title");A.data("title",n)}b.extend(y,{show:function(h){if(!x){if(n){x=b(z.layout).addClass(z.tipClass).appendTo(document.body).hide().append(n)}else{if(z.tip){x=b(z.tip).eq(0)}else{x=A.next();x.length||(x=A.parent().next())}}if(!x.length){throw"Cannot find tooltip for "+A}}if(y.isShown()){return y}x.stop(true,true);var e=c(A,x,z);h=h||b.Event();h.type="onBeforeShow";w.trigger(h,[e]);if(h.isDefaultPrevented()){return y}e=c(A,x,z);x.css({position:"absolute",top:e.top,left:e.left});p=true;g[0].call(y,function(){h.type="onShow";p="full";w.trigger(h)});e=z.events.tooltip.split(/,\s*/);x.bind(e[0],function(){clearTimeout(v);clearTimeout(t)});e[1]&&!A.is("input:not(:checkbox, :radio), textarea")&&x.bind(e[1],function(i){i.relatedTarget!=A[0]&&A.trigger(o[1].split(" ")[0])});return y},hide:function(e){if(!x||!y.isShown()){return y}e=e||b.Event();e.type="onBeforeHide";w.trigger(e);if(!e.isDefaultPrevented()){p=false;d[z.effect][1].call(y,function(){e.type="onHide";p=false;w.trigger(e)});return y}},isShown:function(e){return e?p=="full":p},getConf:function(){return z},getTip:function(){return x},getTrigger:function(){return A}});b.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(h,e){b.isFunction(z[e])&&b(y).bind(e,z[e]);y[e]=function(i){b(y).bind(e,i);return y}})}b.tools=b.tools||{version:"1.2.3"};b.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(f,e,g){d[f]=[e,g]}};var d={toggle:[function(f){var e=this.getConf(),g=this.getTip();e=e.opacity;e<1&&g.css({opacity:e});g.show();f.call()},function(e){this.getTip().hide();e.call()}],fade:[function(f){var e=this.getConf();this.getTip().fadeTo(e.fadeInSpeed,e.opacity,f)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};b.fn.tooltip=function(f){var e=this.data("tooltip");if(e){return e}f=b.extend(true,{},b.tools.tooltip.conf,f);if(typeof f.position=="string"){f.position=f.position.split(/,?\s/)}this.each(function(){e=new a(b(this),f);b(this).data("tooltip",e)});return f.api?e:this}})(jQuery);(function(c){var a=c.tools.tooltip;c.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!c.browser.msie});var b={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};a.addEffect("slide",function(h){var e=this.getConf(),i=this.getTip(),d=e.slideFade?{opacity:e.opacity}:{},j=b[e.direction]||b.up;d[j[1]]=j[0]+"="+e.slideOffset;e.slideFade&&i.css({opacity:0});i.show().animate(d,e.slideInSpeed,h)},function(j){var e=this.getConf(),k=e.slideOffset,d=e.slideFade?{opacity:0}:{},l=b[e.direction]||b.up,i=""+l[0];if(e.bounce){i=i=="+"?"-":"+"}d[l[1]]=i+"="+k;this.getTip().animate(d,e.slideOutSpeed,function(){c(this).hide();j.call()})})})(jQuery);(function(d){function b(e){var i=d(window),g=i.width()+i.scrollLeft(),f=i.height()+i.scrollTop();return[e.offset().top<=i.scrollTop(),g<=e.offset().left+e.width(),f<=e.offset().top+e.height(),i.scrollLeft()>=e.offset().left]}function a(e){for(var f=e.length;f--;){if(e[f]){return false}}return true}var c=d.tools.tooltip;c.dynamic={conf:{classNames:"top right bottom left"}};d.fn.dynamic=function(e){if(typeof e=="number"){e={speed:e}}e=d.extend({},c.dynamic.conf,e);var g=e.classNames.split(/\s/),f;this.each(function(){var i=d(this).tooltip().onBeforeShow(function(k,j){k=this.getTip();var h=this.getConf();f||(f=[h.position[0],h.position[1],h.offset[0],h.offset[1],d.extend({},h)]);d.extend(h,f[4]);h.position=[f[0],f[1]];h.offset=[f[2],f[3]];k.css({visibility:"hidden",position:"absolute",top:j.top,left:j.left}).show();j=b(k);if(!a(j)){if(j[2]){d.extend(h,e.top);h.position[0]="top";k.addClass(g[0])}if(j[3]){d.extend(h,e.right);h.position[1]="right";k.addClass(g[1])}if(j[0]){d.extend(h,e.bottom);h.position[0]="bottom";k.addClass(g[2])}if(j[1]){d.extend(h,e.left);h.position[1]="left";k.addClass(g[3])}if(j[0]||j[2]){h.offset[0]*=-1}if(j[1]||j[3]){h.offset[1]*=-1}}k.css({visibility:"visible"}).hide()});i.onBeforeShow(function(){var h=this.getConf();this.getTip();setTimeout(function(){h.position=[f[0],f[1]];h.offset=[f[2],f[3]]},0)});i.onHide(function(){var h=this.getTip();h.removeClass(e.classNames)});ret=i});return e.api?ret:this}})(jQuery);(function(c){function d(g,h){var e=c(h);return e.length<2?e:g.parent().find(h)}function b(u,v){var w=this,n=u.add(w),t=u.children(),q=0,j=v.vertical;a||(a=w);if(t.length>1){t=c(v.items,u)}c.extend(w,{getConf:function(){return v},getIndex:function(){return q},getSize:function(){return w.getItems().size()},getNaviButtons:function(){return i.add(h)},getRoot:function(){return u},getItemWrap:function(){return t},getItems:function(){return t.children(v.item).not("."+v.clonedClass)},move:function(f,g){return w.seekTo(q+f,g)},next:function(f){return w.move(1,f)},prev:function(f){return w.move(-1,f)},begin:function(f){return w.seekTo(0,f)},end:function(f){return w.seekTo(w.getSize()-1,f)},focus:function(){return a=w},addItem:function(f){f=c(f);if(v.circular){c(".cloned:last").before(f);c(".cloned:first").replaceWith(f.clone().addClass(v.clonedClass))}else{t.append(f)}n.trigger("onAddItem",[f]);return w},seekTo:function(f,m,k){if(v.circular&&f===0&&q==-1&&m!==0){return w}if(!v.circular&&f<0||f>w.getSize()||f<-1){return w}var g=f;if(f.jquery){f=w.getItems().index(f)}else{g=w.getItems().eq(f)}var l=c.Event("onBeforeSeek");if(!k){n.trigger(l,[f,m]);if(l.isDefaultPrevented()||!g.length){return w}}g=j?{top:-g.position().top}:{left:-g.position().left};q=f;a=w;if(m===undefined){m=v.speed}t.animate(g,m,v.easing,k||function(){n.trigger("onSeek",[f])});return w}});c.each(["onBeforeSeek","onSeek","onAddItem"],function(f,g){c.isFunction(v[g])&&c(w).bind(g,v[g]);w[g]=function(k){c(w).bind(g,k);return w}});if(v.circular){var e=w.getItems().slice(-1).clone().prependTo(t),x=w.getItems().eq(1).clone().appendTo(t);e.add(x).addClass(v.clonedClass);w.onBeforeSeek(function(f,k,g){if(!f.isDefaultPrevented()){if(k==-1){w.seekTo(e,g,function(){w.end(0)});return f.preventDefault()}else{k==w.getSize()&&w.seekTo(x,g,function(){w.begin(0)})}}});w.seekTo(0,0)}var i=d(u,v.prev).click(function(){w.prev()}),h=d(u,v.next).click(function(){w.next()});!v.circular&&w.getSize()>1&&w.onBeforeSeek(function(f,g){setTimeout(function(){if(!f.isDefaultPrevented()){i.toggleClass(v.disabledClass,g<=0);h.toggleClass(v.disabledClass,g>=w.getSize()-1)}},1)});v.mousewheel&&c.fn.mousewheel&&u.mousewheel(function(f,g){if(v.mousewheel){w.move(g<0?1:-1,v.wheelSpeed||50);return false}});v.keyboard&&c(document).bind("keydown.scrollable",function(f){if(!(!v.keyboard||f.altKey||f.ctrlKey||c(f.target).is(":input"))){if(!(v.keyboard!="static"&&a!=w)){var g=f.keyCode;if(j&&(g==38||g==40)){w.move(g==38?-1:1);return f.preventDefault()}if(!j&&(g==37||g==39)){w.move(g==37?-1:1);return f.preventDefault()}}}});c(w).trigger("onBeforeSeek",[v.initialIndex])}c.tools=c.tools||{version:"1.2.3"};c.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".next",prev:".prev",speed:400,vertical:false,wheelSpeed:0}};var a;c.fn.scrollable=function(e){var g=this.data("scrollable");if(g){return g}e=c.extend({},c.tools.scrollable.conf,e);this.each(function(){g=new b(c(this),e);c(this).data("scrollable",g)});return e.api?g:this}})(jQuery);(function(b){var a=b.tools.scrollable;a.autoscroll={conf:{autoplay:true,interval:3000,autopause:true}};b.fn.autoscroll=function(f){if(typeof f=="number"){f={interval:f}}var c=b.extend({},a.autoscroll.conf,f),e;this.each(function(){var d=b(this).data("scrollable");if(d){e=d}var j,g,h=true;d.play=function(){if(!j){h=false;j=setInterval(function(){d.next()},c.interval);d.next()}};d.pause=function(){j=clearInterval(j)};d.stop=function(){d.pause();h=true};c.autopause&&d.getRoot().add(d.getNaviButtons()).hover(function(){d.pause();clearInterval(g)},function(){h||(g=setTimeout(d.play,c.interval))});c.autoplay&&setTimeout(d.play,c.interval)});return c.api?e:this}})(jQuery);(function(c){function b(f,e){var d=c(e);return d.length<2?d:f.parent().find(e)}var a=c.tools.scrollable;a.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};c.fn.navigator=function(e){if(typeof e=="string"){e={navi:e}}e=c.extend({},a.navigator.conf,e);var d;this.each(function(){function t(h,f,j){v.seekTo(f);if(s){if(location.hash){location.hash=h.attr("href").replace("#","")}}else{return j.preventDefault()}}function u(){return r.find(e.naviItem||"> *")}function m(h){var f=c("<"+(e.naviItem||"a")+"/>").click(function(j){t(c(this),h,j)}).attr("href","#"+h);h===0&&f.addClass(p);e.indexed&&f.text(h+1);e.idPrefix&&f.attr("id",e.idPrefix+h);return f.appendTo(r)}function i(h,f){h=u().eq(f.replace("#",""));h.length||(h=u().filter("[href="+f+"]"));h.click()}var v=c(this).data("scrollable"),r=b(v.getRoot(),e.navi),g=v.getNaviButtons(),p=e.activeClass,s=e.history&&c.fn.history;if(v){d=v}v.getNaviButtons=function(){return g.add(r)};u().length?u().each(function(f){c(this).click(function(h){t(c(this),f,h)})}):c.each(v.getItems(),function(f){m(f)});v.onBeforeSeek(function(h,f){setTimeout(function(){if(!h.isDefaultPrevented()){var j=u().eq(f);!h.isDefaultPrevented()&&j.length&&u().removeClass(p).eq(f).addClass(p)}},1)});v.onAddItem(function(h,f){f=m(v.getItems().index(f));s&&f.history(i)});s&&u().history(i)});return e.api?d:this}})(jQuery);(function(b){function c(u,w){var v=this,r=u.add(v),h=b(window),q,t,l,s=b.tools.expose&&(w.mask||w.expose),j=Math.random().toString().slice(10);if(s){if(typeof s=="string"){s={color:s}}s.closeOnClick=s.closeOnEsc=false}var a=w.target||u.attr("rel");t=a?b(a):u;if(!t.length){throw"Could not find Overlay: "+a}u&&u.index(t)==-1&&u.click(function(f){v.load(f);return f.preventDefault()});b.extend(v,{load:function(n){if(v.isOpened()){return v}var k=e[w.effect];if(!k){throw'Overlay: cannot find effect : "'+w.effect+'"'}w.oneInstance&&b.each(d,function(){this.close(n)});n=n||b.Event();n.type="onBeforeLoad";r.trigger(n);if(n.isDefaultPrevented()){return v}l=true;s&&b(t).expose(s);var i=w.top,m=w.left,g=t.outerWidth({margin:true}),f=t.outerHeight({margin:true});if(typeof i=="string"){i=i=="center"?Math.max((h.height()-f)/2,0):parseInt(i,10)/100*h.height()}if(m=="center"){m=Math.max((h.width()-g)/2,0)}k[0].call(v,{top:i,left:m},function(){if(l){n.type="onLoad";r.trigger(n)}});s&&w.closeOnClick&&b.mask.getMask().one("click",v.close);w.closeOnClick&&b(document).bind("click."+j,function(o){b(o.target).parents(t).length||v.close(o)});w.closeOnEsc&&b(document).bind("keydown."+j,function(o){o.keyCode==27&&v.close(o)});return v},close:function(f){if(!v.isOpened()){return v}f=f||b.Event();f.type="onBeforeClose";r.trigger(f);if(!f.isDefaultPrevented()){l=false;e[w.effect][1].call(v,function(){f.type="onClose";r.trigger(f)});b(document).unbind("click."+j).unbind("keydown."+j);s&&b.mask.close();return v}},getOverlay:function(){return t},getTrigger:function(){return u},getClosers:function(){return q},isOpened:function(){return l},getConf:function(){return w}});b.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(g,f){b.isFunction(w[f])&&b(v).bind(f,w[f]);v[f]=function(i){b(v).bind(f,i);return v}});q=t.find(w.close||".close");if(!q.length&&!w.close){q=b('<a class="close"></a>');t.prepend(q)}q.click(function(f){v.close(f)});w.load&&v.load()}b.tools=b.tools||{version:"1.2.3"};b.tools.overlay={addEffect:function(f,a,g){e[f]=[a,g]},conf:{close:null,closeOnClick:true,closeOnEsc:true,closeSpeed:"fast",effect:"default",fixed:!b.browser.msie||b.browser.version>6,left:"center",load:false,mask:null,oneInstance:true,speed:"normal",target:null,top:"10%"}};var d=[],e={};b.tools.overlay.addEffect("default",function(g,a){var h=this.getConf(),f=b(window);if(!h.fixed){g.top+=f.scrollTop();g.left+=f.scrollLeft()}g.position=h.fixed?"fixed":"absolute";this.getOverlay().css(g).fadeIn(h.speed,a)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});b.fn.overlay=function(f){var a=this.data("overlay");if(a){return a}if(b.isFunction(f)){f={onBeforeLoad:f}}f=b.extend(true,{},b.tools.overlay.conf,f);this.each(function(){a=new c(b(this),f);d.push(a);b(this).data("overlay",a)});return f.api?a:this}})(jQuery);(function(c){function b(f){var h=f.offset();return{top:h.top+f.height()/2,left:h.left+f.width()/2}}var a=c.tools.overlay,d=c(window);c.extend(a.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function g(s,q){var t=this.getOverlay(),r=this.getConf(),n=this.getTrigger(),f=this,j=t.outerWidth({margin:true}),k=t.data("img");if(!k){var p=t.css("backgroundImage");if(!p){throw"background-image CSS property not set for overlay"}p=p.slice(p.indexOf("(")+1,p.indexOf(")")).replace(/\"/g,"");t.css("backgroundImage","none");k=c('<img src="'+p+'"/>');k.css({border:0,display:"none"}).width(j);c("body").append(k);t.data("img",k)}p=r.start.top||Math.round(d.height()/2);var i=r.start.left||Math.round(d.width()/2);if(n){n=b(n);p=n.top;i=n.left}k.css({position:"absolute",top:p,left:i,width:0,zIndex:r.zIndex}).show();s.top+=d.scrollTop();s.left+=d.scrollLeft();s.position="absolute";t.css(s);k.animate({top:t.css("top"),left:t.css("left"),width:j},r.speed,function(){if(r.fixed){s.top-=d.scrollTop();s.left-=d.scrollLeft();s.position="fixed";k.add(t).css(s)}t.css("zIndex",r.zIndex+1).fadeIn(r.fadeInSpeed,function(){f.isOpened()&&!c(this).index(t)?q.call():t.hide()})})}function e(f){var j=this.getOverlay().hide(),h=this.getConf(),k=this.getTrigger();j=j.data("img");var i={top:h.start.top,left:h.start.left,width:0};k&&c.extend(i,b(k));h.fixed&&j.css({position:"absolute"}).animate({top:"+="+d.scrollTop(),left:"+="+d.scrollLeft()},0);j.animate(i,h.closeSpeed,f)}a.addEffect("apple",g,e)})(jQuery);(function(r){function d(){if(r.browser.msie){var b=r(document).height(),c=r(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b-c<20?c:b]}return[r(document).width(),r(document).height()]}function n(b){if(b){return b.call(r.mask)}}r.tools=r.tools||{version:"1.2.3"};var a;a=r.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null,onClose:null}};var q,m,p,o,e;r.mask={load:function(c,f){if(p){return this}if(typeof c=="string"){c={color:c}}c=c||o;o=c=r.extend(r.extend({},a.conf),c);q=r("#"+c.maskId);if(!q.length){q=r("<div/>").attr("id",c.maskId);r("body").append(q)}var b=d();q.css({position:"absolute",top:0,left:0,width:b[0],height:b[1],display:"none",opacity:c.startOpacity,zIndex:c.zIndex});c.color&&q.css("backgroundColor",c.color);if(n(c.onBeforeLoad)===false){return this}c.closeOnEsc&&r(document).bind("keydown.mask",function(g){g.keyCode==27&&r.mask.close(g)});c.closeOnClick&&q.bind("click.mask",function(g){r.mask.close(g)});r(window).bind("resize.mask",function(){r.mask.fit()});if(f&&f.length){e=f.eq(0).css("zIndex");r.each(f,function(){var g=r(this);/relative|absolute|fixed/i.test(g.css("position"))||g.css("position","relative")});m=f.css({zIndex:Math.max(c.zIndex+1,e=="auto"?0:e)})}q.css({display:"block"}).fadeTo(c.loadSpeed,c.opacity,function(){r.mask.fit();n(c.onLoad)});p=true;return this},close:function(){if(p){if(n(o.onBeforeClose)===false){return this}q.fadeOut(o.closeSpeed,function(){n(o.onClose);m&&m.css({zIndex:e})});r(document).unbind("keydown.mask");q.unbind("click.mask");r(window).unbind("resize.mask");p=false}return this},fit:function(){if(p){var b=d();q.css({width:b[0],height:b[1]})}},getMask:function(){return q},isLoaded:function(){return p},getConf:function(){return o},getExposed:function(){return m}};r.fn.mask=function(b){r.mask.load(b);return this};r.fn.expose=function(b){r.mask.load(b,this);return this}})(jQuery);(function(a){function f(b){switch(b.type){case"mousemove":return a.extend(b.data,{clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY});case"DOMMouseScroll":a.extend(b,b.data);b.delta=-b.detail/3;break;case"mousewheel":b.delta=b.wheelDelta/120;break}b.type="wheel";return a.event.handle.call(this,b,b.delta)}a.fn.mousewheel=function(b){return this[b?"bind":"trigger"]("wheel",b)};a.event.special.wheel={setup:function(){a.event.add(this,e,f,{})},teardown:function(){a.event.remove(this,e,f)}};var e=!a.browser.mozilla?"mousewheel":"DOMMouseScroll"+(a.browser.version<"1.9"?" mousemove":"")})(jQuery);
