// JavaScript Document

var time = 3000;
var numofitems = 7;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmenuitems = 7;
	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){
  if ((event.clientY <48)||(event.clientY > 107)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}  
	}
}
function launchCenter(url, name, width, height, titulo, especs) {
  //alert(navigator.appName+'-'+navigator.appVersion);
  
  var str = "height=" + ((document.all&&navigator.appName!='Opera')? height-4:height) + ",innerHeight=" + height;
  str += ",width=" + ((document.all&&navigator.appName!='Opera')? width-4:width) + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  } else {
	str += ",resizable";
  }
  str+=especs;
  var lupe=window.open("", name, str);
  //' .$CFG->wwwroot.$direnmarca.substr($aenmarcar,0,strlen($aenmarcar)-4).'_gr.jpg
  lupe.document.open();
  lupe.document.write('<html><head><title>' + titulo + ' - 902 055 169</title></head><body style="margin:0;border:0" marginheight=0 marginwidth=0 scroll=no>' +
   '<a href="http://www.aproxima.es/coste_llamadas.html" onclick="window.close();return false;"><img width="' + width + '" height="' + height + '" src="' + url + '" alt="' +titulo +'" title="cerrar factura" border="0"></a></body></html>');
  lupe.document.close();
  return lupe;
 
}


