//<!--	
	
	function fvalidation_search(){
		
		if (isEmpty(document.f.T1))
		{
			window.alert("Please type a keyword");
			document.f.T1.focus();
			return false;	
		}		
		if (!CharacterFilter(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-!@#$()[]{}",document.f.T1,"Invalid character!"))
		 { return false;}
	}
	
	
function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	window.alert("Invalid email address ! xxxcc");
	document.comment.email.focus();
	return false;
}
var user=matchArray[1]
var domain=matchArray[2]

if (user.match(userPat)==null) {
    // user is not valid
    window.alert("Invalid email address ! xx");
    document.comment.email.focus();
    return false;
}

var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        window.alert("Invalid email address !");
	        document.comment.email.focus();
		return false;
	    }
    }
    return true
}

var domainArray=domain.match(domainPat)
if (domainArray==null) {
	window.alert("Invalid email address !");
	document.comment.email.focus();
    return false;
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   window.alert("The address must end in a three-letter domain, or two letter country.");
   document.comment.email.focus();
   return false;
}

if (len<2) {
   var errStr="Invalid email address !";
   window.alert(errStr);
   document.comment.email.focus();
   return false;
}

return true;
}

	
	function fvalidation_comment(){

		if (isEmpty(document.comment.name))
		{
			window.alert("Please type your name");
			document.comment.name.focus();
			return false;
		}	
		
		if (isEmpty(document.comment.textcomment))
		{
			window.alert("Please type your comment");
			document.comment.textcomment.focus();
			return false;
		}	
		if (isEmpty(document.comment.email))
		{
			//window.alert("Please type your comment");
			//document.comment.Comment.focus();
			return true;
		}	
		else 
		{
			if (emailCheck(document.comment.email.value) == false)
				{ return false;}
		}
		
		if (!CharacterFilter(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-!@.",document.comment.name,"Invalid character!"))
		 { return false;}
		if (!CharacterFilter(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-!@._",document.comment.email,"Invalid character!"))
		 { return false;}
		if (!CharacterFilter(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-!@_=/\|?<>;,*^()[]{}.",document.comment.comment,"Invalid character!"))
		 { return false;}

	}
	
//-->