//<![CDATA[

/**
 * Activa los pop-ups de los enlaces con rel="external", y centra los pop-ups en pantalla.  
 * @author usaelraton.com
 * @param {int} ancho
 * @param {int} alto
 */
function activarPopups(ancho, alto)
{
	if (ancho > screen.width) { ancho = screen.width;}
	if (alto > screen.height) { alto = screen.height;}
	var x = (screen.width - ancho) / 2;
	var y = ((screen.height - alto) / 2) - 30;
	$("a[rel=external],div#textos a").click(function(e) // Activamos el popup al hacer clic.
	{
		window.open(this.href, "Externo", "width=" + ancho + ",height=" + alto + ",left=" + x + ",top=" + y + ",resizable=yes,scrollbars=yes,toolbar=yes");
		return false;
	});
}

/**
 * Activa el menú de navegación para que los submenús salgan como desplegables
 * @author usaelraton.com
 */
function animarMenu()
{
	$("#menu ul").css({'position':'absolute','width':'200px'}).hide();
	$("#menu > li").hover(function(){$(this).css({'background-color':'#6f9621'});$(this).animate({'width':'180px'}, 200);$("ul", $(this)).css({'top':'-5px','left':'+195px'}).slideDown("fast")},function(){$(this).css({'background-color':'#17471c'});$(this).animate({'width':'160px'}, 200);$("#menu ul").hide()});
}

$(document).ready(
	function(e)
	{
		activarPopups(800,600);
		
		$("tbody tr:odd").css("background-color", "#eee");
		$("tbody tr:odd td:has(img)").css("background-color", "#fff");
		$("a[rel=external]:has(img),#contenido a.external:has(img)").css({"background-image":"none","padding-right":"0"});
		Nifty("#columna-izquierda div");
		animarMenu();
	}
);
//]]>
