var menu_abierto;
function menu(divId){
	var elem = document.getElementById(divId);
	if(elem.style.display == "none"){
		elem.style.display = "";
		menu_abierto = elem;
	} else {
		elem.style.display = "none"
	}
	document.getElementById("menu_afuera").style.display = "";
}

function cerrarMenu(){
	setTimeout("cerrarMenuT()",300);
	document.getElementById("menu_afuera").style.display = "none";
}
function cerrarMenuT(){
	if(menu_abierto){
		menu_abierto.style.display = "none";
	}
}

/*function desplegar(divId){
	var elem = document.getElementById(divId);
	if(elem.style.display == "none"){
		elem.style.display = "";
	} else {
		elem.style.display = "none"
	}
}*/

function autopopup(content){
	newWindow = window.open("","newWindow","width=400,height=250");
	newWindow.document.open();
	newWindow.document.write("<html><body><font face='Arial' size='2'>"+content+"</font></body></html>");
	newWindow.document.close();
	newWindow.focus();
}

function toggle(id){
	var elem = document.getElementById(id);
	if(elem.style.display == "none"){
		elem.style.display = "block";
	} else {
		elem.style.display = "none"
	}
}

function switchUserClick(form){
	if(form.elements['password']){
		form.elements['password'].focus();
	} else {
		form.submit();
	}
}
