function ajax()
{
    try {
        return new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        try {
            return new ActiveXObject("Msxml2.XMLHTTP");
        } catch(ex) {
            try {
                return new XMLHttpRequest();
            } catch(exc) {
                alert("Esse browser não suporta AJAX");
                return false;
            }
        }
    }
}


// JavaScript Document

/** INPUTS **/
function vanish(id_ob,valor_ini,valor_final) {
	if(valor_final == valor_ini){
		document.getElementById(id_ob).value = '';
		document.getElementById(id_ob).style.color = '#353535';
	}
}
function returns(id_ob,valor_ini,valor_final) {
	if(valor_final == ''){
		document.getElementById(id_ob).value = valor_ini;
		document.getElementById(id_ob).style.color = '#353535';
	}
}

function enviaForm() {
	
	var nomeForm = document.getElementById('nomeForm').value;
	var emailForm = document.getElementById('emailForm').value;
	var msgForm = document.getElementById('msgForm').value;
	var enviar = document.getElementById('enviar').value;
	
	ajax_1 = new ajax;
	ajax_1.open("POST", "enviaForm.php", true );
	ajax_1.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax_1.send("nomeForm="+nomeForm+"&emailForm="+emailFOrm+"&msgForm="+msgForm+"&enviar="+enviar);

    ajax_1.onreadystatechange = function() { 

		if (ajax_1.readyState == 4) {
			document.getElementById("calendar").innerHTML = ajax_1.responseText;
		} else {
			document.getElementById("calendar").innerHTML = "<span class=\"calLoading\">Carregando...</span>";	
		}
	}
}
