﻿// JavaScript Document

function popup(url,windowname,width,height) { 
width=(width)?width:screen.width/2; 
height=(height)?height:screen.height/2; 
var screenX = (screen.width/2 - width/2); 
var screenY = (screen.height/2 - height/2); 

var features= "width=" + width + ",height=" + height +",scrollbars=no,status=no"; 
features += ",screenX=" + screenX + ",left=" + screenX; 
features += ",screenY=" + screenY + ",top=" + screenY; 

var mywin=window.open(url, windowname, features); 
if (mywin) 
mywin.focus(); 
return mywin; 
}

/*
AJAX tret de: http://www.formatoweb.com.ar/ajax
*/
function nou_ajax()
{ 
	var xmlhttp=false; 
	try { 
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e){ 
		try	{ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 
	return xmlhttp; 
}

function mostrardiv(id_audio) {
	div = document.getElementById("flash_player_"+id_audio);
	div.style.display = "";
	ajax=nou_ajax();
	ajax.open("GET", "descargar.php?tipo=escuchar&id="+id_audio, true);
	ajax.onreadystatechange=function(){ 
		if (ajax.readyState==4){
			document.getElementById("monFlash_"+id_audio).SetVariable("player:jsPlay", "");
		}
	} 	
	ajax.send(null);	

}


