/*

Main Javascript for jQuery Realistic Hover Effect
Created by Adrian Pelletier
http://www.adrianpelletier.com

*/

/* =Realistic Navigation
============================================================================== */

	// Begin jQuery
	
	$(document).ready(function() {

	
	/* =Shadow Nav
	-------------------------------------------------------------------------- */
	
		// BODEGON HOMEPAGE
	
		// Append shadow image to each LI		
		
		
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		  $(".homepage #nav-shadow li").append('<img class="shadow" src="http://www.campeny.com/img/bodegones/ombra_8bit.png" width="145" height="44" alt="" />');
		}
		else
		 $(".homepage #nav-shadow li").append('<img class="shadow" src="http://www.campeny.com/img/bodegones/ombra.png" width="145" height="44" alt="" />');
		 
	
		// Animate buttons, shrink and fade shadow
		
		$(".homepage #nav-shadow li").hover(function() {
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "-24px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "-18px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "135px", height: "40px", marginLeft: "8px", opacity: 0.5 }, 250);
		},function(){
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "4px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "0px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "145px", height: "44px",  marginLeft: "0", opacity: 1 }, 250);
		});
		
		// BODEGONS PRODUCTOS
		
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		  $(".productos #nav-shadow li").append('<img class="shadow" src="http://www.campeny.com/img/bodegones/ombra_8bit.png" width="100" height="30" alt="" />');
		}
		else
		 $(".productos #nav-shadow li").append('<img class="shadow" src="http://www.campeny.com/img/bodegones/ombra.png" width="100" height="30" alt="" />');
		 
	
		// Animate buttons, shrink and fade shadow
		
		$(".productos #nav-shadow li").hover(function() {
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "-24px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "-18px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "90px", height: "28px", marginLeft: "4px", opacity: 0.5 }, 250);
		},function(){
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "4px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "0px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "100px", height: "30px",  marginLeft: "0", opacity: 1 }, 250);
		});
						
	// End jQuery
	
	});
