<script type="text/javascript" language="javascript">
   var http_request = false;
   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) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            if (result.indexOf("<INVCAP>") != -1){ alert('The Captcha You Provided Was Incorrect');
document.getElementById('image').value='';
document.getElementById('image').focus();
} else if(result.indexOf("<BANNEDIP>") != -1){
alert('Your IP Has Been Banned From This System');
} else {
            document.getElementById('ajaxnotes').innerHTML = result;
document.f1.reset();
}
var search="?"+(new Date()).getTime();
document.getElementById('cap').src='http://<?=SITE_URL?>/cap.php' + search;
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   
   function get(obj) {
      var poststr = "name=" + encodeURI(document.getElementById("name").value) + "&email=" + encodeURI( document.getElementById("email").value ) + "&message=" + encodeURI( document.getElementById("message").value ) + "&image=" + encodeURI( document.getElementById("image").value ) + "&website=" + encodeURI( document.getElementById("website").value ) + "&title=" + encodeURI( document.getElementById("title").value ) + "&message=" + encodeURI( document.getElementById("message").value ) + "&dont_show_email=" + encodeURI( document.getElementById("dont_show_email").checked ) + "&inpurl=" + encodeURI( document.getElementById("inpurl").value );
      makePOSTRequest('comments.php', poststr);
   }
</script>
		<form method=POST action="" onSubmit="get(this.parentNode); return false;" name=f1>
		  <table width="" border="0" cellspacing="1" cellpadding="2" align="center">
		    <tr> 
		      <td width="<? $width=200; echo $width?>" align="right"><font color="red">*</font>Name: 
		        </td>

		      <td width="196" align="left">
		        <input type=text name="name" id="name" maxlength=40 size=30>
		        </td>
		    </tr>
		    <tr> 
		      <td width="<?=$width?>" align="right"><font color="red">*</font>Email:</font></td>
		      <td width="196" align="left">
		        <input type="Text" name="email" id="email" size="30" maxlength="70">
		        </td><?
$fields=explode('|', file_get_contents("$basename/data/fields.dat"));
if ($fields[0] == '1'){
?>
		    <tr> 
		      <td width="<?=$width?>" align="right">Website URL:</font></td>
		      <td width="196" align="left">
		        <input type="Text" name="website" id="website" size="30" maxlength="70">
		        </td>
		    </tr><? } if ($fields[1] == '1'){ ?>
		    <tr> 
		      <td width="<?=$width?>" align="right">Title / Subject:</font></td>
		      <td width="196" align="left">
		        <input type="Text" name="title" id="title" size="30" maxlength="70">
		        </td>
</tr><? } ?>
		    <tr> 
		      <td width="<?=$width?>"></td>
		      <td width="196" align="left">
	<? /*		<input type="checkbox" name="email_me" id="email_me"><font size=2><nobr>Notify me about new comments on this page</nobr></font><br> */ ?>
			<input type="checkbox" name="dont_show_email" id="dont_show_email" CHECKED><font size=2><nobr>Hide my email</nobr></font><br>
		        </td>

		    </tr>
		    <tr> 
		      <td valign="top" width="<?=$width?>" align="right"> 
		        <font color="red">*</font>Comments:
		      </td>
		      <td valign="top" width="196" align="left">
		        <textarea name="message" id="message" cols="40" rows="5" wrap="VIRTUAL"></textarea>
		        </td>

		    </tr>
		    <tr> 
		      <td width="<?=$width?>" align="right"><font color="red">*</font><img src='http://<?=SITE_URL?>/cap.php' id=cap name=cap></font></td>
		      <td width="196" align="left">
		        <input type="Text" name="image" id="image" size="7" maxlength="70">
		        </td>
		    </tr>
		    <tr> 
		      <td valign="top" width="<?=$width?>" align="right">&nbsp; </td>
		      <td valign="top" width="196">
		        <div align="center"><input type="hidden" name="inpurl" id="inpurl" value="<?=$_SERVER[PHP_SELF]?>">
		          <input type="submit" name="submit" value="Submit Comment">
		          </div>
		      </td>
		    </tr>

		  </table>
		</form>