var message = new Array();
  function CheckForm(frmObj){
    if (Trim(frmObj.txtSearch.value)==''){
      alert('Search Field is Empty!');
      frmObj.txtSearch.focus();
      return false;
    }
    return true;
  }

  function printpdf(id){
    document.getElementById("isPrinted").value = "1";
    window.location.href="createPDF.php?ID=" + id;
  }
  function checkprint(lang){
    var isPrinted = document.getElementById("isPrinted").value;
    if (isPrinted == "0"){
      if (lang == "en"){
        alert ("Please print your voter registration application by clicking \"Next\" before clicking \"Finished\".");
        return false;
      }else{
        alert ("Por favor escriba su solicitud de inscripci\xf3n de votante, haga clic en \"Continuar\" antes de hacer clic en \"Terminar\".");
      }
    }else{
      window.location.href="http://www.veyvota.org/index.php";
    }
  }


///////////////
  function statebyajax(lang,statename)
  {

        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.onreadystatechange=function()
          {
            if(xmlHttp.readyState==4)
              {
               data = xmlHttp.responseText;
               message = data.split("^");

              }
          }

          xmlHttp.open("GET","state_list.php?statename="+statename+"&lang="+lang,true);
          xmlHttp.send(null);
          return true;

  }
  function readstate(lang)
  {
    //alert(statename)
    //alert(document.frmvoter.CState.value)
    var statename = document.frmvoter.CState.value;
    if(document.frmvoter.CState.value == 'National')
    {
      //alert("rajeev")
      //location.reload(true);
      statebyajax(lang,'National');
    }
    else
    {
      statebyajax(lang,statename);
    }

  }

