function Run( nombreArchivoSwf, width, height, windowMode )
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">')
	document.write('<param name="movie" value="' + nombreArchivoSwf + '">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="wmode" value="transparent">')
	document.write('<embed src="' + nombreArchivoSwf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" wmode="' + windowMode + '"></embed>')
	document.write('</object>')
	
	/*document.write('<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="460">')
	document.write('<param name="movie" value="Alasa.swf" />')
	document.write('<param name="quality" value="high" />')
	document.write('<param name="wmode" value="opaque" />')
	document.write('<param name="swfversion" value="9.0.45.0" />')
	<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
	document.write('<param name="expressinstall" value="Scripts/expressInstall.swf" />')
	<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
	<!--[if !IE]>-->
	document.write('<object type="application/x-shockwave-flash" data="Alasa.swf" width="500" height="460">')
	<!--<![endif]-->
	document.write('<param name="quality" value="high" />')
	document.write('<param name="wmode" value="opaque" />')
	document.write('<param name="swfversion" value="9.0.45.0" />')
	document.write('<param name="expressinstall" value="Scripts/expressInstall.swf" />')
	<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
	document.write('<div>')
	document.write('<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>')
	document.write('<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>')
	document.write('</div>')
	<!--[if !IE]>-->
	document.write('</object>')
	<!--<![endif]-->
	document.write('</object>')
	
	swfobject.registerObject("FlashID");*/
}

function traerArchivo(archivo, ancho, alto)
{
    //arma el string con el codigo html para colocar el flash en el div
	var a = ""
    a = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ancho+'" height="'+alto+'">'
    a +='<param name="movie" value="'+archivo+'" />'
    a +='<param name="quality" value="high" />'
    a +='<param name="wmode" value="transparent" />'
    a +='<embed src="'+archivo+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed>'
    a +='</object>'
	a +='</noscript>'

    return a

}

function muestra_imagen(archivo,ancho,alto,tipo){
	xWidth ('ampliacion',ancho + 6)
	xHeight ('ampliacion',alto + 6 + 20 + 18)
	xWidth ('c1',ancho)
	xHeight ('c1',alto)
	xWidth ('cerrarampliacion',ancho)
	xInnerHtml('c1',traerArchivo(archivo, ancho, alto))	
	
	//posicion horizontal donde empieza el movimiento
	pos_left_actual=ancho
	//posicion horizontal donde termina el movimiento
	pos_left = parseInt((xClientWidth()- ancho + 10)/2) 			
	
	
	if (xClientHeight() < alto){
		pos_top = xScrollTop() + 2;
	}else{	
		pos_top = xScrollTop() + parseInt((xClientHeight() - alto - 30) / 2)
	}

	xMoveTo('ampliacion',pos_left_actual,pos_top)
//	xMoveTo('ampliacion',100,100)
	
	situar()
	
	xShow('ampliacion')
}
function popup(archivo, ancho, alto, tipo)
{
    //alert("muestra_imagen_vertical(" + archivo + "," + ancho + "," + alto + "," + tipo + ")")
    xWidth ('ampliacion',ancho + 6)
	xHeight ('ampliacion',alto + 6 + 20 + 18)
	xWidth ('c1',ancho)
	xHeight ('c1',alto)
	xWidth ('cerrarampliacion',ancho)
	pos_top = 20
	xInnerHtml('c1',traerArchivo(archivo, ancho, alto))
	//xInnerHtml('c1','<img src="' + archivo + '" width="' + ancho + '" height="' + alto + '" border="0">')
    //xMoveTo('ampliacion',700,350)	
	//xShow('ampliacion')
	
    setTimeout("muestra_imagen_vertical(" + ancho + "," + alto + "," + tipo + ")", 1*1000); 
}
function muestra_imagen_vertical(ancho,alto,tipo){    
		
		
	//posicion vertical donde termina el movimiento
	pos_top = 120
	//posicion vertical donde empieza el movimiento
	pos_top_actual = 120

	xMoveTo('ampliacion',250,pos_top_actual)
	
	setInterval('situar()',50)
	
	xShow('ampliacion')
}

function cerrar_ampliacion(){
	xHide('ampliacion');
	
}

function situar(){
	if (pos_top_actual < pos_top){
	    //velocidad del avance en pixeles
		pos_top_actual += 2
		xMoveTo('ampliacion', 250,pos_top_actual);
		
	}
}
