// FUNCIONES DE JQUERY
$(document).ready(function() {
				
	// Preload all rollovers
	$("#menu img, .oportunidades a 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 a, .oportunidades 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 a, .oportunidades a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);								 
			});		
		}
	});	
	
	//Botones del pie
	//---------------
	
	// Preload all rollovers
	$("#botonesPie img, #contFormulario .boton img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#botonesPie a, #contFormulario .boton 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);
			
			$("#botonesPie a, #contFormulario .boton a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);								 
			});		
		}
	});	
});

		

