// function to validate forms;
function refresh(sURL)
{
    window.location.href = sURL;
}

function formcheck(mail,name,mesaj,website,bot) {
	document.getElementById('raspuns').innerHTML="<img src='img/ajax-loader.gif' border='0'>"; 
    var oXmlHttp = zXmlHttp.createRequest();	
	oXmlHttp.open("get", "formcheck.php?mail=" + encodeURIComponent(mail) +"&name=" + encodeURIComponent(name) +"&mesaj="+ encodeURIComponent(mesaj) +"&website="+ encodeURIComponent(website) +"&bot="+ encodeURIComponent(bot), true);
        
    oXmlHttp.onreadystatechange = function () {
    	
        if (oXmlHttp.readyState == 4) {
            if (oXmlHttp.status == 200) {
				var resp = oXmlHttp.responseText;
				if(resp.length > 2){
				document.getElementById('raspuns').innerHTML=resp;				
				}
				
            } else {
                alert("An error occurred while trying to contact the server.");
            }
        }
    };
    oXmlHttp.send(null);
};
