// Jack's Auto Service JavaScript Document

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var popUpWin=0;
function popUpWindow2(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function verify(){
var Name = document.friendform.Name.value;
var Email = document.friendform.Email.value;
var F1Name = document.friendform.F1Name.value;
var F1Email = document.friendform.F1Email.value;
var F2Email = document.friendform.F2Email.value;
var F3Email = document.friendform.F3Email.value;
if (Name == ""){
alert("Please enter your first name")
document.friendform.Name.focus();return false; }
if (Email== ""){
alert("Please enter your email address")
document.friendform.Email.focus();return false; }
if (!checkemail(Email)){
alert("Your email address is not valid, please try again")
document.friendform.Email.focus();return false;}
if (F1Name == ""){
alert("Please enter your friend's name")
document.friendform.F1Name.focus();return false; }
if (F1Email == ""){
alert("Please enter your friend's email")
document.friendform.F1Email.focus();return false; }
if (!checkemail(F1Email)){
alert("The 1st email address is not valid, please try again")
document.friendform.F1Email.focus();return false;}
if (!F2Email == ""){
if (!checkemail(F2Email)){
alert("The 2nd email address is not valid, please try again")
document.friendform.F2Email.focus();return false;}
}
if (!F3Email == ""){
if (!checkemail(F3Email)){
alert("The 3rd email address is not valid, please try again")
document.friendform.F3Email.focus();return false;}
}
}
function checkemail(str){
if(!str.match(/^[\w]{1}[\w\.\&\-_]*@[\w]{1}[\w\-_\.]*\.[\w]{2,6}$/i)){
return false;
} else {
return true;
}
}