// function to validate forms;

function refresh(sURL)

{

    window.location.href = sURL;

}



function formcheck(name,email,site,message,safe_quest,bot) {

	document.getElementById('formreply').innerHTML="<img src='img/ajax-loader.gif' border='0' />"; 

    var oXmlHttp = zXmlHttp.createRequest();	

	oXmlHttp.open("get", "formcheck.php?email=" + encodeURIComponent(email) +"&name=" + encodeURIComponent(name) +"&message="+ encodeURIComponent(message) +"&site="+ encodeURIComponent(site) +"&safe_quest="+ encodeURIComponent(safe_quest)+"&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('formreply').innerHTML=resp;				

				}

				

            } else {

                alert("An error occurred while trying to contact the server.");

            }

        }

    };

    oXmlHttp.send(null);

};