 jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a+c:-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a+c:b/
2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a*a+c:-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){return(a/=d/2)<1?b/2*a*a*a*a*a+c:b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,a,c,b,d){return-b*Math.cos(a/
d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return a==0?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){return a==0?c:a==d?c+b:(a/=d/2)<1?b/2*Math.pow(2,10*(a-1))+c:b/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*
a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){return(a/=d/2)<1?-b/2*(Math.sqrt(1-a*a)-1)+c:b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=
d)==1)return c+b;f||(f=d*0.3);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(a==0)return c;if((a/=d/2)==2)return c+b;f||(f=d*0.3*1.5);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return a<1?-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c:g*Math.pow(2,-10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)*0.5+b+c},easeInBack:function(e,a,c,b,d,f){f==void 0&&
(f=1.70158);return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){f==void 0&&(f=1.70158);return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){f==void 0&&(f=1.70158);return(a/=d/2)<1?b/2*a*a*(((f*=1.525)+1)*a-f)+c:b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*
(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){return a<d/2?jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c:jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c}});

		var c = false;
							var pause = 0;



			function aniLoop()

			{   

			  var element = ".s";

			  var interval = 20000;

			  var container_width = 766;

			  

			  if(pause == 0)

			  {

				 pause = 1;

				 

				 $(element).animate({"backgroundPositionX":"+=250px"}, interval, 'linear', function()

				 {

					pause = 0;

					aniLoop();

				 });

			  }

			}

			
		$(function(){
				$("#screen").fadeOut(600);

				

				$("#cTop a").hover(function(){
								$(this).parent("#cTop").children("a").not(this).stop().animate({opacity:.2},600);
								$(this).stop().animate({opacity:1},300);
								
								$("#title").html($(this).attr("title"));
								});
		
		
				$(".drop").click(function(){//FALL
							c=true;
							$(".s").animate({"height":"480px"}, 2000, 'easeOutBounce',function(){pause = 0;aniLoop();});		
							$(".heli").css({"top":"480px"});		
							
							
							});						
							
				$(".drop").hover(function(){//PEAK
							if(!c){$(".s").animate({"height":"10px"}, 200);}
							},function(){
							if(!c){$(".s").animate({"height":"0px"}, 200);}
							});
				
				
				$(".lift").click(function(){//LIFT
						pause = 1;
						$(".heli").animate({"top":"215px"}, 1000, 'easeInSine',function(){
								$(".s").stop().animate({"height":"0px"}, 2000, 'easeInSine',function(){c=false;});		
								$(".heli").animate({"top":"-270px"}, 2000, 'easeInSine',function(){
										$(".heli").css({"top":"480px"});	
										});		
								});		

				
					});						
				
				$(".team li").click(function(){
						$(".bio").not($(this).next(".bio")).stop().animate({"width":"0px"}, 300);
						$(".team .desc").stop().animate({"width":0+"px"}, 300);

						$(this).next(".bio").stop().animate({"width":350+"px"}, 300,function(){$(this).css("overflow","auto")});
						});
						
						

				$(".team li.bio").click(function(){
						c = 1;
						$(this).stop().animate({"width":0+"px"}, 300);
						$(".team .desc").stop().animate({"width":350+"px"}, 300);
						});
						
				
				
				$(".team li").hover(function(){
						$(this).children("span").children(".contact").stop().animate({opacity:.5},300);
							},function(){
						$(this).children("span").children(".contact").delay(400).stop().animate({opacity:0},900);
							
							});
							
				$(".contact.person a").hover(function(){
							$(this).parent(".contact").children("a").not(this).stop().animate({opacity:.5},600);
							$(this).stop().animate({opacity:1},600);							
							});
							
							
							
							
			$("#message").submit(function(e){
					e.preventDefault();
					
					$.post("mail.php", $(this).serialize(),function(){
						$(".help").hide();
						$("#message").fadeOut(300);
						$(".soon").show();
						$(".pop").delay(500).fadeOut(2000, "easeInSine");
						});
					});	
					
			$("#message input[type=text]").blur(function(){
							if($(this).val() == ""){$(this).val($(this).attr("name")).addClass("wait");}
							});

				$("#message input[type=text]").focus(function(){
							if($(this).val() == $(this).attr("name")){$(this).val("").removeClass("wait");}
							});		
					
					
			$(".x").click(function(e){
					$(".pop").fadeOut(900);
					
					});
					
					
			$(".contact .mail").click(function(){
					$(".pop .who").attr("src",$(this).parent(".contact").parent("span").parent("li").children(".who").attr("src"));
					$("#phone").hide();
					$("#message").show();
					
					$("#whoSend").val($(this).parent(".contact").attr("name"));
					$("#sendButton").val("Send Message to "+($(this).parent(".contact").attr("name") == undefined?"the Team":$(this).parent(".contact").attr("name")));
					
					$(".pop").fadeIn(300);
					return false;

					
					
						});	

			$(".person .phone").click(function(){
					$(".pop .who").attr("src",$(this).parent(".contact").parent("span").parent("li").children(".who").attr("src"));
					$("#phone b").html($(this).attr('name'));
					
					
					$("#phone i").html($(this).parent(".contact").attr("name")+" Can Be Reached At");

					$("#phone").show();
					$("#message,.soon").hide();
					$(".help").show();
					$(".pop").fadeIn(300);
					return false;
						});
						
			$(".act").hover(function(){
							$(this).children(".d").children("span").stop().animate({height:100},300);
							},function(){
							$(this).children(".d").children("span").stop().animate({height:0},300);
							});
			
			});
