
//set captcha
function SetCaptcha(){   

  {var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari    
         xmlHttp=new XMLHttpRequest();    
         }
  catch (e)
    {    // Internet Explorer    
    try
      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch (e)
      {try
        {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
      catch (e)
        {        
        alert("Your browser does not support AJAX!");        
        return false;        
        }      
       }    
      }
       
    xmlHttp.open("GET","CaptchaValue.asp",true);
    xmlHttp.send(null);
      
    xmlHttp.onreadystatechange=function()
     {
      if(xmlHttp.readyState==4)
        {
          var response = xmlHttp.responseText;
          document.getElementById("CaptchaValue").innerHTML = response;
        }
      } 
    }
  }
 
  //validate captcha
  function ValidateCaptcha(){
  
    var tbCaptcha = document.getElementById("tbCAPTCHA").value
    var CaptchaValue = document.getElementById("CaptchaValue").innerHTML

    if (tbCaptcha == "" || tbCaptcha != CaptchaValue){
      alert("Please enter the code as shown (Note: Code is case sensitive)");
		document.getElementById("tbCAPTCHA").focus();
		document.getElementById("tbCAPTCHA").select();
		return false;
	}
  }





