// JavaScript Document
function check(){
var txt=document.all.txt.value;
var txt1=document.all.txt1.value;
var txt2=document.all.txt2.value;
var txt3=document.all.txt3.value;
var txt4=document.all.txt4.value;
var txt5=document.all.txt5.value;
if (txt==""||txt1==""||txt3==""||txt4==""||txt5==""){
alert("Please input the item with red star");
return false;
}
if (isTel(txt4)){
return isEmail(txt3);}
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
}