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