(function(e){function b(p,c,g){var o=this,f=p.add(this),n=p.find(g.tabs),m=c.jquery?c:p.children(c),k;n.length||(n=p.children());m.length||(m=p.parent().find(c));m.length||(m=e(c));e.extend(this,{click:function(j,i){var h=n.eq(j);if(typeof j=="string"&&j.replace("#","")){h=n.filter("[href*="+j.replace("#","")+"]");j=Math.max(n.index(h),0)}if(g.rotate){var l=n.length-1;if(j<0){return o.click(l,i)}if(j>l){return o.click(0,i)}}if(!h.length){if(k>=0){return o}j=g.initialIndex;h=n.eq(j)}if(j===k){return o}i=i||e.Event();i.type="onBeforeClick";f.trigger(i,[j]);if(!i.isDefaultPrevented()){d[g.effect].call(o,j,function(){i.type="onClick";f.trigger(i,[j])});k=j;n.removeClass(g.current);h.addClass(g.current);return o}},getConf:function(){return g},getTabs:function(){return n},getPanes:function(){return m},getCurrentPane:function(){return m.eq(k)},getCurrentTab:function(){return n.eq(k)},getIndex:function(){return k},next:function(){return o.click(k+1)},prev:function(){return o.click(k-1)},destroy:function(){n.unbind(g.event).removeClass(g.current);m.find("a[href^=#]").unbind("click.T");return o}});e.each("onBeforeClick,onClick".split(","),function(i,h){e.isFunction(g[h])&&e(o).bind(h,g[h]);o[h]=function(j){j&&e(o).bind(h,j);return o}});if(g.history&&e.fn.history){e.tools.history.init(n);g.event="history"}n.each(function(h){e(this).bind(g.event,function(i){o.click(h,i);return i.preventDefault()})});m.find("a[href^=#]").bind("click.T",function(h){o.click(e(this).attr("href"),h)});if(location.hash&&g.tabs==="a"&&p.find(g.tabs+location.hash).length){o.click(location.hash)}else{if(g.initialIndex===0||g.initialIndex>0){o.click(g.initialIndex)}}}e.tools=e.tools||{version:"1.2.4"};e.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(f,c){d[f]=c}};var d={"default":function(f,c){this.getPanes().hide().eq(f).show();c.call()},fade:function(i,c){var g=this.getConf(),h=g.fadeOutSpeed,f=this.getPanes();h?f.fadeOut(h):f.hide();f.eq(i).fadeIn(g.fadeInSpeed,c)},slide:function(f,c){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,c)},ajax:function(f,c){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),c)}},a;e.tools.tabs.addEffect("horizontal",function(f,c){a||(a=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){e(this).hide()});this.getPanes().eq(f).animate({width:a},function(){e(this).show();c.call()})});e.fn.tabs=function(g,c){var f=this.data("tabs");if(f){f.destroy();this.removeData("tabs")}if(e.isFunction(c)){c={onBeforeClick:c}}c=e.extend({},e.tools.tabs.conf,c);this.each(function(){f=new b(e(this),g,c);e(this).data("tabs",f)});return c.api?f:this}})(jQuery);(function(c){function a(x,A){function d(g){var h=c(g);return h.length<2?h:x.parent().find(g)}var y=this,u=x.add(this),z=x.data("tabs"),w,q,s,f=false,e=d(A.next).click(function(){z.next()}),r=d(A.prev).click(function(){z.prev()});c.extend(y,{getTabs:function(){return z},getConf:function(){return A},play:function(){if(!w){var g=c.Event("onBeforePlay");u.trigger(g);if(g.isDefaultPrevented()){return y}f=false;w=setInterval(z.next,A.interval);u.trigger("onPlay");z.next()}},pause:function(){if(!w&&!s){return y}var g=c.Event("onBeforePause");u.trigger(g);if(g.isDefaultPrevented()){return y}w=clearInterval(w);s=clearInterval(s);u.trigger("onPause")},stop:function(){y.pause();f=true}});c.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","),function(g,h){c.isFunction(A[h])&&y.bind(h,A[h]);y[h]=function(i){return y.bind(h,i)}});if(A.autopause){var B=z.getTabs().add(e).add(r).add(z.getPanes());B.hover(function(){y.pause();q=clearInterval(q)},function(){f||(q=setTimeout(y.play,A.interval))})}if(A.autoplay){s=setTimeout(y.play,A.interval)}else{y.stop()}A.clickable&&z.getPanes().click(function(){z.next()});if(!z.getConf().rotate){var v=A.disabledClass;z.getIndex()||r.addClass(v);z.onBeforeClick(function(g,h){if(h){r.removeClass(v);h==z.getTabs().length-1?e.addClass(v):e.removeClass(v)}else{r.addClass(v)}})}}var b;b=c.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};c.fn.slideshow=function(e){var d=this.data("slideshow");if(d){return d}e=c.extend({},b.conf,e);this.each(function(){d=new a(c(this),e);c(this).data("slideshow",d)});return e.api?d:this}})(jQuery);(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(B,A){var z=this,x=B.add(z),y,w=0,u=0,n=B.attr("title"),g=B.attr("data-tooltip"),f=d[A.effect],o,E=B.is(":input"),C=E&&B.is(":checkbox, :radio, select, :button, :submit"),D=B.attr("type"),p=A.events[D]||A.events[E?C?"widget":"input":"def"];if(!f){throw'Nonexistent effect "'+A.effect+'"'}p=p.split(/,\s*/);if(p.length!=2){throw"Tooltip: bad events configuration for "+D}B.bind(p[0],function(e){clearTimeout(w);if(A.predelay){u=setTimeout(function(){z.show(e)},A.predelay)}else{z.show(e)}}).bind(p[1],function(e){clearTimeout(u);if(A.delay){w=setTimeout(function(){z.hide(e)},A.delay)}else{z.hide(e)}});if(n&&A.cancelDefault){B.removeAttr("title");B.data("title",n)}b.extend(z,{show:function(h){if(!y){if(g){y=b(g)}else{if(n){y=b(A.layout).addClass(A.tipClass).appendTo(document.body).hide().append(n)}else{if(A.tip){y=b(A.tip).eq(0)}else{y=B.next();y.length||(y=B.parent().next())}}}if(!y.length){throw"Cannot find tooltip for "+B}}if(z.isShown()){return z}y.stop(true,true);var e=c(B,y,A);h=h||b.Event();h.type="onBeforeShow";x.trigger(h,[e]);if(h.isDefaultPrevented()){return z}e=c(B,y,A);y.css({position:"absolute",top:e.top,left:e.left});o=true;f[0].call(z,function(){h.type="onShow";o="full";x.trigger(h)});e=A.events.tooltip.split(/,\s*/);y.bind(e[0],function(){clearTimeout(w);clearTimeout(u)});e[1]&&!B.is("input:not(:checkbox, :radio), textarea")&&y.bind(e[1],function(i){i.relatedTarget!=B[0]&&B.trigger(p[1].split(" ")[0])});return z},hide:function(e){if(!y||!z.isShown()){return z}e=e||b.Event();e.type="onBeforeHide";x.trigger(e);if(!e.isDefaultPrevented()){o=false;d[A.effect][1].call(z,function(){e.type="onHide";x.trigger(e)});return z}},isShown:function(e){return e?o=="full":o},getConf:function(){return A},getTip:function(){return y},getTrigger:function(){return B}});b.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(h,e){b.isFunction(A[e])&&b(z).bind(e,A[e]);z[e]=function(i){b(z).bind(e,i);return z}})}b.tools=b.tools||{version:"1.2.4"};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(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){t.children("."+v.clonedClass+":last").before(f);t.children("."+v.clonedClass+":first").replaceWith(f.clone().addClass(v.clonedClass))}else{t.append(f)}n.trigger("onAddItem",[f]);return w},seekTo:function(f,m,k){f.jquery||(f*=1);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,function(){})}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()}}}});v.initialIndex&&w.seekTo(v.initialIndex,0,function(){})}c.tools=c.tools||{version:"1.2.4"};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(d,f){var e=c(f);return e.length<2?e:d.parent().find(f)}var a=c.tools.scrollable;a.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};c.fn.navigator=function(d){if(typeof d=="string"){d={navi:d}}d=c.extend({},a.navigator.conf,d);var e;this.each(function(){function t(f,j,h){v.seekTo(j);if(s){if(location.hash){location.hash=f.attr("href").replace("#","")}}else{return h.preventDefault()}}function u(){return r.find(d.naviItem||"> *")}function m(f){var h=c("<"+(d.naviItem||"a")+"/>").click(function(j){t(c(this),f,j)}).attr("href","#"+f);f===0&&h.addClass(p);d.indexed&&h.text(f+1);d.idPrefix&&h.attr("id",d.idPrefix+f);return h.appendTo(r)}function i(f,h){f=u().eq(h.replace("#",""));f.length||(f=u().filter("[href="+h+"]"));f.click()}var v=c(this).data("scrollable"),r=d.navi.jquery?d.navi:b(v.getRoot(),d.navi),g=v.getNaviButtons(),p=d.activeClass,s=d.history&&c.fn.history;if(v){e=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(f,h){setTimeout(function(){if(!f.isDefaultPrevented()){var j=u().eq(h);!f.isDefaultPrevented()&&j.length&&u().removeClass(p).eq(h).addClass(p)}},1)});v.onAddItem(function(f,h){h=m(v.getItems().index(h));s&&h.history(i)});s&&u().history(i)});return d.api?e: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.4"};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(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);
