// Ver 1.2.0 (sólo para IE)

// ***********************************
// ********** Abrir ventana **********
// ***********************************
var VAxAbrir=0;
function abrir(fich, tipo, desc, ancho, alto, seg) {
// Abrir ventana suavemente
if (fich == "" || VAxAbrir == 1) {
	return (false);
}
VAxAbrir=1;
if (ancho == "" || ancho <= 0) {
	ancho=450;
}
if (alto == "" || alto <= 0) {
	alto=450;
}
if (seg == "" || seg == 0 || seg < -1) {
	seg=" onLoad='javascript:setTimeout(window.close, 10000)'";
}
else if (seg == -1) {
	seg="";
}
else {
	seg=" onLoad='javascript:setTimeout(window.close, "+seg+"000)'";
}
var velocidadheight = 3; // Esta es la velocidad con se abre de alto
var velocidadwidth = 5; // Esta es la velocidad con se abre de ancho
var situacionleft = (screen.width-ancho)/2; // Esta es la situación respecto a la parte izquierda
var situaciontop = (screen.height-alto)/2; // Esta es la situación respecto a la parte derecha
var winwidth = ancho;
var winheight = alto;
var ventana = window.open("","","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=" + situacionleft + ",top=" + situaciontop + ",screenX=" + situacionleft + ",screenY=" + situaciontop + ",width=1,height=1");
// movemos la ventana
for (mywidth = 129; mywidth < winwidth; mywidth += velocidadwidth) {
ventana.resizeTo(mywidth, 129);
}
for (myheight = 129; myheight < winheight; myheight += velocidadheight) {
ventana.resizeTo(mywidth, myheight);
}
// Escribimos en la ventana
if (tipo == "foto") {
	var doc = ventana.document;
	doc.open("text/html", "replace");
	var fichwidth = ancho-6;
	var fichheight = alto-32;
	if (desc != "") {
		fichheight = fichheight-14;
	}
	doc.write("<HTML><HEAD><TITLE>Imagen ampliada</TITLE></HEAD>");
	doc.write("<BODY"+seg+" bgColor='#FFFFFF' text='#000000' link='#000000' vLink='#999999' aLink='#CCCCCC' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>");
	doc.write("<img src='"+fich+"' alt='"+desc+"' width='"+fichwidth+"' height='"+fichheight+"' border='0'>");
	if (desc != "") {
		doc.write("<div align='center'><font color='#000000' size='1' face='Times New Roman, Times, serif'>"+desc+"</font></div>");
	}
	doc.write("</BODY></HTML>");
	doc.close();
}
else if (tipo == "video") {
	ventana.location = fich;
	var doc = ventana.document;
	doc.open("text/html", "replace");
	var fichwidth = ancho-6;
	var fichheight = alto-32;
	if (desc != "") {
		fichheight = fichheight-14;
	}
	doc.write("<HTML><HEAD><TITLE>Vídeo ampliado</TITLE></HEAD>");
	doc.write("<BODY"+seg+" bgColor='#FFFFFF' text='#000000' link='#000000' vLink='#999999' aLink='#CCCCCC' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>");
	doc.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='"+fichwidth+"' height='"+fichheight+"' hspace='0' vspace='0' align='middle' border='0' standby='Cargando...'>");
	doc.write("<param name='movie' value='"+fich+"'>");
	doc.write("<param name='menu' value='false'>");
	doc.write("<param name='quality' value='high'>");
	doc.write("<param name='scale' value='exactfit'>");
	doc.write("<embed src='"+fich+"' width='"+fichwidth+"' height='"+fichheight+"' hspace='0' vspace='0' align='middle' quality='high' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' scale='exactfit'></embed>");
	doc.write("</object>");
	if (desc != "") {
		doc.write("<div align='center'><font color='#000000' size='1' face='Times New Roman, Times, serif'>"+desc+"</font></div>");
	}
	doc.write("</BODY></HTML>");
	doc.close();
}
else {
	ventana.location = fich;
}
VAxAbrir=0;
/*
 Copiar dentro del BODY:
 <a onclick="arrastrar('Directorio/fich.ext','','','','','');return false;"  href="#">Lanzar ventana</a>
*/
}


