// JavaScript Document
$(document).ready(function()	{
	
	// Store the nav items in an array to make script
	// execution faster/more efficient.
	var navItems = $(".menuSecundario > li");

	//ocultar todo menos el contenido de index
	$('#contBuscador').hide();
	$("ul",navItems).hide();
	
	//mostrar contenidos al pulsar en botones
		$('.buscar_titulo a').click(function()	{
			$('#contBuscador').toggle(500);
		});
		
		$(navItems).hover(
			
				// Onmouseover (on the <li>s), slideDown the associated <div>.
				function(){
					$(this).children("ul").slideDown("fast");
					$(this).children("a").addClass("EnlaceActivo");
				},
				// Onmouseout, slideUp the associated <div>.  Using the hover
				// on the <li> instead of the <a> keeps the <div> visible if
				// you mouse off the <a> because the <div> is a child of the
				// <li> and therefore the <li> grows to contain the <div>.
				function(){
					$(this).children("ul").slideUp("fast");		
					$(this).children("a").removeClass("EnlaceActivo");
				}
			);


});

function lanzaPopUpLogin(url) {
	var screenWidth = window.screen.availWidth;
	var screenHeight = window.screen.availHeight;
	if (screenHeight == window.screen.height) {
		screenHeight = screenHeight - 60;
	}
	//alert(window.screen.height + ' - ' + window.screen.availHeight + ' - ' + screenHeight);
	var venta = window.open(url,'false','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=0,top=0,width=' + screenWidth + ',height=' + screenHeight );
	venta.focus();
	return;
}
