function ratedemo(qual){
var select = qual;
var valore = select.options.selectedIndex;

valor = select.options[valore].value;

var nome = select.name;

var evento = "demos.php?action=ratedemo&layername="+escape(nome)+"&rate="+escape(valor)+"";

//alert(evento);

SendEventDownload('GET', evento);


}

function deletacomentario(id,fileid){
var pergunta = confirm ("Tem certeza que deseja apagar o comentário ?")
if (pergunta) {
var evento = "demos.php?action=deletacomentario&comentario="+id+"&fileID="+fileid;
SendEventDownload('GET', evento);
}else{
//Faz nada
}
}

function editacomentario(id,fileid){

window.location="demos.php?action=editacomentario&comentario="+id+"&fileID="+fileid+"";

}

function SendEventDownload(type,event) {

if (window.XMLHttpRequest) {
                xmlhttp = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            alert("Seu navegador n&atilde;o suporta XMLHttpRequest.");
                return;
        }

  xmlhttp.open(type, event, true);
  xmlhttp.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
  xmlhttp.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
  xmlhttp.setRequestHeader("Pragma", "no-cache");
  xmlhttp.onreadystatechange = processReqChangeDownload;
  xmlhttp.send(null);
}

function processReqChangeDownload() {
    if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                //document.getElementById("texto").innerHTML = xmlhttp.responseText;
                alert(xmlhttp.responseText);
                } else {
                    alert("Problemas ao carregar fonte. Consulte o programador.");
                }
    }
}


