//JS SCRIPT
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function carrega(de, texto){

    de=de;
	texto=texto;

    //Abre a url
    xmlhttp.open("GET", "enviar_scrap.php?de="+de+"&texto="+texto,true);
	xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4){
		form = document.mural;
		document.getElementById('AcaoEnviando').style.display='none';
		document.getElementById('AcaoEnviado').style.display='';
		form.texto.disabled='disable';
    }
}
xmlhttp.send(null)

}

function ajax(){
	carrega(document.mural.de.value, document.mural.texto.value);
	return false;
}

function loadComentarios(){
	
	//Abre a url
    xmlhttp.open("GET", "mural_listao.php",true);
	divLista = document.getElementById('divListaMural');
	divLista.style.display='';
	xmlhttp.onreadystatechange=function() {
    	if (xmlhttp.readyState==4){
			divLista.innerHTML=xmlhttp.responseText;
    	}
	}
	xmlhttp.send(null)

}

function loadPM(div,email,senha){
	
	//Abre a url
    xmlhttp.open("GET", "ajax_prematricula.php?email="+email+"&senha="+senha,true);
	div = document.getElementById(div);
	div.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="40"><img src="imagens/load.gif" width="32" height="32" /></td><td>Aguarde enquanto o aplicativo é carregado!</td></tr></table>';
	xmlhttp.onreadystatechange=function() {
    	if (xmlhttp.readyState==4){
			div.innerHTML=xmlhttp.responseText;
    	}
	}
	xmlhttp.send(null)

}

function loadPMErroLogin(div){
	
	//Abre a url
    xmlhttp.open("GET", "ajax_cadastro.php",true);
	div = document.getElementById(div);
	div.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="40"><img src="imagens/load.gif" width="32" height="32" /></td><td>Aguarde enquanto o aplicativo é carregado!</td></tr></table>';
	xmlhttp.onreadystatechange=function() {
    	if (xmlhttp.readyState==4){
			div.innerHTML=xmlhttp.responseText;
    	}
	}
	xmlhttp.send(null)

}