// FUNCIONES DE JQUERY

$(document).ready(function() {
		
		// Preload all rollovers
		$("#menu img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.jpg$/ig,"_over.jpg");
			$("<img>").attr("src", rollON);
		});
		
		// Navigation rollovers
		$("#menu 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(/.jpg$/ig,"_over.jpg"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		$("#menu a").mouseout(function(){			
			$(this).children("img").attr("src", imgsrc);
		});
		
		//MENU MAQUINARIA
		// Preload all rollovers
		$("#menuMaquinaria img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.png$/ig,"_over.png");
			$("<img>").attr("src", rollON);
		});
		
		// Navigation rollovers
		$("#menuMaquinaria 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(/.png$/ig,"_over.png"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});
		
		$("#menuMaquinaria a").mouseout(function(){			
			$(this).children("img").attr("src", imgsrc);
		});
	
	});

$(document).ready(function(){
		$('li#liMaquinaria').hover(		
			function() { $('#menuMaquinaria').css('display', 'block'); },
			function() { $('#menuMaquinaria').css('display', 'none'),
						$('#botMaquinaria').attr("src", '/images/menu/bot2.jpg');}),
		
		$('#menuMaquinaria').hover(
			function() { $('#botMaquinaria').attr("src", '/images/menu/bot2_over.jpg'); },
			function() {} );   
								   
	});	