// FUNCIONES DE JQUERY
$(document).ready(function() {
				
	// Preload all rollovers
	$("#menu #botones img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#menu #botones a").mouseover(function(){		
		imgsrc = $(this).children("img").attr("src");
		matches = imgsrc.match(/-over/);
		
		// don't do the rollover if state is already ON
		if (!matches) {			
			imgsrcON = imgsrc.replace(/.gif$/ig,"-over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			
			$("#menu #botones a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);								 
			});		
		}
	});
	
		// Preload all rollovers
	$("#menu #submenu img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#menu #submenu a").mouseover(function(){		
		imgsrc = $(this).children("img").attr("src");
		matches = imgsrc.match(/-over/);
		
		// don't do the rollover if state is already ON
		if (!matches) {			
			imgsrcON = imgsrc.replace(/.gif$/ig,"-over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			
			$("#menu #submenu a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);								 
			});		
		}
	});
	
	
	//BOTON SERVICIO			
	$("#menu #botones img").mouseover(function(){
		idBoton = $(this).attr("id");
		
		if (idBoton=="botServicios")
		{
			$("#submenu").css("display","block");
			$("#submenuhit").css("display","block");
		}
		else
		{
			$("#submenu").css("display","none");
			$("#submenuhit").css("display","none");
		}
	});	
	
	$("#submenuhit").mouseout(function(){
		$("#submenu").css("display","none");
		$("#submenuhit").css("display","none");
	});	
	
});

		
