// mostrar/ocultar subitems en menu lateral 
function despliega(identificador){
mo = document.getElementById(identificador); // este es nuestro objeto
if(mo.style.display==""){
mo.style.display = "block"; // mostramos
} else {
mo.style.display = ""; // ocultamos
}

}


// Cambio de tamaño de fuente y estados de botones de cambio de fuente

function tamFuente (nivel, elem, nivel2, elem2, nivel3, elem3, nivel4, elem4) {
var elemento = document.getElementById(elem)// Cambio de tamaño de fuente
elemento.className = "nivel"+nivel;
var elemento2 = document.getElementById(elem2)// estado boton fuente normal
elemento2.className = "normal"+nivel2;
var elemento3 = document.getElementById(elem3)// estado botón fuente aumentada
elemento3.className = "aumentada"+nivel3;
var elemento4 = document.getElementById(elem4)// estado botón fuente aumentada plus
elemento4.className = "aumentadaplus"+nivel4;
}

// Ocular y mostrar información con boton

function mostrarOcultar(identificador, link_vmas){
mo = document.getElementById(identificador); // este es nuestro objeto
var enlace = document.getElementById(link_vmas); //obtenemos la id del enlace para cambiar el icono
if(mo.style.display==""){
mo.style.display = "block"; // ocultamos
enlace.className = "vermenos";
} else {
mo.style.display = ""; // mostramos
enlace.className = "vermas";
}


}

// Ocular y mostrar información 

function f_mostrar_si(identificador){
mo = document.getElementById(identificador); // este es nuestro objeto
mo.style.display = "block"; //mostramos
}

function f_mostrar_no(identificador){
mo = document.getElementById(identificador); // este es nuestro objeto
mo.style.display = "none"; //ocultamos
}




// Objeto Impresion

// permite imprimir para todo tipo de navegadores

var da = (document.all) ? 1 : 0;

var pr = (window.print) ? 1 : 0;

var mac = (navigator.userAgent.indexOf("Mac") != -1); 



function printPage2() {

  if (pr) // NS4, IE5

    window.print()

  else if (da && !mac) // IE4 (Windows)

    vbPrintPage()

  else // other browsers

    alert("No soportado por este navegador");

  return false;

}



if (da && !pr && !mac) with (document) {

  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');

  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');

  writeln('Sub window_onunload');

  writeln('  On Error Resume Next');

  writeln('  Set WB = nothing');

  writeln('End Sub');

  writeln('Sub vbPrintPage');

  writeln('  OLECMDID_PRINT = 6');

  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');

  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');

  writeln('  On Error Resume Next');

  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');

  writeln('End Sub');

  writeln('<' + '/SCRIPT>');

}

function abrir_ventana_centrada(lapagina,elnombre,ancho,alto,scroll){
	LeftPosition = (screen.width) ? (screen.width-ancho)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-alto)/2 : 0;
	settings =
	'height='+alto+',width='+ancho+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(lapagina,elnombre,settings)
}

function openAdministradorUsr(lapagina)
{
	var hg = screen.availHeight;
	var wd = screen.availWidth;
	var settings = 'height='+hg+',width='+wd+',top=0,left=0,scrollbars=yes,resizable=no';
	var win = window.open(lapagina,'administrador',settings);
}

function contacto(url){
	w=500;
	h=400;
	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
	ventana=window.open(url,'contacto','width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=no,resize=no,status=no');
	//la doy foco
	ventana.focus();

}