$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true,
		continuous: true ,
		pause: 6000,
		prevId: 'first',
		nextId: 'last',
		controlsShow: false,
		controlsBefore: '<div id="controls">',
		controlsAfter: '</div>'
	});
	
	$("#slider_wrapper").easySlider({
		continuous: true ,
		pause: 1000,
		controlsShow: true,
		prevId: 'prevBtn2',
		nextId: 'nextBtn2'
	});
	 
	 $('.bird').css("cursor", "pointer");
	 $('.bird').click(function(){
	 	alert("Twitter feed coming soon");
	 });
	 
	 $("#carousel li img, #carousel2 li img").hover(
      function () {
        $(this).stop().fadeTo("slow", 0.20);
      }, 
      function () {
        $(this).stop().fadeTo("slow", 1);
      }
    );
    
    //For Contact Form
    $("#contact").hide();
    $("#contact3").hide();
	$("#contact_wrapper_inside").hide();
	

	/*
 clicked = true;
     	 
     	 if(clicked == true)
     	 { 
	     	 $("#contact").slideDown("slow", function(){
	     	 		$("#contact3").fadeIn(6000);
	     	 		$("#contact_wrapper_inside").show();
	     	 		clicked = false;
	     	 });
     	}
    
     		$("#contact").slideUp("slow", function(){
	     			$("#contact_wrapper_inside").hide();
	     			clicked = true;
	     	 });	
*/
	
	
	
	
	 $(".contact_btn").click(function () {
     	$("#contact").slideDown("slow", function(){
	     	 		$("#contact3").fadeIn(3000);
	     	 		$("#contact_wrapper_inside").fadeIn("slow");
	     	 });
	 });
	 
	 $(".work_please").click(function(){
	 		$("#contact_wrapper_inside").fadeOut("fast");
	 		$("#contact3").hide();
	 		$("#contact").slideUp("slow");
	 });
    
	
	$('#contact .textField').focus(function(){
		if($(this).attr("value") == "Your Name" || $(this).attr("value") == "Your Email")
		{
			$(this).val("");
		}
	});
	
	$('#contact .tArea').focus(function(){
		if($(this).html() == "Your Message")
		{
			$(this).html("");
		}
	});

	
	//Hover Effect On Portfolio Items
	$('.portfolio_thumb').hover(
		function(){
			$(this).css('cursor', 'pointer');
			$(this).find('.portfolio_content').stop().animate({top: '0px'}, {duration:400});
		},
		
		function(){
			$(this).find('.portfolio_content').stop().animate({top: '240px'});
		}
	);

	$('.fade').hide();
	
	$(document).ready(function(){
		/* $(".banner_text2").animate({marginLeft: "30px"}) */
		$(".fade").fadeIn(1200);
	});
	
	
	$("#global_navigation li a").hover(
		function(){
			$("#global_navigation li a").css("opacity", "0.7");
			$(this).css("opacity", "1");
			$(this).addClass("border_nav");
			$(this).stop().animate({paddingLeft: '50px'}, {duration: 100});
		},
		
		function(){
			$("#global_navigation li a").css("opacity", "1");
			$(this).removeClass("border_nav");
			$(this).stop().animate({paddingLeft: '13px'}, {duration: 100});
		}
	);
	
	

	$("#filterable li a").hover(
			function(){
			$("#filterable li a").css("opacity", "0.7");
			$(this).css("opacity", "1");
			$(this).addClass("border_nav2");
			$(this).stop().animate({paddingLeft: '50px'}, {duration: 100});
		},
		
		function(){
			$("#filterable li a").css("opacity", "1");
			$(this).removeClass("border_nav2");
			$(this).stop().animate({paddingLeft: '10px'}, {duration: 100});
		}
			
		);
		
		
		//Filtering
		$("#filterable li a").click(function(){
			
			//If a class has .current remove it
			$("#filterable .current").removeClass("current");
			
			//Add class of current to clicked item.
			$(this).addClass("current");
			
			//Grab Text Inside Of Anchor Tags And Conver to lowercase and remove spaces
			var filterText = $(this).text().toLowerCase().replace(' ', '-');
			
			
			//If the clicked item is equal to all, select all hiden elements and show them, and remove the hidden class
			if(filterText == "all") {
				$("#work .hidden").slideDown("slow").removeClass("hidden");
			}
			else {
				$("#work .portfolio_holder").each(function(){
					if(!$(this).hasClass(filterText))
					{
						$(this).slideUp("slow").fadeOut("slow").addClass("hidden");
					}
					else {
						$(this).slideDown("slow").fadeIn("slow").removeClass("hidden");
					}
				});
			}
			
			//Stop the default anchor action
			return false;
		});



});
