// FUNCIONES DE JQUERY
$(document).ready(function() {
				
	// Preload all rollovers
	$(".nav img, .bot-contacto img, .subnav img, #volver img, .rollover img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$(".nav a, .bot-contacto, .subnav a, #volver, .rollover").mouseover(function(){
		if ($(this).attr("id")=="bAvanzada")
			return;
		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);
			
			$(".nav a, .bot-contacto, .subnav a, #volver, .rollover").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);								 
			});		
		}
	});
	
});

		

