function ventana_centrada2(width,height,url,wname) {
        x=(640 - width)/2,y=(480-height)/2;

        if(screen) {
                y=(screen.availHeight - height -20)/2;
                x=(screen.availWidth - width)/2;
        }
        if(screen.availWidht > 1800) {
                x=((screen.availWidth/2) - width)/2;
        }

		window.open(url,wname,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',resizable=no');
}

function ventana_centrada(width,height,url) {
        x=(640 - width)/2,y=(480-height)/2;

        if(screen) {
                y=(screen.availHeight - height -20)/2;
                x=(screen.availWidth - width)/2;
        }
        if(screen.availWidht > 1800) {
                x=((screen.availWidth/2) - width)/2;
        }

		window.open(url,'popup','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',resizable=no');
}

function ventana_centrada_sb(width,height,url) {
        x=(640 - width)/2,y=(480-height)/2;

        if(screen) {
                y=(screen.availHeight - height -20)/2;
                x=(screen.availWidth - width)/2;
        }
        if(screen.availWidht > 1800) {
                x=((screen.availWidth/2) - width)/2;
        }

		window.open(url,'popup','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',resizable=no, scrollbars=0');
}

function ShowFootImage (url, foot, width,height) {
  
  if (width==null)
		width = 400;
  if (height==null)
		height = 300;
		
	height = height + 30
		
  var x=(300 - width)/2
  var y=(300-height)/2

  if(screen) {
	  y=(screen.availHeight - height)/2
	  x=(screen.availWidth - width)/2
  }

  if(screen.availWidht > 1800)
	  x=((screen.availWidth/2) - width)/2

  var idventana = String(Math.round(Math.random()*20));
  
  vn = window.open("","pieimagen_"+String(idventana),"width=" + width + "px,height=" + height + "px,resizable=1,top=" + y + "px,left=" + x + "px")
  vn.document.write ('<html><head>')
  vn.document.write ('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')
  vn.document.write ('<style type="text/css"><!--.piefoto {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #3F5BA9;}--></style></head>');
  vn.document.write ('<table border=0 cellspacing=0 cellpadding=0 width=400><tr><td>')
  vn.document.write ('<div align="center">')
  vn.document.write ('<a href="javascript:window.close()"><img src="' + url + '" alt="Pulse para cerrar" border=0></a>')
  vn.document.write ('</div></td></tr>')
  vn.document.write ('<tr><td align="center"  valign="middle" height="30"><span class="piefoto">' + foot + '</span></td></tr></table>');
  vn.document.write ('</body></html>')
  vn.document.title="Imagen ampliada"
}



