$(document).ready(function(){initScreen();$(window).scroll(initScreen).resize(initScreen);slider();$('#nav ul li:first-child').addClass('alpha');$('#nav ul li:last-child').addClass('omega');$('#nav ul:first-child li').addClass('toplevel');$('#nav ul > li').hoverIntent(function(){$(this).find('>ol').fadeIn('fast');var navitemwidth=$(this).width()+60;var navitemoffset=0;$(this).find('ul.sub-menu li a').width(navitemwidth+navitemoffset);},function(){$(this).find('>ol').fadeOut('slow');});});function slider(){$('#sliders div').first().fadeIn('fast');$('#slidercontrols li').click(function(){$(this).siblings().removeClass('selected');$(this).addClass('selected');var i=$(this).index();var divActive=$('#sliders').children().eq(i);var divNotActive=$('#sliders').children().not(divActive);var l=divNotActive.length;var n=1;divNotActive.fadeOut('fast',function(){if(n==l){divActive.fadeIn('fast');}
n++;});});};function initScreen(){var wh=$(window).height();var ww=$(window).width();var dh=$(document).height();var dw=960;var dbh=$(document.body).height();var sbw=15;var sd=ww/wh;var iw=1024;var ih=768;var idim=iw/ih;};(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:5,timeout:50};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 ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseenter"){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.bind('mouseenter',handleHover).bind('mouseleave',handleHover);};})(jQuery);
