<html>

<head>
<title>JavaFILE</title>
<script LANGUAGE="JavaScript">

// Script Author - Wildman Tim ( http://www.wildmantim.com )
// this script is Public Domain

var sid="mitnamdliw_wildmantim";

//  ********************* General Cookie handling      *********************

var exp1=new Date();//added to work with NS3.0x

function getCookieVal (offset) {

  var endstr = document.cookie.indexOf (";", offset);
          if (endstr == -1)
                    endstr = document.cookie.length;
         return unescape(document.cookie.substring(offset, endstr));

}

function GetCookie (name) {

  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;

  while (i < clen) {
    var j = i + alen;
            if (document.cookie.substring(i, j) == arg)
                      return getCookieVal (j);

    i = document.cookie.indexOf(" ", i) + 1;
            if (i == 0) 
                break;  
                

  }

  return " ";

}

function SetCookie (name, value) {

  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +

    ((expires == null) ? "" : ("; expires=" + exp1.getTime())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");

}

// Chooses a Web Site Location 

function selectaplace(form) { //default is 0; what loads is determined by OPTION SELECTED VALUE
        
        var formindex=form.thislocation.selectedIndex;
        parent.location=form.thislocation.options[formindex].value;
        
 }

var Subject="Guestbook Entry";
var CC="";
var BCC = "";

//Mailing user entered text messages
function mailUserDefined(form) {
while(sid!="mitnamdliw_wildmantim"){};

//add line feed to all fields
form.email.value="\n" + form.email.value;
form.yourname.value="\n" + form.yourname.value;
form.comments.value="\n" + form.comments.value;
form.homepage_url.value="\n" + form.homepage_url.value;

//copy this person on the mail
CC=form.copyto.value;

//change the E-mail address below to your address
form.action = "mailto:tim@wildmantim.com?subject="+Subject+"&Bcc="+BCC+"&cc="+CC;
responsePage(form);
var x = setTimeout('removeCharacters()',3000);	
return true;
}

function responsePage(form) {

var expiration = 1; //minutes
var exp2= new Date();
var exp2=(exp2.getTime() + (expiration * 60 * 1000));
var hp = "homepage";
var nm = "visitor_name";
var em = "visitor_email";
var cm = "comments";

	SetCookie(hp,form.homepage_url.value,exp2);
	SetCookie(cm,form.comments.value,exp2);
	SetCookie(nm,form.yourname.value,exp2);
	SetCookie(em,form.email.value,exp2);

	msg=parent.code.open('response.html','Response',"toolbar=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes");
	

}
		
function removeCharacters() {
	
//take out the extra characters
document.UserMailForm.email.value=document.UserMailForm.email.value.substring(1,document.UserMailForm.email.value.length);
document.UserMailForm.yourname.value=document.UserMailForm.yourname.value.substring(1,document.UserMailForm.yourname.value.length);
document.UserMailForm.comments.value=document.UserMailForm.comments.value.substring(1,document.UserMailForm.comments.value.length);
document.UserMailForm.homepage_url.value=document.UserMailForm.homepage_url.value.substring(1,document.UserMailForm.homepage_url.value.length);
}

</script>

<base target="leftframe">
</head>

<body BGCOLOR="#ffffff" link="#CC0033" vlink="#333399" alink="#FF0000" <!--content start-->

<p align="center"><img src="http://www.javafile.com/images/banner.GIF"
alt="banner.GIF (2826 bytes)"></p>

<table WIDTH="96%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
  <tr>
    <td WIDTH="100%">Nice simple script for creating your own guestbook.&nbsp; Author: <a
    href="http://www.wildmantim.com/">Wildman Tim</a><p align="center"><a
    href="http://www.javafile.com/javascripts/webdesign/guestbookbuilder.zip">Download the
    Script</a></p>
    <hr NOSHADE WIDTH="85%" SIZE="1">
    <form NAME="UserMailForm" ACTION="mailto:" METHOD="post" ENCTYPE="multipart/form-data"
    onSubmit="mailUserDefined(this)" ;>
      <b><p>Put your E-mail address here [ For Demo Only ]<br>
      [ Delete this form element in the real guestbook code ]<br>
      </b><input type="text" name="copyto" value size="30"> </p>
      <table>
        <tr>
          <td align="right"><b>Name: <input TYPE="TEXT" NAME="yourname" SIZE="35"></b></td>
        </tr>
        <tr>
          <td align="right"><b>E-mail: </b><input TYPE="text" NAME="email" SIZE="35"></td>
        </tr>
        <tr>
          <td align="right"><b>Homepage:</b> <input TYPE="text" NAME="homepage_url" value="http://"
          size="35"></td>
        </tr>
        <tr>
          <td align="left"><b>Comments:</b><br>
          <textarea ROWS="5" COLS="45" name="comments"></textarea></td>
        </tr>
        <tr>
          <td align="right"><br>
          <p><input TYPE="submit" VALUE="           Submit           "> <input TYPE="RESET"
          VALUE=" 
     Reset Form     "></td>
        </tr>
      </table>
    </form>
    </td>
  </tr>
</table>
<!--content stop-->
</body>
</html>
