<!-- hide

// -------------------------------------------------------
//  Javascript written by Jae Yoon			  
//  Copyright © 1995-2007, Jae Yoon. All rights reserved. 
//  You can copy the source but just keep the recognition 
//  to the programmer					  
//  Ideas are priceless, Say NO to piracy!		  
// -------------------------------------------------------

function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;             
if (dc.length > 0) {              
   begin = dc.indexOf(cname);       
   if (begin != -1) {           
	begin += cname.length;       
	end = dc.indexOf(";", begin);
	if (end == -1) end = dc.length;
	return unescape(dc.substring(begin, end));
        }
   }
return null;
}

function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + 
((expires != null) ? "; expires=" + expires.toGMTString() : "")
+ "; path=/";
}

function setName() {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var prompt=i = document.Mail.name.value;
setCookie("name", i, expdate);
}

function getName() {
   if(getCookie("name") != null) {
   document.Mail.Name.value = getCookie("emailname");
   }
}

function getInfo() {
var now= new Date();
document.Mail.InfoDivider1.value = "=============================================";
document.Mail.InfoDate.value = "Date:" + now;
document.Mail.InfoBrowser.value = "Browser: " + navigator.userAgent;
document.Mail.InfoReferrer.value = "URI: " + document.referrer;
document.Mail.InfoDivider2.value = "=============================================";
}

function checkMultiple() {
   if (getCookie("emailsent") == 'true') return true;
   else return false;
}

function process() {
setCookie("emailsent", "true");
with (document.Mail) {
if (Subject.selectedIndex == 1) action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Comment";
else if (Subject.selectedIndex == 2) action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Question";
else if (Subject.selectedIndex == 3) action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Suggestion";
else if (Subject.selectedIndex == 4) action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Broken Link/Error";
else if (Subject.selectedIndex == 5) action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Request for posting an item in CEE web"; 
else action = "mailto:yoon@cee.odu.edu?subject=[CEE Web Form Mail] Other";
   }
alert("Your e-mail has been sent out. Thank you very much for your input.");
}

function formCheck() {
var passed = false;
with (document.Mail) {
   if (Subject.selectedIndex == 0) { 
   alert("Please pick a subject.");
   Subject.focus();
   }
   else if (Name.value == "") {
   alert("Please inlcude your name.");
   Name.focus();
   }
   else if (Email.value == "") {
   alert("Please inlcude your e-mail address.");
   Email.focus();
   }
   else if (Message.value == "") {
   alert("No message entered, Please type your message");
   Message.focus();
   }
   else {
   process();
   passed = true;
   }
}
return passed;
}




// -->
