$(document).ready(function( ){ 
	/*
	/* WORK
	/*
	/***********************/
	
	if($("div.lg_work div.lg_thumbs").attr("class")) {
		
		var i = 1;
		$("div.lg_work div.lg_thumbs img").each(function( ) {
			if(i % 4 == 0) $(this).addClass("lg_img_last");
			i++;
		});
		
		var config = {    
			 sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
			 interval: 200, // number = milliseconds for onMouseOver polling interval    
			 over: thumbs_fadeOut, // function = onMouseOver callback (REQUIRED)    
			 timeout: 200, // number = milliseconds delay before onMouseOut    
			 out: thumbs_fadeIn // function = onMouseOut callback (REQUIRED)    
		};
		
		$("div.lg_work ul li a").hoverIntent(config);
		$("div.lg_work div.lg_thumbs img").hoverIntent(config);
		
		$("div.lg_work ul li a").hover(anchor_addHover, anchor_removeHover);
		$("div.lg_work div.lg_thumbs img").hover(anchor_addHover, anchor_removeHover);
		
	}
	
});

function anchor_addHover( ) {

	var c = $(this).attr("class");
	c = c.split(" ")[0];
	$("div.lg_work ul li a." + c).addClass("hover");

}

function anchor_removeHover( ) {

	var c = $(this).attr("class");
	c = c.split(" ")[0];
	$("div.lg_work ul li a." + c).removeClass("hover");

}

function thumbs_fadeOut( ) {
	
	var c = $(this).attr("class");
	c = c.split(" ")[0];
	$("div.lg_work div.lg_thumbs img:not(img." + c + ")").fadeTo(200, 0.15);
	
	if($("div.lg_work ul li a.hover").attr("class")) {
		var c = $("div.lg_work ul li a.hover").attr("class");
		c = c.split(" ")[0];
		$("div.lg_work div.lg_thumbs img." + c).fadeTo(200, 1);
	}
}

function thumbs_fadeIn( ) {
	
	if(!($("div.lg_work ul li a.hover").attr("class"))) {
		$("div.lg_work div.lg_thumbs img").fadeTo(200, 1);
	}
	
}