var time = 3000;
var numofitems = 6;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
  this.numberofmenuitems = numofitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
  }
  theobj.thediv.style.visibility="visible";
}

function closesubnav(event){
	var altoMouse = event.clientY + document.body.scrollTop + document.documentElement.scrollTop
	if ((altoMouse <150)||(altoMouse > 224)) {
		for (var i=1; i<= numofitems; i++){
			var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}
	}
}

function fullScreen(theURL, fullscreen) {
	window.open(theURL, '', 'fullscreen=' + fullscreen + ', scrollbars=auto');
}

function escribeMenu(){
document.write('<div id="globalNav">');
document.write('	<img alt="" src="imagenes/gblnav_left.gif" height="32" width="4" id="gnl"><img alt="" src="imagenes/glbnav_right.gif" height="32" width="4" id="gnr">');
document.write('	<div id="globalLink">');
document.write('		<a href="somos.html" id="gl1" class="glink" onmouseover="ehandler(event,menuitem1);">Qui&eacute;nes Somos</a>');
document.write('		<a href="plataforma.html" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);">Plataforma</a>');
document.write('		<a href="modulos.html" id="gl3" class="glink" onmouseover="ehandler(event,menuitem3);">M&oacute;dulos</a>');
document.write('		<a href="lectores.html" id="gl4" class="glink" onmouseover="ehandler(event,menuitem4);">Lectores Biom&eacute;tricos</a>');
document.write('		<a href="conocimiento.html" id="gl5" class="glink" onmouseover="ehandler(event,menuitem5);">Conocimiento</a>');
document.write('		<a href="contacto.html" id="gl6" class="glink" onmouseover="ehandler(event,menuitem6);">Contacto</a>');
document.write('	</div> ');
document.write('</div> ');

document.write('<div id="subglobal1" class="subglobalNav"> ');
document.write('	<a href="somos.html">Empresa</a> | ');
document.write('	<a href="clientes.html">Clientes</a> ');
document.write('</div> ');
document.write('<div id="subglobal2" class="subglobalNav"> ');
document.write('	<a href="plataforma.html">Plataforma SquareNet&reg;</a> | ');
document.write('</div> ');
document.write('<div id="subglobal3" class="subglobalNav"> ');
document.write('	<a href="modulono.html">N&oacute;mina</a> | ');
document.write('	<a href="moduloca.html">Control de Asistencia</a> | ');
document.write('	<a href="modulorh.html">Recursos Humanos</a> | ');
document.write('	<a href="modulocv.html">Control de Visitas</a> | ');
document.write('	<a href="squarelight.html">SquareLight</a> | ');
document.write('	<a href="squarebridge.html">SquareBridge</a> | ');
document.write('	<a href="squarefinger.html">SquareFinger</a>');
document.write('</div>');
document.write('<div id="subglobal4" class="subglobalNav"> ');
document.write('	<a href="lectorCA200.html">SquareNet CA200</a> | ');
document.write('	<a href="lectorUSB100.html">SquareNet USB100</a> | ');
document.write('	<a href="lectorMicrosoftUSB.html">Microsoft USB Fingerprint Reader</a> | ');
document.write('	<a href="lectorFirstTouch.html">Tecnolog&iacute;a FirstTouch&reg;</a> | ');
document.write('	<a href="lectorHandPunch.html">HandPunch</a>');
document.write('</div>');
document.write('<div id="subglobal5" class="subglobalNav"> ');
document.write('	<a href="conocimientobiometria.html">¿Qu&eacute; es Biométria?</a> | ');
document.write('	<a href="conocimientohuelladigital.html">¿Por qu&eacute; Huella Digital?</a> | ');
document.write('	<a href="conocimientocomofunciona.html">¿C&oacute;mo funciona?</a>');
document.write('</div> ');
document.write('<div id="subglobal6" class="subglobalNav"> ');
document.write('	<a href="contacto.html">Contacto</a> |');
document.write('</div> ');
}

function escribeSubMenuNormal(){
document.write('<a href="somos.html">Qui&eacute;nes Somos</a>');
document.write('<a href="plataforma.html">Plataforma SquareNet </a>');
document.write('<a href="modulos.html">M&oacute;dulos</a>');
document.write('<a href="lectores.html">Lectores Biom&eacute;tricos</a>');
document.write('<a href="conocimiento.html">Conocimiento</a>');
document.write('<a href="contacto.html">Contacto</a>');
}
