<!--
var ajax_file_loc = "scripts/php/ajaxHandler.php";

//Browser Support Code
function ajaxFunction(string){
    var ajaxRequest;  // The variable that makes Ajax possible!
   
    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject(" Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
   
   // WHERE STUFF IS RECEIVED FROM THE SERVER
   
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
			processReturn(ajaxRequest.responseText);
        }
    }
   
    // WHERE STUFF NEEDS TO BE SENT TO THE SERVER
  
	//alert(string);

    //alert("mysql query being sent");
    ajaxRequest.open("POST", ajax_file_loc, true);
    ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    ajaxRequest.setRequestHeader("Connection", "close");
    ajaxRequest.send(string);

}

function processReturn(string)
{
  //alert(string);
  var result = string.split(",");
  var action = result[0];
  result.shift();
  
  switch(action)
  {
      case "new_comment":
        new_comment(result);
        break;
        
  	  default:
  		  alert("Server Error: " + action + " Refresh Page and Try Again"); 
  }
  
}


function new_comment(result)
{
  if(result[0] == 1) //result[0] is captcha check 1: good
  {
    if(result[1] == 1) //result[1] is spam check 1: good
    {
      location.reload(true);
    }
    else
    {
      alert('Sorry your message looks like spam, try again');
    }
  
  }
  else
  {
    alert('Incorrect Captcha, try again');
  }
}



function removeChildNodes(ctrl)
{
  while (ctrl.childNodes[0])
  {
    ctrl.removeChild(ctrl.childNodes[0]);
  }
}







//-->