function getMail(){
	var email=GetCookie("email")+"";
	if (email!="null"){
		return ("<INPUT TYPE=\"hidden\" NAME=\"email\" VALUE=\"" + email + "\">")
	}
	else{
		return ("Instructor e-mail: " + "<INPUT TYPE=\"text\" NAME=\"email\" VALUE=\"user@vt.edu\"><br>")
	}
}

function getUserMail(){
	var usermail=GetCookie("usermail")+"";
	var ttr="";
	if (usermail=="null"){
		usermail="user@vt.edu";
	}
	ttr="Your e-mail: " + "<INPUT TYPE=\"text\" NAME=\"replyto\" VALUE=\"" + usermail + "\"><br>";
	ttr=ttr + "<INPUT TYPE=\"hidden\" NAME=\"01StudentEmail\" VALUE=\"" + usermail + "\">";
	return(ttr)
}

function setUserMail(theform){
	SetCookie("usermail", theform.replyto.value,null,"/");
	SetCookie("email", theform.email.value,null,"/");
	SetCookie("lastText", theform["02" + document.title].value,null,"/");
	theform["02" + document.title].value="\r\n" + theform["02" + document.title].value;
	theform["01StudentEmail"].value=theform.replyto.value;
	theform.submit();
	return (true)
}

function lb(){
	//if (is_nav4==undefined){
		var agt=navigator.userAgent.toLowerCase();
		var is_major = parseInt(navigator.appVersion);
	    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	    var is_nav4 = (is_nav && (is_major == 4));
	//}
	if (is_nav4){
		return("<br><br><br><br><br><br>")
	}
	else{
		return("<br>")
	}
}

document.writeln("<form name=\"mailer\" method=\"post\" action=\"http://www.vt.edu/cgi-bin/disgroup/generic-mailer.pl\">");
document.writeln("<INPUT TYPE=\"hidden\" NAME=\"format\" VALUE=\"text\">");
document.writeln("<INPUT TYPE=\"hidden\" NAME=\"subject\" VALUE=\"Technical Writing Exercise: " + document.title + "\">");
document.writeln("<INPUT TYPE=\"hidden\" NAME=\"redirect\" VALUE=\"http://wiz.cath.vt.edu/tw/TechnicalWriting/forms/thanks.html\">");
document.writeln(getMail());
document.writeln(getUserMail());
document.write("<textarea name=\"02" + document.title + "\" cols=\"50\" rows=\"6\" wrap=\"virtual\"></textarea>");
document.writeln(lb() + "<input type=\"button\" value=\"Send it in\" onClick=\"setUserMail(this.form);\">");
document.writeln("</form>");