function vai(id_user, sala_fav, sala_cat)
{
  http.open("GET", "modulos/Sala/sala_favorita.php?id_user="+id_user+"&sala_favorita="+sala_fav+"&sala_cat="+sala_cat, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}


function handleHttpResponse() {
  if (http.readyState == 4) {
   results = http.responseText.split(",");
    for( i = 0; i < results.length; i++ )
    {
      document.getElementById("texto").innerHTML = document.getElementById("texto").innerHTML + results[i] + ''
    }
    document.getElementById("txt_img").innerHTML = "Sala Adicionada";
  }
}


function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject();

/* Parte do código que checa se o usuário está on-line */
var req;

function loadXMLDoc(url)
{
  req = null;
  // Procura por um objeto nativo (Mozilla/Safari)
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
    req.open("GET", url, true);
    req.send(null);
    // Procura por uma versão ActiveX (IE)
  } else if (window.ActiveXObject) {
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP.4.0"); //alert(req);
    } catch(e) {
      try {
        req = new ActiveXObject("Msxml2.XMLHTTP.3.0"); //alert(req);
      } catch(e) {
        try {
          req = new ActiveXObject("Msxml2.XMLHTTP"); //alert(req);
        } catch(e) {
          try {
            req = new ActiveXObject("Microsoft.XMLHTTP"); //alert(req);
          } catch(e) {
            req = false;
          }
        }
      }
    }
    if (req) {
      req.onreadystatechange = processReqChange;
      req.open("GET", url, true);
      req.send();
    }
  }
}

function processReqChange()
{
  // apenas quando o estado for "completado"
  if (req.readyState == 4) {
    // apenas se o servidor retornar "OK"
    if (req.status == 200) {
      // retornado nela, como texto HTML
      document.getElementById('check_on_line_user').innerHTML = req.responseText;
    } else {
    //alert("Houve um problema ao obter os dados:\n" + req.statusText);
    }
  }
}

function buscarTempo(sid)
{
  loadXMLDoc("check_online_users.php"+sid);
}

// Recarrega a cada 60000 milissegundo (60 segundos)
/*setInterval("buscarTempo()", 180000);*/


// Função do formulário clica na palavra seleciona check
function __doPostBack(eventTarget, eventArgument) {
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.Form2;
		}
		else {
			theform = document.forms["Form2"];
		}
}

// Função que mostra e oculta o player da rádio.
function Display(object,object2)
{
obj = document.getElementById(object);
if (obj.style.display == "none"){
    obj.style.display = "block";
}else{
    obj.style.display = "none";
}
obje = document.getElementById(object2);
if (obje.style.display == "none")
    obje.style.display = "block";
else
    obje.style.display = "none";
}

/* =============================================================== */