   var http_request = false;
   var clicks	  = 0;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() 
   {
      if (http_request.readyState == 4) 
	  {
         if (http_request.status == 200) 
		 {
            result = http_request.responseText;
			//alert(result)
			if (result == '')
				{
				window.location="Thanks.php";
				}
			else	
			document.getElementById('myspan').innerHTML = result;
			write_captcha();
		 }
		 else 
		 {
            alert('There was a problem with the request.');
         }
      }
   }
   
   
 
//$PA7=$_POST["MR101"];
//$PA8=$_POST["MR102"];
   
   function get(obj) {
      var poststr = "capt=" + encodeURI( document.getElementById("capt").value )+
	  "&fname=" + encodeURI( document.getElementById("FirstName").value )+
	  "&lname=" + encodeURI( document.getElementById("LastName").value )+
	  "&company=" + encodeURI( document.getElementById("Company").value )+
	  "&streetaddress=" + encodeURI( document.getElementById("StreetAddress").value )+
	  "&city=" + encodeURI( document.getElementById("City").value )+
	  "&state=" + encodeURI( document.getElementById("State").value )+
	  "&zipcode=" + encodeURI( document.getElementById("ZipCode").value )+
	  "&phone=" + encodeURI( document.getElementById("Phone").value )+
	  "&email=" + encodeURI( document.getElementById("Email").value )+
	  "&aptext=" + encodeURI( document.getElementById("applicationstext").value )+
	  "&qtext=" + encodeURI( document.getElementById("questionstext").value )
	  for(j=1 ;j<=8;j++)
		{
			radioname="check"+j
			//alert(radioname)
			objname = "document.fbdetails." +radioname ;  
			rdoobj = eval(objname);
			if (rdoobj.checked == true)
				  {
				  poststr=poststr+"&"+radioname+"=" + rdoobj.value
				  //alert(rdoobj.value)
				 // alert(poststr)
				  }
		}
	  
	  poststr=poststr+"&Submit=" + encodeURI( document.getElementById("Submit").value );
	  //alert(poststr)
      makePOSTRequest('feedback_post.php', poststr);
   }

   function write_captcha(){
   	clicks++;
   	document.getElementById('capt').value		= ''
	document.getElementById('captcha_id').innerHTML = '<img src="captcha_img.php?clicks=' + clicks + '" border="0" alt=""/><img src="png_bank1/refresh.gif" border="0" alt="" onclick="Javascript:write_captcha();"/>';
   return false;
   }
   
