$(document).ready(function(){
	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	//Remove outline from links
	$("a").click(function(){
		$(this).blur();
	});
	
	//WHEN LOADED
	$(".slide1").animate({ opacity: 1 }, 0 );
			$(".slide2").animate({ opacity: 0 }, 1 );
		  $(".slide3").animate({ opacity: 0 }, 1 );
		$(".slide4").animate({ opacity: 0 }, 1 );
		$(".slide5").animate({ opacity: 0 }, 1 );
		
		$(".slide1").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		
		$(".slide1").css({'margin-left' : '0px'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'margin-left' : '0px'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'margin-left' : '0px'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'margin-left' : '0px'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'margin-left' : '0px'}); /*Add a higher z-index value so this image stays on top*/ 
		
		$("#blogcat").animate({ opacity: 0 }, 0 );
		$("#popposts").animate({ opacity: 0 }, 0 );
		$("#searchdiv").animate({ opacity: 0 }, 0 );
		$("#tagcloud").animate({ opacity: 0 }, 0 );
		$("#artcat").animate({ opacity: 0 }, 1 );
		$("#info").animate({ opacity: 0 }, 1 );
		$("#blogcat").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#tagcloud").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#artcat").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/
		$("#info").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/
		
		
	
	//POST 1 - When mouse rolls over
	$(".post1_btn").click(function(){
  		$(".slide1").animate({ opacity: 1 }, 1000 );
		$(".slide2").animate({ opacity: 0 }, 1000 );
		  $(".slide3").animate({ opacity: 0 }, 1000 );
		$(".slide4").animate({ opacity: 0 }, 1000 );
		$(".slide5").animate({ opacity: 0 }, 1000 );
		
		$(".slide1").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		
});
		//POST 2 - When mouse rolls over
	$(".post2_btn").click(function(){
  		$(".slide1").animate({ opacity: 0 }, 1000 );
		$(".slide2").animate({ opacity: 1 }, 1000 );
		  $(".slide3").animate({ opacity: 0 }, 1000 );
		$(".slide4").animate({ opacity: 0 }, 1000 );
		$(".slide5").animate({ opacity: 0 }, 1000 );
		
		$(".slide1").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		
});
	
			//POST 3 - When mouse rolls over
	$(".post3_btn").click(function(){
  		$(".slide1").animate({ opacity: 0 }, 1000 );
		$(".slide2").animate({ opacity: 0 }, 1000 );
		  $(".slide3").animate({ opacity: 1 }, 1000 );
		$(".slide4").animate({ opacity: 0 }, 1000 );
		$(".slide5").animate({ opacity: 0 }, 1000 );
		
		$(".slide1").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		
});
	
				//POST 4 - When mouse rolls over
	$(".post4_btn").click(function(){
  		$(".slide1").animate({ opacity: 0 }, 1000 );
		$(".slide2").animate({ opacity: 0 }, 1000 );
		  $(".slide3").animate({ opacity: 0 }, 1000 );
		$(".slide4").animate({ opacity: 1 }, 1000 );
		$(".slide5").animate({ opacity: 0 }, 1000 );
		
				$(".slide1").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		
});
	
				//POST 5 - When mouse rolls over
	$(".post5_btn").click(function(){
  		$(".slide1").animate({ opacity: 0 }, 1000 );
		$(".slide2").animate({ opacity: 0 }, 1000 );
		  $(".slide3").animate({ opacity: 0 }, 1000 );
		$(".slide4").animate({ opacity: 0 }, 1000 );
		$(".slide5").animate({ opacity: 1 }, 1000 );
		
						$(".slide1").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide2").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide3").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide4").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$(".slide5").css({'z-index' : '500'}); /*Add a higher z-index value so this image stays on top*/ 
		
});
	
//CATEGORY SIDEBAR
$(" .cat a").click(function(){
  		$("#blogcat").animate({ opacity: 1 }, 1000 );
		$("#blogcat").css({'z-index' : '9999'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#blogcat").css({'margin-left' : '100px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").animate({ opacity: 0 }, 1000 );
		$("#popposts").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").animate({ opacity: 0 }, 1000 );
		$("#searchdiv").css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#tagcloud").animate({ opacity: 0 }, 1000 );
		$("#tagcloud").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/
		$("#tagcloud").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		
		
});	
		$("#blogcat #close1").click(function(){
  		$("#blogcat").animate({ opacity: 0 }, 1000 );
		
});	
		
		
		
$(" .pop a").click(function(){
  		$("#blogcat").animate({ opacity: 0 }, 1000 );
		$("#blogcat").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#blogcat").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").animate({ opacity: 1 }, 1000 );
		$("#popposts").css({'z-index' : '9999'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").css({'margin-left' : '100px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").animate({ opacity: 0 }, 1000 );
		$("#searchdiv").css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#tagcloud").animate({ opacity: 0 }, 1000 );
		$("#tagcloud").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/
		$("#tagcloud").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		
});	
		$("#popposts #close2").click(function(){
  		$("#popposts").animate({ opacity: 0 }, 1000 );
		
});	
		
		
		
$(" .search a").click(function(){
  		$("#blogcat").animate({ opacity: 0 }, 1000 );
		$("#blogcat").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#blogcat").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").animate({ opacity: 0 }, 1000 );
		$("#popposts").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").animate({ opacity: 1 }, 1000 );
		$("#searchdiv").css({'z-index' : '9999'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").css({'margin-left' : '100px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#tagcloud").animate({ opacity: 0 }, 1000 );
		$("#tagcloud").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/
		$("#tagcloud").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		
});	
		$("#searchdiv #close3").click(function(){
  		$("#searchdiv").animate({ opacity: 0 }, 1000 );
		
});	
		
		
		
		$(" .tags a").click(function(){
  		$("#blogcat").animate({ opacity: 0 }, 1000 );
		$("#blogcat").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#blogcat").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").animate({ opacity: 0 }, 1000 );
		$("#popposts").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#popposts").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").animate({ opacity: 0 }, 1000 );
		$("#searchdiv").css({'z-index' : '1'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#searchdiv").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/ 
		$("#tagcloud").animate({ opacity: 1 }, 1000 );
		$("#tagcloud").css({'z-index' : '9999'}); /*Add a higher z-index value so this image stays on top*/
		$("#tagcloud").css({'margin-left' : '100px'}); /*Add a higher z-index value so this image stays on top*/ 
		
});	
		$("#tagcloud #close4").click(function(){
  		$("#tagcloud").animate({ opacity: 0 }, 1000 );
		
});	
		
		
		
		
				$("#recwork .dropdown a").click(function(){
  		$("#artcat").animate({ opacity: 1 }, 1000 );
		$("#artcat").css({'margin-left' : '509px'}); /*Add a higher z-index value so this image stays on top*/
		

});	
								$("#recwork2 .dropdown a").click(function(){
  		$("#artcat").animate({ opacity: 1 }, 1000 );
		$("#artcat").css({'margin-left' : '620px'}); /*Add a higher z-index value so this image stays on top*/
		

});	
		$("#artcat #close").click(function(){
  		$("#artcat").animate({ opacity: 0 }, 1000 );
		$("#artcat").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/
});	
		
					
		
		
						$("#contact .dropdown a").click(function(){
  		$("#info").animate({ opacity: 1 }, 1000 );
		$("#info").css({'margin-left' : '509px'}); /*Add a higher z-index value so this image stays on top*/

});	
		$("#info #close").click(function(){
  		$("#info").animate({ opacity: 0 }, 1000 );
		$("#info").css({'margin-left' : '-5000px'}); /*Add a higher z-index value so this image stays on top*/
});	
		
		
		
		
		
		
	
	
	
});

	$(function() {
		var step = 5; 
		var current = 0; 
		var maximum = $('#my_carousel ul li').size(); 
		var visible = 2; 
		var speed = 1000; 
		var liSize = 172;
		var carousel_height = 162;
		

		var ulSize = liSize * maximum;   
		var divSize = liSize * visible;  
		
		$('#my_carousel ul').css("width", ulSize+"px").css("left", -(current * liSize)).css("position", "absolute");

		$('#my_carousel').css("width", divSize+"px").css("height", carousel_height+"px").css("visibility", "visible").css("overflow", "hidden").css("position", "relative"); 
		
		$('.right').click(function() { 
			if(current + step < 0 || current + step > maximum - visible) {return; }
			else {
				current = current + step;
				$('#my_carousel ul').animate({left: -(liSize * current)}, speed, null);
			}
			return false;
		});
		
		$('.left').click(function() { 
			if(current - step < 0 || current - step > maximum - visible) {return; }
			else {
				current = current - step;
				$('#my_carousel ul').animate({left: -(liSize * current)}, speed, null);
			}
			return false;
		});
			
	});
	
	
