// FUNCIONES DE JQUERY

document.write('<style type="text/css">body{display:none}</style>');
jQuery(function($) {
	$('body').css('display','block');
});

$(document).ready(function() {
	
	// Preload all rollovers
	$("#ocasion img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#ocasion 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);
		}
		
	});
	
	$("#ocasion a").mouseout(function(){
		$(this).children("img").attr("src", imgsrc);
	});

	// Preload all rollovers
	$(".opciones img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"-over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$(".opciones 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);
		}
		
	});
	
	$(".opciones a").mouseout(function(){
		$(this).children("img").attr("src", imgsrc);
	});



});

