// jQuery Easing
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b}return -c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b}if(t==d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b}return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b}});
/*
	Slimbox v2.02 - The ultimate lightweight Lightbox clone for jQuery
	(c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
	MIT-style license.
*/
(function(w){var E=w(window),u,g,F=-1,o,x,D,v,y,L,s,n=!window.XMLHttpRequest,e=window.opera&&(document.compatMode=="CSS1Compat")&&(w.browser.version>=9.3),m=document.documentElement,l={},t=new Image(),J=new Image(),H,a,h,q,I,d,G,c,A,K;w(function(){w("body").append(w([H=w('<div id="lbOverlay" />')[0],a=w('<div id="lbCenter" />')[0],G=w('<div id="lbBottomContainer" />')[0]]).css("display","none"));h=w('<div id="lbImage" />').appendTo(a).append(q=w('<div style="position: relative;" />').append([I=w('<a id="lbPrevLink" href="#" />').click(B)[0],d=w('<a id="lbNextLink" href="#" />').click(f)[0]])[0])[0];c=w('<div id="lbBottom" />').appendTo(G).append([w('<a id="lbCloseLink" href="#" />').add(H).click(C)[0],A=w('<div id="lbCaption" />')[0],K=w('<div id="lbNumber" />')[0],w('<div style="clear: both;" />')[0]])[0]});w.slimbox=function(O,N,M){u=w.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},M);if(typeof O=="string"){O=[[O,N]];N=0}y=E.scrollTop()+((e?m.clientHeight:E.height())/2);L=u.initialWidth;s=u.initialHeight;w(a).css({top:Math.max(0,y-(s/2)),width:L,height:s,marginLeft:-L/2}).show();v=n||(H.currentStyle&&(H.currentStyle.position!="fixed"));if(v){H.style.position="absolute"}w(H).css("opacity",u.overlayOpacity).fadeIn(u.overlayFadeDuration);z();k(1);g=O;u.loop=u.loop&&(g.length>1);return b(N)};w.fn.slimbox=function(M,P,O){P=P||function(Q){return[Q.href,Q.title]};O=O||function(){return true};var N=this;return N.unbind("click").click(function(){var S=this,U=0,T,Q=0,R;T=w.grep(N,function(W,V){return O.call(S,W,V)});for(R=T.length;Q<R;++Q){if(T[Q]==S){U=Q}T[Q]=P(T[Q],Q)}return w.slimbox(T,U,M)})};function z(){var N=E.scrollLeft(),M=e?m.clientWidth:E.width();w([a,G]).css("left",N+(M/2));if(v){w(H).css({left:N,top:E.scrollTop(),width:M,height:E.height()})}}function k(M){w("object").add(n?"select":"embed").each(function(O,P){if(M){w.data(P,"slimbox",P.style.visibility)}P.style.visibility=M?"hidden":w.data(P,"slimbox")});var N=M?"bind":"unbind";E[N]("scroll resize",z);w(document)[N]("keydown",p)}function p(O){var N=O.keyCode,M=w.inArray;return(M(N,u.closeKeys)>=0)?C():(M(N,u.nextKeys)>=0)?f():(M(N,u.previousKeys)>=0)?B():false}function B(){return b(x)}function f(){return b(D)}function b(M){if(M>=0){F=M;o=g[F][0];x=(F||(u.loop?g.length:0))-1;D=((F+1)%g.length)||(u.loop?0:-1);r();a.className="lbLoading";l=new Image();l.onload=j;l.src=o}return false}function j(){a.className="";w(h).css({backgroundImage:"url("+o+")",visibility:"hidden",display:""});w(q).width(l.width);w([q,I,d]).height(l.height);w(A).html(g[F][1]||"");w(K).html((((g.length>1)&&u.counterText)||"").replace(/{x}/,F+1).replace(/{y}/,g.length));if(x>=0){t.src=g[x][0]}if(D>=0){J.src=g[D][0]}L=h.offsetWidth;s=h.offsetHeight;var M=Math.max(0,y-(s/2));if(a.offsetHeight!=s){w(a).animate({height:s,top:M},u.resizeDuration,u.resizeEasing)}if(a.offsetWidth!=L){w(a).animate({width:L,marginLeft:-L/2},u.resizeDuration,u.resizeEasing)}w(a).queue(function(){w(G).css({width:L,top:M+s,marginLeft:-L/2,visibility:"hidden",display:""});w(h).css({display:"none",visibility:"",opacity:""}).fadeIn(u.imageFadeDuration,i)})}function i(){if(x>=0){w(I).show()}if(D>=0){w(d).show()}w(c).css("marginTop",-c.offsetHeight).animate({marginTop:0},u.captionAnimationDuration);G.style.visibility=""}function r(){l.onload=null;l.src=t.src=J.src=o;w([a,h,c]).stop(true);w([I,d,h,G]).hide()}function C(){if(F>=0){r();F=x=D=-1;w(a).hide();w(H).stop().fadeOut(u.overlayFadeDuration,k)}return false}})(jQuery);

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
jQuery(function($) {
	$("a[rel^='lightbox']").slimbox({overlayOpacity: 0.45, loop: true, resizeEasing: 'jswing', resizeDuration: 750}, null, function(el) {
		return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
	});
});
// jCarousel LITE
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,o.easing,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);
//JQ Windows Engine
var jqWindowsEngineZIndex=100;(function($){$.fn.newWindow=function(options){var lastMouseX=0;var lastMouseY=0;var defaults={windowTitle:"",content:"",ajaxURL:"",width:200,height:200,posx:50,posy:50,onDragBegin:null,onDragEnd:null,onResizeBegin:null,onResizeEnd:null,statusBar:true,minimizeButton:true,minimizeIcon:"-",maximizeButton:true,maximizeIcon:"O",closeButton:true,closeIcon:"X",draggable:true,resizeable:true,resizeIcon:"#",windowType:"standard"};var options=$.extend(defaults,options);$windowContainer=$('<div class="window-container"></div>');$windowTitleBar=$('<div class="window-titleBar"></div>');$windowMinimizeButton=$('<div class="window-minimizeButton"></div>');$windowMaximizeButton=$('<div class="window-maximizeButton"></div>');$windowCloseButton=$('<div class="window-closeButton"></div>');$windowContent=$('<div class="window-content"></div>');$windowStatusBar=$('<div class="window-statusBar"></div>');$windowResizeIcon=$('<div class="window-resizeIcon"></div>');if(options.windowType=="video"||options.windowType=="iframe"){$windowContent.css("overflow","hidden")}var setFocus=function($obj){$obj.css("z-index",jqWindowsEngineZIndex++)};var resize=function($obj,width,height){$obj.attr("lastWidth",width).attr("lastHeight",height).css("width",width).css("height",height);if(options.windowType=="video"){$obj.children(".window-content").children("embed").css("width",width).css("height",height);$obj.children(".window-content").children("object").css("width",width).css("height",height);$obj.children(".window-content").children().children("embed").css("width",width).css("height",height);$obj.children(".window-content").children().children("object").css("width",width).css("height",height)}if(options.windowType=="iframe"){$obj.children(".window-content").children("iframe").css("width",width).css("height",height)}};var move=function($obj,x,y){$obj.attr("lastX",x).attr("lastY",y).css("left",x).css("top",y)};var dragging=function(e,$obj){if(options.draggable){e=e?e:window.event;var newx=parseInt($obj.css("left"))+(e.clientX-lastMouseX);var newy=parseInt($obj.css("top"))+(e.clientY-lastMouseY);lastMouseX=e.clientX;lastMouseY=e.clientY;move($obj,newx,newy)}};var resizing=function(e,$obj){e=e?e:window.event;var w=parseInt($obj.css("width"));var h=parseInt($obj.css("height"));w=w<100?100:w;h=h<50?50:h;var neww=w+(e.clientX-lastMouseX);var newh=h+(e.clientY-lastMouseY);lastMouseX=e.clientX;lastMouseY=e.clientY;resize($obj,neww,newh)};$windowTitleBar.bind("mousedown",function(e){$obj=$(e.target).parent();setFocus($obj);if($obj.attr("state")=="normal"){e=e?e:window.event;lastMouseX=e.clientX;lastMouseY=e.clientY;$(document).bind("mousemove",function(e){dragging(e,$obj)});$(document).bind("mouseup",function(e){if(options.onDragEnd!=null){options.onDragEnd()}$(document).unbind("mousemove");$(document).unbind("mouseup")});if(options.onDragBegin!=null){options.onDragBegin()}}});$windowResizeIcon.bind("mousedown",function(e){$obj=$(e.target).parent().parent();setFocus($obj);if($obj.attr("state")=="normal"){e=e?e:window.event;lastMouseX=e.clientX;lastMouseY=e.clientY;$(document).bind("mousemove",function(e){resizing(e,$obj)});$(document).bind("mouseup",function(e){if(options.onResizeEnd!=null){options.onResizeEnd()}$(document).unbind("mousemove");$(document).unbind("mouseup")});if(options.onResizeBegin!=null){options.onResizeBegin()}}});$windowMinimizeButton.bind("click",function(e){$obj=$(e.target).parent().parent();setFocus($obj);if($obj.attr("state")=="normal"){$(e.target).parent().next().slideToggle("slow")}});$windowMaximizeButton.bind("click",function(e){$obj=$(e.target).parent().parent();setFocus($obj);if($obj.attr("state")=="normal"){if(options.windowType=="standard"){$obj.animate({top:"5px",left:"5px",width:$(window).width()-15,height:$(window).height()-45},"slow")}else{tmpx=$obj.attr("lastX");tmpy=$obj.attr("lastY");tmpwidth=$obj.attr("lastWidth");tmpheight=$obj.attr("lastHeight");move($obj,5,5);resize($obj,$(window).width()-15,$(window).height()-45);$obj.attr("lastX",tmpx);$obj.attr("lastY",tmpy);$obj.attr("lastWidth",tmpwidth);$obj.attr("lastHeight",tmpheight)}$obj.attr("state","maximized")}else{if($obj.attr("state")=="maximized"){if(options.windowType=="standard"){$obj.animate({top:$obj.attr("lastY"),left:$obj.attr("lastX"),width:$obj.attr("lastWidth"),height:$obj.attr("lastHeight")},"slow")}else{tmpx=$obj.attr("lastX");tmpy=$obj.attr("lastY");tmpwidth=$obj.attr("lastWidth");tmpheight=$obj.attr("lastHeight");move($obj,$obj.attr("lastY")+"px",$obj.attr("lastX")+"px");resize($obj,$obj.attr("lastWidth")+"px",$obj.attr("lastHeight")+"px");$obj.attr("lastX",tmpx);$obj.attr("lastY",tmpy);$obj.attr("lastWidth",tmpwidth);$obj.attr("lastHeight",tmpheight)}$obj.attr("state","normal")}}});$windowCloseButton.bind("click",function(e){$(e.target).parent().parent().fadeOut();$(e.target).parent().parent().children(".window-content").html("")});$windowContent.click(function(e){setFocus($(e.target).parent())});$windowStatusBar.click(function(e){setFocus($(e.target).parent())});move($windowContainer,options.posx,options.posy);resize($windowContainer,options.width,options.height);$windowContainer.attr("state","normal");$windowTitleBar.append(options.windowTitle);if(options.minimizeButton){$windowTitleBar.append($windowMinimizeButton)}if(options.maximizeButton){$windowTitleBar.append($windowMaximizeButton)}if(options.closeButton){$windowTitleBar.append($windowCloseButton)}if(options.resizeable){$windowStatusBar.append($windowResizeIcon)}$windowContainer.append($windowTitleBar);$windowContainer.append($windowContent);if(options.statusBar){$windowContainer.append($windowStatusBar)}$windowContainer.css("display","none");return this.each(function(index){var $this=$(this);$windowMinimizeButton.html(options.minimizeIcon);$windowMaximizeButton.html(options.maximizeIcon);$windowCloseButton.html(options.closeIcon);$windowResizeIcon.html(options.resizeIcon);$this.data("window",$windowContainer);$("body").append($windowContainer);$this.click(function(event){event.preventDefault();$window=$this.data("window");if(options.ajaxURL!=""){$window.children(".window-content").load(options.ajaxURL)}else{$window.children(".window-content").html(options.content)}if(!options.draggable){$window.children(".window-titleBar").css("cursor","default")}setFocus($window);$window.fadeIn()})})}})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2009
 * @author Ariel Flesler
 * @version 1.4.1
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);

/*
 * Jonathan Howard
 *
 * jQuery Pause
 * version 0.2
 */

$.fn.pause = function(milli,type) {
	milli = milli || 1000;
	type = type || "fx";
	return this.queue(type,function(){
		var self = this;
		setTimeout(function(){
			$.dequeue(self);
		},milli);
	});
};

$.fn.clearQueue = $.fn.unpause = function(type) {
	return this.each(function(){
		type = type || "fx";
		if(this.queue && this.queue[type]) {
			this.queue[type].length = 0;
		}
	});
};

//update clock function  
function updateClock(){  
	var now = new Date();  
	var hour = now.getHours();  
	var amPm = '<sup class="clock">AM</sup>';
	if(hour > 11) amPm = '<span class="clock brown">PM</span>';
	if(hour > 12) hour = hour - 12;
	else if(hour < 1) hour = hour + 12;
	var mins = now.getMinutes(); 
	if(mins < 10) mins = "0" + mins;
	//print the current time in the clock division  
	$("#clock").html("<p>" + hour + " <span class='blinking clock mid'>:</span> " + mins + "<span class='white'>.</span>" + amPm + "</p>");  
}
function animateAurora(){
	$('#anim_aurora')
		.fadeTo(1650, 0.6)
		.fadeTo(1850, 0.42)
		.fadeTo(1400, 0.73)
		.fadeTo(1500, 0.38);
}

function animateCloud1(){
	$('#anim_cloud1').animate( {left : '-210px'}, 40000, 'linear').animate( {left : '1921px'}, 1);
}
function animateCloud2(){
	$('#anim_cloud2').animate( {left : '-200px'}, 51000, 'linear').animate( {left : '1921px'}, 1);
}
function animateCloud4(){
	$('#anim_cloud4').animate( {left : '-180px'}, 32000, 'linear').animate( {left : '1921px'}, 1);
}
function animateClouds(){
	$('#anim_cloud1')
		.animate( {left : '-210px'}, 6000, 'linear')
		.animate( {left : '1921px'}, 1);
	$('#anim_cloud2')
		.animate( {left : '-200px'}, 22000, 'linear')
		.animate( {left : '1921px'}, 1);
	setInterval('animateCloud1()', 41000);
	setInterval('animateCloud2()', 53000);
	setInterval('animateCloud4()', 40000);
}

function animateSpotlight(){
	$('#anim_spotlight')
	.pause(1500)
	.fadeIn(500)
	.pause(3000)
	.fadeOut(500);
}

function animateBoats(){
	$('#anim_boat1')
		.animate( {left : '101%'}, 50000, 'linear')
		.animate( {left : '-10%'}, 1)
		.pause(2000);
	$('#anim_boat3')
		.animate( {left : '101%'}, 33000, 'linear')
		.animate( {left : '-10%'}, 1)
		.pause(3400);
	setInterval('animateBoat1()', 63000);
	setInterval('animateBoat3()', 111000);
}
function animateBoat1(){
	$('#anim_boat1').animate( {left : '101%'}, 60000, 'linear').animate( {left : '-10%'}, 1);
}
function animateBoat3(){
	$('#anim_boat3').animate( {left : '101%'}, 110000, 'linear').animate( {left : '-10%'}, 1);
}

function animateFlipper(){
	$('#anim_flipper')
		.animate( {top : '1140px'},	{queue:false, duration: 1100} )
		.animate( {left : '250px'},	{duration: 1400, easing:'easeInOutQuad'} )
		.animate( {top : '1136px', left : '254px'},	{duration: 600, easing:'easeOutQuad'} )
		.animate( {top : '1152px', left : '245px'},	{duration: 900, easing:'easeInOutQuad'} )
		.animate( {top : '1140px', left : '250px'},	{duration: 900, easing:'easeInOutQuad'} )
		.animate( {top : '1152px', left : '245px'},	{duration: 900, easing:'easeInOutQuad'} )
		.animate( {top : '1140px', left : '250px'},	{duration: 900, easing:'easeInOutQuad'} )
		.animate( {top : '1152px', left : '245px'},	{duration: 600, easing:'easeInOutQuad'} )
		.animate( {top : '1048px', left : '155px'},	1400, 'easeInOutQuad', function() {
			$('#anim_talkBubble').fadeIn(500).animate( {top : '965px'}, 4000).fadeOut(500);
		}
	);
}

function animateSquirt(){
	squirtBlink();
	$('#anim_squirt')
		.animate( {left: '404px'}, {queue:false, duration: 1800} )
		.animate( {top : '2115px'}, {duration: 1800, easing:'easeInQuad'} )
		.animate( {top : '2125px', left : '400px'}, {duration: 1800, easing:'easeOutQuad'} );
}
function squirtBlink(){
	$('#anim_eyelid')
		.fadeOut(1)
		.pause(3000)
		.fadeIn(1)
		.pause(200)
		.fadeOut(1)
		.pause(500)
		.fadeIn(1)
		.pause(200)
		.fadeOut(1)
		.pause(3000)
		.fadeIn(1)
		.pause(200);
}
function animateFish(){
}
function crabWalk(){
	switch(crab){
		case 0: 
			$('#crabL').css({ "background-position" : "-455px -85px" });
			crab=1;
			break
		case 1:
			$('#crabL').css({ "background-position" : "-455px 0px" });
			crab=0;
			break
	}
}
function animateCrab(){
	$('#anim_crab')
		.animate( {left : '-100px'},	{queue:false, duration: 4500, easing: 'easeInOutSine'} )
		.animate( {top : '2805px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2815px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2810px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2820px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2815px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2825px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2820px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2830px'},	750, 'easeInOutQuad', function(){ 
	$('#anim_crab')	
		.animate( {left : '175px'},	{queue:false, duration: 4500, easing: 'easeInOutSine'} )
		.animate( {top : '2820px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2825px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2815px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2820px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2810px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2815px'},	{duration: 375, easing:'easeInOutBounce'} )
		.animate( {top : '2805px'},	{duration: 750, easing:'easeInOutBounce'} )
		.animate( {top : '2800px'},	{duration: 375, easing:'easeInOutBounce'} );	}
	);
}
function animateSeahorse(){
	$('#anim_horsefish')
		.animate( {top : '2975px'}, {queue:false, duration: 500, easing: 'easeInSine'} )
		.animate( {left : '795px'}, {duration: 500, easing: 'easeInOutQuad'} )
		.animate( {left : '795px'}, {duration: 1000, easing: 'easeInOutSine'} )	
		.animate( {top : '3005px', left : '834px'}, {duration: 1500, easing: 'easeInOutSine'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3005px', left : '834px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3005px', left : '834px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3005px', left : '834px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3005px', left : '834px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3005px', left : '834px'}, {duration: 750, easing: 'easeInOutQuad'} )
		.animate( {top : '3000px', left : '840px'}, {duration: 750, easing: 'easeInOutQuad'} );
}

var crab=0;
var toc=0;
var horse=1;
var theWidth = $(window).width();
var aboutPage = 0;



$(function(){
	setInterval("updateClock()", 1000);
	$("#mailer").validate();
	$('.thumb').fadeTo(900, 0.55);
	$('.thumbset span').fadeTo(900, 1);
	$('#fg_black').pause(700).fadeOut(2400);
	$('#anim_talkBubble').fadeOut(1);
	$('#anim_spotlight').fadeOut(1);
	$('#txt1, #txt2, #txt3, #txt4, #txt5').css({ 'position' : 'absolute', 'top' : '0px', 'left' : '0px' });
	$('#txt2, #txt3, #txt4, #txt5').fadeOut(1);
	$.scrollTo('520px', 1);
	$.scrollTo('383px', 3000, {easing: 'easeOutQuad'});  
	animateAurora();
	setInterval("animateAurora()", 6401);
	animateClouds();
	setInterval('animateSpotlight()', 6000);
	animateBoats();
	animateFlipper();
	setInterval('animateFlipper()', 13000);
	setInterval('animateSquirt()', 3610);
	setInterval('squirtBlink()', 7106);
	setInterval('crabWalk()', 250);
	animateCrab();
	setInterval('animateCrab()', 9999);
	animateSeahorse();
	setInterval('animateSeahorse()', 11751);

	$('#toc_overview').hover(function() {
		$(this).css({ "background-position" : "-450px 0px" });
	}, function() {
		$(this).css({ "background-position" : "-450px -50px" });
	});
	$('#toc_about').hover(function() {
		$(this).css({ "background-position" : "-150px 0px" });
	}, function() {
		$(this).css({ "background-position" : "-150px -50px" });
	});
	$('#toc_recent').hover(function() {
		$(this).css({ "background-position" : "0px 0px" });
	}, function() {
		$(this).css({ "background-position" : "0px -50px" });
	});
	$('#toc_services').hover(function() {
		$(this).css({ "background-position" : "-600px 0px" });
	}, function() {
		$(this).css({ "background-position" : "-600px -50px" });
	});
	$('#toc_contact').hover(function() {
		$(this).css({ "background-position" : "-300px 0px" });
	}, function() {
		$(this).css({ "background-position" : "-300px -50px" });
	});

	$('#toc_overview').click(function(e){
		e.preventDefault();
		$.scrollTo('520px', 1750, {easing: 'easeOutQuad'});
	});
	$('#toc_about').click(function(e){
		e.preventDefault();
		$.scrollTo('1400px', 1750, {easing: 'easeOutQuad'});
	});
	$('#toc_recent').click(function(e){
		e.preventDefault();
		$.scrollTo('2220px', 1750, {easing: 'easeOutQuad'});
	});
	$('#toc_services').click(function(e){
		e.preventDefault();
		$.scrollTo('max', 1750, {easing: 'easeOutQuad'});
	});
	$('#toc_contact').click(function(e){
		e.preventDefault();
		$.scrollTo('0px', 1750, {easing: 'easeOutQuad'});
	});
	
	$('#ovrAbout').click(function(e){
		e.preventDefault();
		$.scrollTo('1400px', 1750, {easing: 'easeOutQuad'});
	});
	$('#ovrSvc').click(function(e){
		e.preventDefault();
		$.scrollTo('max', 1750, {easing: 'easeOutQuad'});
	});
	$('#ovrCont').click(function(e){
		e.preventDefault();
		$.scrollTo('0px', 1750, {easing: 'easeOutQuad'});
	});

	
	$('#linkDsc').click(function(e){
		e.preventDefault();
		$('#about0').fadeOut(350);
		$('#about1').pause(300).fadeIn(900);
		$('#aboutReturn').fadeIn(100);
		$('#aboutNavR').fadeIn(100);
		aboutPage = 1;
	});
	$('#linkDsn').click(function(e){
		e.preventDefault();
		$('#about0').fadeOut(350);
		$('#about2').pause(300).fadeIn(900);
		$('#aboutReturn').fadeIn(100);
		$('#aboutNavL').fadeIn(100);
		$('#aboutNavR').fadeIn(100);
		aboutPage = 2;
	});
	$('#linkDvp').click(function(e){
		e.preventDefault();
		$('#about0').fadeOut(350);
		$('#about3').pause(300).fadeIn(900);
		$('#aboutReturn').fadeIn(100);
		$('#aboutNavL').fadeIn(100);
		$('#aboutNavR').fadeIn(100);
		aboutPage = 3;
	});
	$('#linkDpl').click(function(e){
		e.preventDefault();
		$('#about0').fadeOut(350);
		$('#about4').pause(300).fadeIn(900);
		$('#aboutReturn').fadeIn(100);
		$('#aboutNavL').fadeIn(100);
		$('#aboutNavR').fadeIn(100);
		aboutPage = 4;
	});
	$('#linkAux').click(function(e){
		e.preventDefault();
		$('#about0').fadeOut(350);
		$('#about5').pause(300).fadeIn(900);
		$('#aboutReturn').fadeIn(100);
		$('#aboutNavL').fadeIn(100);
		aboutPage = 5;
	});
	$('#aboutNavR').click(function(){
		switch(aboutPage){
			case 1: 
				$('#about1').fadeOut(350);
				$('#about2').pause(300).fadeIn(900);
				$('#aboutNavL').fadeIn(100);
				aboutPage = 2;
				break
			case 2: 
				$('#about2').fadeOut(350);
				$('#about3').pause(300).fadeIn(900);
				aboutPage = 3;
				break
			case 3: 
				$('#about3').fadeOut(350);
				$('#about4').pause(300).fadeIn(900);
				aboutPage = 4;
				break
			case 4: 
				$('#about4').fadeOut(350);
				$('#about5').pause(300).fadeIn(900);
				$('#aboutNavR').fadeOut(100);
				aboutPage = 5;
				break
			case 5: 
				$('#aboutNavR').fadeOut(10);
				aboutPage = 5;
				break
		}
	});
	$('#aboutNavL').click(function(){
		switch(aboutPage){
			case 1: 
				$('#aboutNavL').fadeOut(10);
				aboutPage = 1;
				break
			case 2: 
				$('#about2').fadeOut(350);
				$('#about1').pause(300).fadeIn(900);
				$('#aboutNavL').fadeOut(1000);
				aboutPage = 1;
				break
			case 3: 
				$('#about3').fadeOut(350);
				$('#about2').pause(300).fadeIn(900);
				aboutPage = 2;
				break
			case 4: 
				$('#about4').fadeOut(350);
				$('#about3').pause(300).fadeIn(900);
				aboutPage = 3;
				break
			case 5: 
				$('#about5').fadeOut(350);
				$('#about4').pause(300).fadeIn(900);
				$('#aboutNavR').fadeIn(100);
				aboutPage = 4;
				break
		}
	});
	$('#aboutReturn').click(function(){
		if(aboutPage == 0){
			$('#aboutReturn').fadeOut(10);
			aboutPage = 0;
		} else {
			$('#about1, #about2, #about3, #about4, #about5').fadeOut(350);
			$('#about0').pause(300).fadeIn(900);
			$('#aboutReturn, #aboutNavL, #aboutNavR').fadeOut(100);
			aboutPage = 0;
		}
	});
	
	$(".jCarouselLite").jCarouselLite({
	    btnNext: ".next",
	    btnPrev: ".prev",
	    visible: 1,
	    speed: 1000,
	    easing: "easeInOutExpo",
		circular: false
	});
	$('.prev').css({ "visibility" : "hidden" });

	$('.next').click(function() {
		if(horse==4){}
		else{
			$('.thumb, .thumbset span, .button').stop().animate({ "opacity" : 0 }, 280);
			$('.thumb, .thumbset span, .button').stop().animate({ "opacity" : 0 }, 800);
			if(horse==1){
				$('.prev').css({ "visibility" : "visible" });
				$('#txt1').fadeOut(480);
				$('#txt2').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			if(horse==2){
				$('#txt2').fadeOut(480);
				$('#txt3').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			if(horse==3){
				$('#txt3').fadeOut(480);
				$('#txt4').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			$('.thumb').animate({ "opacity" : 0.55 }, 900);
			$('.thumbset span').animate({ "opacity" : 1 }, 900);
			if(horse==3){
				$('.next').css({ "visibility" : "hidden" });
				$('.prev').animate({ "opacity" : 1 }, 900);
			}
			else{
				$('.button').animate({ "opacity" : 1 }, 900);
			}
			++horse;
		}
	});
	$('.prev').click(function() {
		if(horse==1){}
		else{
			$('.thumb, .thumbset span, .button').stop().animate({ "opacity" : 0 }, 280);
			$('.thumb, .thumbset span, .button').stop().animate({ "opacity" : 0 }, 800);
			if(horse==4){
				$('.next').css({ "visibility" : "visible" });
				$('#txt4').fadeOut(480);
				$('#txt3').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			if(horse==3){
				$('#txt3').fadeOut(480);
				$('#txt2').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			if(horse==2){
				$('#txt2').fadeOut(480);
				$('#txt1').animate({ "top" : 0 }, 1000).fadeIn(500);
			}
			$('.thumb').animate({ "opacity" : 0.55 }, 900);
			$('.thumbset span').animate({ "opacity" : 1 }, 900);
			if(horse==2){
				$('.prev').css({ "visibility" : "hidden" });
				$('.next').animate({ "opacity" : 1 }, 900);
			}
			else{
				$('.button').animate({ "opacity" : 1 }, 900);
			}
			--horse;
		}
	});
	$('.thumb').hover(function() {
		$(this).stop().fadeTo(400, .9);
	}, function() {
		$(this).stop().fadeTo(400, .55);
	});

});
