/***********************************************
* Email Validation script- ? Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

/*function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}*/

function InstantMsg_form(thisform){
with (thisform){

if (name.value=="") {alert("Please key-in your name"); name.focus(); return false}
else if (msg.value=="") {alert("Please key-in your message"); msg.focus(); return false}
}
}

function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;

 return true;
}

function cancel()
{
	window.location="index.php";	
}

function Comment_form(thisform){
with (thisform){
	
	if (name.value=="") {alert("Please key-in name"); name.focus(); return false}
	else if (emailfilter.test(email.value)==false) {alert("Please enter a valid email address."); email.focus(); return false}
	else if (content.value=="") {alert("Please key-in your comment"); content.focus(); return false}
}
}
