

// init stuff
$(function (){
		
	var rate = 0.5;
	var time = 350;
	var easing = 'easeInOutSine';
		
	
	
	/*-------------------------------------------------------------------- 
	 * MAIN NAV
	 # hide nested menus
	 # remove top border from first dropdown menu
	 # setup SPAN blocks for the color fade in/out 
	--------------------------------------------------------------------*/	
	var nav = $('#nav');
	var dropdowns = nav.find('>li>ul');
	
	dropdowns.find('li:first-child').addClass('first');
	dropdowns.hide();

	function bgOn() {
		$(this).prev('span').fadeIn('normal');
		var menu = $(this).closest('li').find('ul');
//		var distance = menu.height();
//		var time = parseInt(distance / rate);
		menu.effect('slide', { direction:'up', mode:'show', easing:easing }, time);
	}
	function bgOff() {
		var menu = $(this).closest('li').find('ul');
		menu.fadeOut('fast');
		nav.find('span:visible').fadeOut('fast');
	}
	
	nav
		.find('>li')
		.prepend( $('<span />').hide() )
		.find('>a')
		.css({backgroundPosition:'0 0'} )
		.hoverIntent( bgOn, bgOff );
		


		
		

});

/*-------------------------------------------------------------------- 
 * PLUGINS
--------------------------------------------------------------------*/

// ui.effects - slide, drop
jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);

// lazyload
(function(b){b.xLazyLoader=function(e,d){if(typeof e=="object"){d=e;e="init"}new c()[e](d)};b.xLazyLoader.defaults={js:[],css:[],img:[],name:null,timeout:20000,success:function(){},error:function(){},complete:function(){},each:function(){}};var a=document.getElementsByTagName("head")[0];function c(){var m=this,o,i=[],k=[],j,d,f,e=[];this.init=function(p){if(!p){return}o=b.extend({},b.xLazyLoader.defaults,p);f={js:o.js,css:o.css,img:o.img};b.each(f,function(q,r){if(typeof r=="string"){r=r.split(",")}e=e.concat(r)});if(!e.length){h("error");return}if(o.timeout){j=setTimeout(function(){var q=i.concat(k);b.each(e,function(s,r){b.inArray(r,q)==-1&&k.push(r)});h("error")},o.timeout)}b.each(f,function(q,r){if(b.isArray(r)){b.each(r,function(t,s){l(q,s)})}else{if(typeof r=="string"){l(q,r)}}})};this.js=function(u,v,q){var t=b('script[src*="'+u+'"]');if(t.length){t.attr("pending")?t.bind("scriptload",v):v();return}var r=document.createElement("script");r.setAttribute("type","text/javascript");r.setAttribute("src",u);r.setAttribute("id",q);r.setAttribute("pending",1);r.onerror=n;b(r).bind("scriptload",function(){b(this).removeAttr("pending");v();setTimeout(function(){b(r).unbind("scriptload")},10)});var p=false;r.onload=r.onreadystatechange=function(){if(!p&&(!this.readyState||/loaded|complete/.test(this.readyState))){p=true;r.onload=r.onreadystatechange=null;b(r).trigger("scriptload")}};a.appendChild(r)};this.css=function(q,u,r){if(b('link[href*="'+q+'"]').length){u();return}var s=b('<link rel="stylesheet" type="text/css" media="all" href="'+q+'" id="'+r+'"></link>')[0];if(b.browser.msie){s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&u()}}else{if(b.browser.opera){s.onload=u}else{var p=location.hostname.replace("www.",""),t=/http:/.test(q)?/^(\w+:)?\/\/([^\/?#]+)/.exec(q)[2]:p;p!=t&&b.browser.mozilla?u():(function(){try{s.sheet.cssRules}catch(v){d=setTimeout(arguments.callee,20);return}u()})()}}a.appendChild(s)};this.img=function(q,r){var p=new Image();p.onload=r;p.onerror=n;p.src=q};this.disable=function(p){b("#lazy-loaded-"+p,a).attr("disabled","disabled")};this.enable=function(p){b("#lazy-loaded-"+p,a).removeAttr("disabled")};this.destroy=function(p){b("#lazy-loaded-"+p,a).remove()};function l(q,p){m[q](p,function(r){r=="error"?k.push(p):i.push(p)&&o.each(p);g()},"lazy-loaded-"+(o.name?o.name:new Date().getTime()))}function h(p){o.complete(p,i,k);o[p](p=="error"?k:i);clearTimeout(j);clearTimeout(d)}function g(){if(i.length==e.length){h("success")}else{if(i.length+k.length==e.length){h("error")}}}function n(){k.push(this.src);g()}}})(jQuery);

// idTabs
(function(){var a=function(){(function(b){b.fn.idTabs=function(){var e={};for(var d=0;d<arguments.length;++d){var c=arguments[d];switch(c.constructor){case Object:b.extend(e,c);break;case Boolean:e.change=c;break;case Number:e.start=c;break;case Function:e.click=c;break;case String:if(c.charAt(0)=="."){e.selected=c}else{if(c.charAt(0)=="!"){e.event=c}else{e.start=c}}break}}if(typeof e["return"]=="function"){e.change=e["return"]}return this.each(function(){b.idTabs(this,e)})};b.idTabs=function(e,d){var h=(b.metadata)?b(e).metadata():{};var f=b.extend({},b.idTabs.settings,h,d);if(f.selected.charAt(0)=="."){f.selected=f.selected.substr(1)}if(f.event.charAt(0)=="!"){f.event=f.event.substr(1)}if(f.start==null){f.start=-1}var c=function(){if(b(this).is("."+f.selected)){return f.change}var m="#"+this.href.split("#")[1];var k=[];var l=[];b("a",e).each(function(){if(this.href.match(/#/)){k.push(this);l.push("#"+this.href.split("#")[1])}});if(f.click&&!f.click.apply(this,[m,l,e,f])){return f.change}for(i in k){b(k[i]).removeClass(f.selected)}for(i in l){b(l[i]).hide()}b(this).addClass(f.selected);b(m).show();return f.change};var g=b(e).find("a[href*='#']").unbind(f.event,c).bind(f.event,c);g.each(function(){b("#"+this.href.split("#")[1]).hide()});var j=false;if((j=g.filter("."+f.selected)).length){}else{if(typeof f.start=="number"&&(j=g.eq(f.start)).length){}else{if(typeof f.start=="string"&&(j=g.filter("[href*='#"+f.start+"']")).length){}}}if(j){j.removeClass(f.selected);j.trigger(f.event)}return f};b.idTabs.settings={start:0,change:false,click:null,selected:".selected",event:"!click"};b.idTabs.version="2.2";b(function(){b(".toggler,.tabs").idTabs()})})(jQuery)};a()})();

// scrollable
(function(c){c.tools=c.tools||{};c.tools.scrollable={version:"1.1.1",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var d,a=0;function b(q,o,m){var t=this,r=c(this),e=!o.vertical,f=q.children(),l=0,j;if(!d){d=t}c.each(o,function(u,v){if(c.isFunction(v)){r.bind(u,v)}});if(f.length>1){f=c(o.items,q)}function n(v){var u=c(v);return m==1||u.length==1||o.globalNav?u:q.parent().find(v)}q.data("finder",n);var g=n(o.prev),i=n(o.next),h=n(o.prevPage),p=n(o.nextPage);c.extend(t,{getIndex:function(){return l},getClickIndex:function(){var u=t.getItems();return u.index(u.filter("."+o.activeClass))},getConf:function(){return o},getSize:function(){return t.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/o.size)},getPageIndex:function(){return Math.ceil(l/o.size)},getNaviButtons:function(){return g.add(i).add(h).add(p)},getRoot:function(){return q},getItemWrap:function(){return f},getItems:function(){return f.children(o.item)},getVisibleItems:function(){return t.getItems().slice(l,l+o.size)},seekTo:function(u,y,v){if(u<0){u=0}if(l===u){return t}if(y===undefined){y=o.speed}if(c.isFunction(y)){v=y;y=o.speed}if(u>t.getSize()-o.size){return o.loop?t.begin():this.end()}var w=t.getItems().eq(u);if(!w.length){return t}var x=c.Event("onBeforeSeek");r.trigger(x,[u]);if(x.isDefaultPrevented()){return t}function z(){if(v){v.call(t)}r.trigger("onSeek",[u])}if(e){f.animate({left:-w.position().left},y,o.easing,z)}else{f.animate({top:-w.position().top},y,o.easing,z)}d=t;l=u;return t},move:function(w,v,u){j=w>0;return this.seekTo(l+w,v,u)},next:function(v,u){return this.move(1,v,u)},prev:function(v,u){return this.move(-1,v,u)},movePage:function(y,x,w){j=y>0;var u=o.size*y;var v=l%o.size;if(v>0){u+=(y>0?-v:o.size-v)}return this.move(u,x,w)},prevPage:function(v,u){return this.movePage(-1,v,u)},nextPage:function(v,u){return this.movePage(1,v,u)},setPage:function(v,w,u){return this.seekTo(v*o.size,w,u)},begin:function(v,u){j=false;return this.seekTo(0,v,u)},end:function(v,u){j=true;var w=this.getSize()-o.size;return w>0?this.seekTo(w,v,u):t},reload:function(){r.trigger("onReload");return t},bind:function(u,v){r.bind(u,v);return t},onBeforeSeek:function(u){return this.bind("onBeforeSeek",u)},onSeek:function(u){return this.bind("onSeek",u)},onReload:function(u){return this.bind("onReload",u)},unbind:function(u){r.unbind(u);return t},focus:function(){d=t;return t},click:function(w){var x=t.getItems().eq(w),u=o.activeClass,v=o.size;if(w<0||w>=t.getSize()){return t}if(v==1){if(o.loop){return t.next()}if(w===0||w==t.getSize()-1){j=(j===undefined)?true:!j}return j===false?t.prev():t.next()}if(v==2){if(w==l){w--}t.getItems().removeClass(u);x.addClass(u);return t.seekTo(w,time,fn)}if(!x.hasClass(u)){t.getItems().removeClass(u);x.addClass(u);var z=Math.floor(v/2);var y=w-z;if(y>t.getSize()-v){y=t.getSize()-v}if(y!==w){return t.seekTo(y)}}return t}});g.addClass(o.disabledClass).click(function(){t.prev()});i.click(function(){t.next()});p.click(function(){t.nextPage()});h.addClass(o.disabledClass).click(function(){t.prevPage()});t.onSeek(function(v,u){if(u===0){g.add(h).addClass(o.disabledClass)}else{g.add(h).removeClass(o.disabledClass)}if(u>=t.getSize()-o.size){i.add(p).addClass(o.disabledClass)}else{i.add(p).removeClass(o.disabledClass)}});var k=o.hoverClass,s="keydown."+Math.random().toString().substring(10);t.onReload(function(){if(k){t.getItems().hover(function(){c(this).addClass(k)},function(){c(this).removeClass(k)})}if(o.clickable){t.getItems().each(function(u){c(this).unbind("click.scrollable").bind("click.scrollable",function(v){if(c(v.target).is("a")){return}return t.click(u)})})}if(o.keyboard){c(document).unbind(s).bind(s,function(u){if(u.altKey||u.ctrlKey){return}if(o.keyboard!="static"&&d!=t){return}var v=o.keyboardSteps;if(e&&(u.keyCode==37||u.keyCode==39)){t.move(u.keyCode==37?-v:v);return u.preventDefault()}if(!e&&(u.keyCode==38||u.keyCode==40)){t.move(u.keyCode==38?-v:v);return u.preventDefault()}return true})}else{c(document).unbind(s)}});t.reload()}c.fn.scrollable=function(e){var f=this.eq(typeof e=="number"?e:0).data("scrollable");if(f){return f}var g=c.extend({},c.tools.scrollable.conf);e=c.extend(g,e);e.keyboardSteps=e.keyboardSteps||e.size;a+=this.length;this.each(function(){f=new b(c(this),e);c(this).data("scrollable",f)});return e.api?f:this}})(jQuery);

// 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);

// gallery popups + blockui
(function(a){if(!a.Kapow){a.Kapow=new Object()}a.Kapow.Gallery=function(b,c){var d=this;d.$container=a(b);d.init=function(){d.options=a.extend({},a.Kapow.Gallery.defaultOptions,c);d.current=null;d.$images=d.$container.find("a");var e='<div id="gallery-popup"><p class="toolbar"><a href="#close" class="close">Close</a><a href="#prev" class="prev" rel="prev">Previous</a><a href="#next" class="next" rel="next">Next</a><span></span></p><div class="content"></div></div>';a("body").append(e);d.$popup=a("#gallery-popup").hide();d.$close=d.$popup.find(".toolbar > .close");d.$status=d.$popup.find(".toolbar > span");d.$content=d.$popup.find(".content");d.$images.click(d.launch);d.$close.click(d.remove);d.$popup.find("a[rel=next],a[rel=prev]").click(function(){a(this).blur();d.go_to_index(a(this).attr("rel"));return false})};d.launch=function(){var g=a(this);var f=g.attr("href");var e=d.get_position();d.current=d.$images.index(g);d.$popup.css(e).fadeIn(d.options.speed);a.blockUI({baseZ:999,fadeIn:d.options.speed,fadeOut:d.options.speed,overlayCSS:{background:"#000000",opacity:0.8},onUnblock:d.unbind_remove});d.get_content(f);d.bind_remove();return false};d.get_content=function(e){d.$popup.block({fadeIn:d.options.speed,fadeOut:d.options.speed});d.$content.load(e,function(){d.$popup.unblock();d.$status.text("Image "+(d.current+1)+" of "+d.$images.length)})};d.remove=function(){a.unblockUI();d.$popup.fadeOut(d.options.speed);return false};d.get_position=function(){var g=700;var f=a().scrollTop()+25;var e=parseInt((a(window).width()-g)/2);return{top:f,left:e}};d.get_pagination=function(){var e=d.current<d.$images.length-1?d.current+1:0;var f=d.current>0?d.current-1:d.$images.length-1;return{prev:f,next:e}};d.go_to_index=function(h){var e=d.get_pagination();var f=e[h];var i=d.$images.eq(f);var g=i.attr("href");d.current=f;d.$popup.css(d.get_position());d.get_content(g);return false};d.bind_remove=function(){document.onkeyup=function(f){if(f===null){keycode=event.keyCode}else{keycode=f.which}if(keycode==27){d.remove()}}};d.unbind_remove=function(){document.onkeydown="";document.onkeyup=""};d.init()};a.Kapow.Gallery.defaultOptions={speed:400};a.fn.kapow_Gallery=function(b){return this.each(function(){(new a.Kapow.Gallery(this,b))})}})(jQuery);(function(v){if(/1\.(0|1|2)\.(0|1|2)/.test(v.fn.jquery)||/^1.1/.test(v.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+v.fn.jquery);return}v.fn._fadeIn=v.fn.fadeIn;var t=document.documentMode||0;var y=v.browser.msie&&((v.browser.version<8&&!t)||t<8);var x=v.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!t;v.blockUI=function(a){z(window,a)};v.unblockUI=function(a){u(window,a)};v.fn.block=function(a){return this.unblock({fadeOut:0}).each(function(){if(v.css(this,"position")=="static"){this.style.position="relative"}if(v.browser.msie){this.style.zoom=1}z(this,a)})};v.fn.unblock=function(a){return this.each(function(){u(this,a)})};v.blockUI.version=2.23;v.blockUI.defaults={message:null,css:{},overlayCSS:{backgroundColor:"#fff",opacity:1,cursor:"wait"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null,quirksmodeOffsetHack:4};var A=null;var w=[];function z(d,g){var f=(d==window);var b=g&&g.message!==undefined?g.message:undefined;g=v.extend({},v.blockUI.defaults,g||{});g.overlayCSS=v.extend({},v.blockUI.defaults.overlayCSS,g.overlayCSS||{});var h=v.extend({},v.blockUI.defaults.css,g.css||{});b=b===undefined?g.message:b;if(f&&A){u(window,{fadeOut:0})}if(b&&typeof b!="string"&&(b.parentNode||b.jquery)){var n=b.jquery?b[0]:b;var i={};v(d).data("blockUI.history",i);i.el=n;i.parent=n.parentNode;i.display=n.style.display;i.position=n.style.position;if(i.parent){i.parent.removeChild(n)}}var c=g.baseZ;var j=(v.browser.msie||g.forceIframe)?v('<iframe class="blockUI" style="z-index:'+(c++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+g.iframeSrc+'"></iframe>'):v('<div class="blockUI" style="display:none"></div>');var k=v('<div class="blockUI blockOverlay" style="z-index:'+(c++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var J=f?v('<div class="blockUI blockMsg blockPage" style="z-index:'+c+';display:none;position:fixed"></div>'):v('<div class="blockUI blockMsg blockElement" style="z-index:'+c+';display:none;position:absolute"></div>');if(b){J.css(h)}if(!g.applyPlatformOpacityRules||!(v.browser.mozilla&&/Linux/.test(navigator.platform))){k.css(g.overlayCSS)}k.css("position",f?"fixed":"absolute");if(v.browser.msie||g.forceIframe){j.css("opacity",0)}v([j[0],k[0],J[0]]).appendTo(f?"body":d);var H=y&&(!v.boxModel||v("object,embed",f?null:d).length>0);if(x||H){if(f&&g.allowBodyStretch&&v.boxModel){v("html,body").css("height","100%")}if((x||!v.boxModel)&&!f){var m=q(d,"borderTopWidth"),l=q(d,"borderLeftWidth");var I=m?"(0 - "+m+")":0;var e=l?"(0 - "+l+")":0}v.each([j,k,J],function(F,C){var G=C[0].style;G.position="absolute";if(F<2){f?G.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+g.quirksmodeOffsetHack+') + "px"'):G.setExpression("height",'this.parentNode.offsetHeight + "px"');f?G.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):G.setExpression("width",'this.parentNode.offsetWidth + "px"');if(e){G.setExpression("left",e)}if(I){G.setExpression("top",I)}}else{if(g.centerY){if(f){G.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}G.marginTop=0}else{if(!g.centerY&&f){var E=(g.css&&g.css.top)?parseInt(g.css.top):0;var D="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+E+') + "px"';G.setExpression("top",D)}}}})}if(b){J.append(b);if(b.jquery||b.nodeType){v(b).show()}}if((v.browser.msie||g.forceIframe)&&g.showOverlay){j.show()}if(g.fadeIn){if(g.showOverlay){k._fadeIn(g.fadeIn)}if(b){J.fadeIn(g.fadeIn)}}else{if(g.showOverlay){k.show()}if(b){J.show()}}r(1,d,g);if(f){A=J[0];w=v(":input:enabled:visible",A);if(g.focusInput){setTimeout(o,20)}}else{B(J[0],g.centerX,g.centerY)}if(g.timeout){var a=setTimeout(function(){f?v.unblockUI(g):v(d).unblock(g)},g.timeout);v(d).data("blockUI.timeout",a)}}function u(d,c){var e=d==window;var f=v(d);var b=f.data("blockUI.history");var a=f.data("blockUI.timeout");if(a){clearTimeout(a);f.removeData("blockUI.timeout")}c=v.extend({},v.blockUI.defaults,c||{});r(0,d,c);var g=e?v("body").children().filter(".blockUI"):v(".blockUI",d);if(e){A=w=null}if(c.fadeOut){g.fadeOut(c.fadeOut);setTimeout(function(){s(g,b,c,d)},c.fadeOut)}else{s(g,b,c,d)}}function s(d,a,b,c){d.each(function(f,e){if(this.parentNode){this.parentNode.removeChild(this)}});if(a&&a.el){a.el.style.display=a.display;a.el.style.position=a.position;if(a.parent){a.parent.appendChild(a.el)}v(a.el).removeData("blockUI.history")}if(typeof b.onUnblock=="function"){b.onUnblock(c,b)}}function r(f,b,a){var c=b==window,d=v(b);if(!f&&(c&&!A||!c&&!d.data("blockUI.isBlocked"))){return}if(!c){d.data("blockUI.isBlocked",f)}if(!a.bindEvents||(f&&!a.showOverlay)){return}var e="mousedown mouseup keydown keypress";f?v(document).bind(e,a,p):v(document).unbind(e,p)}function p(a){if(a.keyCode&&a.keyCode==9){if(A&&a.data.constrainTabKey){var b=w;var c=!a.shiftKey&&a.target==b[b.length-1];var d=a.shiftKey&&a.target==b[0];if(c||d){setTimeout(function(){o(d)},10);return false}}}if(v(a.target).parents("div.blockMsg").length>0){return true}return v(a.target).parents().children().filter("div.blockUI").length==0}function o(b){if(!w){return}var a=w[b===true?w.length-1:0];if(a){a.focus()}}function B(b,g,f){var a=b.parentNode,c=b.style;var e=((a.offsetWidth-b.offsetWidth)/2)-q(a,"borderLeftWidth");var d=((a.offsetHeight-b.offsetHeight)/2)-q(a,"borderTopWidth");if(g){c.left=e>0?(e+"px"):"0"}if(f){c.top=d>0?(d+"px"):"0"}}function q(b,a){return parseInt(v.css(b,a))||0}})(jQuery);

function initMenu() {
  $('#subnav ul').hide();
  $('#subnav li a').hover(
    function() {
		
      var checkElement = $(this).next();
	  
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#subnav ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
				  

  }
$(document).ready(function() {initMenu();});
