var z=0; // z-index
	
jQuery(document).ready(function(){

	var config_thumbs = {    
	     over: show, // function = onMouseOver callback (REQUIRED)    
	     sensitivity: 20, // number = milliseconds delay before onMouseOut    
	     out: hide // function = onMouseOut callback (REQUIRED)    
	};


	jQuery("ul#thumb_grid li").hoverIntent( config_thumbs );
	
	
	var config_listing = {    
		     over: slide_in, // function = onMouseOver callback (REQUIRED)    
		     sensitivity: 20, // number = milliseconds delay before onMouseOut    
		     out: slide_out // function = onMouseOut callback (REQUIRED)    
		};
		
		

		jQuery("div.listing_container").hoverIntent( config_listing);
		
		
		/*
		jQuery('#gallery h3').mouseenter(function(){
			
			jQuery(this).css('color', '#cccccc');				
		});
	
		
		jQuery('#gallery h3').mouseleave(function(){
			jQuery(this).css('color', '#464646');				
		}); */

			jQuery("li.gallery_slide h3").click(h3_in);

	/* Create Work Page Gallery */
			

	jQuery('#gallery img').each(function(){
		z++;
		jQuery(this).css('z-index', 100-z);				
	});
			
			
			
		
}); // close document.ready

function show(){
	jQuery("img",this).animate({
    opacity: 0.6

		  }, 400, function() {
		    // Animation complete.
		  });


}

function hide() {

	 jQuery("img",this).animate({
		
		 opacity: 1


		  }, 500, function() {
		    // Animation complete.
		  });
}

function slide_in(){
	jQuery("div",this).animate({
		marginLeft:'-170'

		  }, 400,'easeOutQuad', function() {
		    // Animation complete.
		  });


}

function slide_out() {

	 jQuery("div",this).animate({
		
		 marginLeft:'0'


		  }, 500,'easeOutExpo', function() {
		    // Animation complete.
		  });
}


function h3_in(){
	
	z++; // z-index
	jQuery('img',this.parentNode).css('opacity', 0);
	jQuery('img',this.parentNode).css('z-index', 100+z);	
	jQuery(this).css('color', '#1AF4B0');	
	 
	jQuery('#gallery h3').not(jQuery('h3',this.parentNode)).css('color', '#464646');

	
	jQuery('h3',this.parentNode).animate({
		marginLeft:'-250'


		  }, 200,'easeOutQuad', function() {
		    // Animation complete.
		  });
	
	
jQuery('#gallery h3').not(jQuery('h3',this.parentNode)).animate({
		
		marginLeft:'-310'
		

		  }, 200,'easeOutQuad', function() {
		    // Animation complete.
		  });
	

	jQuery('img',this.parentNode).animate({
		
		opacity:1

		  }, 200,'easeOutQuad', function() {
		    // Animation complete.
		  });
	
	jQuery('#gallery img').not(jQuery('img',this.parentNode)).animate({
		
		opacity:0

		  }, 200,'easeOutQuad', function() {
		    // Animation complete.
		  });
}


