// JavaScript Document
function check(){
var txt1=document.all.txt1.value;
var txt2=document.all.txt2.value;
var txt5=document.all.txt5.value;
var txt9=document.all.txt9.value;
var txt10=document.all.txt10.value;
var txt4=document.all.txt4.value;
if (txt1==""||txt2==""||txt5==""||txt9==""||txt10==""){
alert("Please input the item with red star");
return false;
}
if (txt4!=""){
	if (isNaN(txt4)){
		alert("The postcode could be number£¡");
		return false; }}
if (isTel(txt5)){
return isEmail(txt9);}
else
{return false;}
}
function isEmail (theStr) {
 var atIndex = theStr.indexOf('@');
 var dotIndex = theStr.indexOf('.', atIndex);
 var flag = true;
 theSub = theStr.substring(0, dotIndex+1)

 if ((atIndex < 1)||(atIndex != theStr.lastIndexOf('@'))||(dotIndex < atIndex + 2)||(theStr.length <= theSub.length)) 
 { alert("Please input your correct email");
  return(false); }
 else 
 { return(true); }
}
function isTel(s)
{
 var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
 if (!patrn.exec(s)) {
 alert("Please input your correct telephone number or fax number");
 return false;}
 return true
}