/*hoverIntent*/(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
/*navigator*/(function(d){function o(g,a){var b=d(a);return b.length<2?b:g.parent().find(a)}function m(g,a){var b=this,q=g.add(b),j=g.children(),k=0,n=a.vertical;f||(f=b);if(j.length>1)j=d(a.items,g);d.extend(b,{getConf:function(){return a},getIndex:function(){return k},getSize:function(){return b.getItems().size()},getNaviButtons:function(){return p.add(h)},getRoot:function(){return g},getItemWrap:function(){return j},getItems:function(){return j.children(a.item).not("."+a.clonedClass)},move:function(c,e){return b.seekTo(k+ c,e)},next:function(c){return b.move(1,c)},prev:function(c){return b.move(-1,c)},begin:function(c){return b.seekTo(0,c)},end:function(c){return b.seekTo(b.getSize()-1,c)},focus:function(){return f=b},addItem:function(c){c=d(c);if(a.circular){j.children("."+a.clonedClass+":last").before(c);j.children("."+a.clonedClass+":first").replaceWith(c.clone().addClass(a.clonedClass))}else j.append(c);q.trigger("onAddItem",[c]);return b},seekTo:function(c,e,l){c.jquery||(c*=1);if(a.circular&&c===0&&k==-1&&e!== 0)return b;if(!a.circular&&c<0||c>b.getSize()||c<-1)return b;var r=c;if(c.jquery)c=b.getItems().index(c);else r=b.getItems().eq(c);var u=d.Event("onBeforeSeek");if(!l){q.trigger(u,[c,e]);if(u.isDefaultPrevented()||!r.length)return b}r=n?{top:-r.position().top}:{left:-r.position().left};k=c;f=b;if(e===undefined)e=a.speed;j.animate(r,e,a.easing,l||function(){q.trigger("onSeek",[c])});return b}});d.each(["onBeforeSeek","onSeek","onAddItem"],function(c,e){d.isFunction(a[e])&&d(b).bind(e,a[e]);b[e]=function(l){l&& d(b).bind(e,l);return b}});if(a.circular){var t=b.getItems().slice(-1).clone().prependTo(j),s=b.getItems().eq(1).clone().appendTo(j);t.add(s).addClass(a.clonedClass);b.onBeforeSeek(function(c,e,l){if(!c.isDefaultPrevented())if(e==-1){b.seekTo(t,l,function(){b.end(0)});return c.preventDefault()}else e==b.getSize()&&b.seekTo(s,l,function(){b.begin(0)})});b.seekTo(0,0,function(){})}var p=o(g,a.prev).click(function(){b.prev()}),h=o(g,a.next).click(function(){b.next()});if(!a.circular&&b.getSize()>1){b.onBeforeSeek(function(c, e){setTimeout(function(){if(!c.isDefaultPrevented()){p.toggleClass(a.disabledClass,e<=0);h.toggleClass(a.disabledClass,e>=b.getSize()-1)}},1)});a.initialIndex||p.addClass(a.disabledClass)}a.mousewheel&&d.fn.mousewheel&&g.mousewheel(function(c,e){if(a.mousewheel){b.move(e<0?1:-1,a.wheelSpeed||50);return false}});if(a.touch){var i={};parseInt(j[0]).ontouchstart=function(c){c=c.touches[0];i.x=c.clientX;i.y=c.clientY};parseInt(j[0]).ontouchmove=function(c){if(c.touches.length==1&&!j.is(":animated")){var e= c.touches[0],l=i.x-e.clientX;e=i.y-e.clientY;b[n&&e>0||!n&&l>0?"next":"prev"]();c.preventDefault()}}}a.keyboard&&d(document).bind("keydown.scrollable",function(c){if(!(!a.keyboard||c.altKey||c.ctrlKey||d(c.target).is(":input")))if(!(a.keyboard!="static"&&f!=b)){var e=c.keyCode;if(n&&(e==38||e==40)){b.move(e==38?-1:1);return c.preventDefault()}if(!n&&(e==37||e==39)){b.move(e==37?-1:1);return c.preventDefault()}}});a.initialIndex&&b.seekTo(a.initialIndex,0,function(){})}d.tools=d.tools||{version:"1.2.5"}; d.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,touch:true,wheelSpeed:0}};var f;d.fn.scrollable=function(g){var a=this.data("scrollable");if(a)return a;g=d.extend({},d.tools.scrollable.conf,g);this.each(function(){a=new m(d(this),g);d(this).data("scrollable",a)});return g.api?a:this}})(jQuery); (function(d){var o=d.tools.scrollable;o.autoscroll={conf:{autoplay:true,interval:3E3,autopause:true}};d.fn.autoscroll=function(m){if(typeof m=="number")m={interval:m};var f=d.extend({},o.autoscroll.conf,m),g;this.each(function(){var a=d(this).data("scrollable");if(a)g=a;var b;a.play=function(){b||(b=setInterval(function(){a.next()},f.interval))};a.pause=function(){b=clearInterval(b)};a.stop=function(){a.pause()};f.autopause&&a.getRoot().add(a.getNaviButtons()).hover(a.pause,a.play);f.autoplay&&a.play()}); return f.api?g:this}})(jQuery); (function(d){function o(f,g){var a=d(g);return a.length<2?a:f.parent().find(g)}var m=d.tools.scrollable;m.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};d.fn.navigator=function(f){if(typeof f=="string")f={navi:f};f=d.extend({},m.navigator.conf,f);var g;this.each(function(){function a(h,i,c){k.seekTo(i);if(p){if(location.hash)location.hash=h.attr("href").replace("#","")}else return c.preventDefault()}function b(){return n.find(f.naviItem||"> *")} function q(h){var i=d("<"+(f.naviItem||"a")+"/>").click(function(c){a(d(this),h,c)}).attr("href","#"+h);h===0&&i.addClass(s);f.indexed&&i.text(h+1);f.idPrefix&&i.attr("id",f.idPrefix+h);return i.appendTo(n)}function j(h,i){h=b().eq(i.replace("#",""));h.length||(h=b().filter("[href="+i+"]"));h.click()}var k=d(this).data("scrollable"),n=f.navi.jquery?f.navi:o(k.getRoot(),f.navi),t=k.getNaviButtons(),s=f.activeClass,p=f.history&&d.fn.history;if(k)g=k;k.getNaviButtons=function(){return t.add(n)};b().length? b().each(function(h){d(this).click(function(i){a(d(this),h,i)})}):d.each(k.getItems(),function(h){q(h)});k.onBeforeSeek(function(h,i){setTimeout(function(){if(!h.isDefaultPrevented()){var c=b().eq(i);!h.isDefaultPrevented()&&c.length&&b().removeClass(s).eq(i).addClass(s)}},1)});k.onAddItem(function(h,i){i=q(k.getItems().index(i));p&&i.history(j)});p&&b().history(j)});return f.api?g:this}})(jQuery);

$(document).ready(function() {
	var menuConfig = {    
		over: function(){$(this).find(".sub").slideDown("normal")},
		timeout: 0,
		out: function(){$(this).find(".sub").slideUp("fast")},
		interval: 100,
		sensitivity: 1
	};
	$("#menu-main li").hoverIntent(menuConfig);
});
