function createXMLHTTP()  {
 if (typeof XMLHttpRequest != "undefined")
    return new XMLHttpRequest();
 else if (window.ActiveXObject){
    var versoes = ["MSXML2.XMLHttp.5.0",
    "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0",
    "MSXML2.XMLHttp", "Microsoft.XMLHttp"
    ];
 }
 for (var i = 0; i < versoes.length; i++){
    try{
       return new ActiveXObject(versoes[i]);
    }catch (e) {}
 }
 throw new Error("Seu browser nao suporta javascript.");
}

function click(e) {
		if (document.all) {
			if (event.button==2||event.button==3) {
				oncontextmenu='return false';
			}
		}
		if (document.layers) {
			if (e.which == 3) {
				oncontextmenu='return false';
			}
		}
}

if (document.layers) {
		document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown=click;
document.oncontextmenu = new Function("return false;")

function limpa()
{  
	document.all.ajax.innerHTML = "";
	document.all.ajax.style.visibility = 'hidden';
	document.all.ajax.style.display = 'none';
}

function mn_sub(registro,classe)
	{  
		document.all.ajax.style.visibility = 'visible';
		document.all.ajax.style.display = 'inline';

		var validando = createXMLHTTP();
		validando.open("post", "mn_sub.asp", true);
		validando.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		validando.onreadystatechange=function(){

	    if (validando.readyState==1){
			window.scrollTo(0,300); 
			document.all.ajax.innerHTML = "<img src=Images/loading_ajax.gif>"; 
		}

		if (validando.readyState==4){
			window.scrollTo(0,300); 
			document.all.ajax.innerHTML = validando.responseText;}}
		validando.send("registro=" + escape(registro)+"&classe=" + escape(classe));
	}


function mn_texto(registro,classe)
	{  
		document.all.ajax.style.visibility = 'visible';
		document.all.ajax.style.display = 'inline';

		var validando = createXMLHTTP();
		validando.open("post", "mn_texto.asp", true);
		validando.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		validando.onreadystatechange=function(){

	    if (validando.readyState==1){
			window.scrollTo(0,300); 
			document.all.ajax.innerHTML = "<img src=Images/loading_ajax.gif>"; 
		}

		if (validando.readyState==4){
			window.scrollTo(0,300); 
			document.all.ajax.innerHTML = validando.responseText;}}
		validando.send("registro=" + escape(registro)+"&classe=" + escape(classe));
	}