$(document).ready(function() {
	// Preload all rollovers
	$("#contenido img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	
	// Navigation rollovers
	$("#contenido 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);
		}
		
	});
	$("#contenido a").mouseout(function(){
		$(this).children("img").attr("src", imgsrc);
	});
});

function MapsDelegate(id) {
	windowWidth = 802;
	windowHeight = 400;
	var centerWidth = (window.screen.width - windowWidth) / 2;
	var centerHeight = (window.screen.height - windowHeight) / 2;

	newWindow = window.open('visor.php?idT='+id, 'Maps', 'resizable=0,width=' + windowWidth + 
		',height=' + windowHeight + 
		',left=' + centerWidth + 
		',top=' + centerHeight);

	newWindow.focus();
	//return newWindow.name;
}

