/* author: Unregistered user */
/* creation date: 10/25/2000 */

function checkLoginForm(form)
{
  msg = "";

  mess(form.MEMBERPASSWORD,"-- The field Password is Invalid.\n");
  mess(form.MEMBERLOGIN,"-- The field Login is Invalid.\n");
 
  if (msg != "")
  {
	alert("The following error(s) occured:\n\n" +  msg);
	return false;
  } 
  else 
  {
    return true;  
  }
}

function checkRegistration(form)
{
  msg = "";

  mess(form.PHONE,"-- The field Phone is Invalid.\n");
  
  if (!isEmail(form.EMAIL.value))
  {
  	 msg = "-- The field Email is Invalid.\n" + msg;
	 form.EMAIL.focus();
  }
  
  mess(form.COUNTRY,"-- The field Country is Invalid.\n");
  mess(form.CITY,"-- The field City is Invalid.\n");
  mess(form.ADDRESS1,"-- The field Address1 is Invalid.\n");
  mess(form.CLIENTNAME,"-- The field Client Name is Invalid.\n");
  
  mess(form.CDSNUMBER,"-- The field CDS Account No is Invalid.\n");
  if (!isNaN(form.CDS))
  {
  	 msg = "-- The field CDS Account No must be a number!\n" + msg;
	 form.CDSNUMBER.focus();
  }
  
  if (form.PASSWORD.value != form.CONFIRMPASSWORD.value)
  {
  	 msg = "-- The field Confirm Password is different from your Password!\n" + msg;
	 form.PASSWORD.focus();
  }

  if (form.PASSWORD.value.length < 6)
  {
  	 msg = "-- The field Password must contain at least 6 characters !\n" + msg;
	 form.PASSWORD.focus();
  }

  if (form.LOGIN.value.length < 6)
  {
  	 msg = "-- The field Login must contain at least 6 characters !\n" + msg;
	 form.LOGIN.focus();
  }
 
  if (msg != "")
  {
	alert("The following error(s) occured:\n\n" +  msg);
	return false;
  } 
  else 
  {
    return true;  
  }
} //end check()




function checkContactForm(form)
{
  msg = "";

  if ((form.UserFAX.value == "") && (form.UserTel.value == "") && (form.UserEmail.value == ""))
  {
  	msg = "-- You did not specify a mean to contact you.\n" + msg;
	form.UserEmail.focus();
  }
  
  if (form.UserEmail.value != "")
  	if (!isEmail(form.UserEmail.value))
	{
	  	msg = "-- Invalid email format.\n" + msg;
		form.UserEmail.focus();
	}
  
  mess(form.Username,"-- The field Name is empty.\n");
  mess(form.Comments,"-- The field Comments is empty.\n");

  if (msg != "")
  {
	alert("The following error(s) occured:\n\n" +  msg);
	return false;
  } 
  else 
  {
    return true;  
  }
} //end check()




var win;

function displayCustomer(url)
{
	win = window.open(url, "win", "width=470,height=450,scrollbars=1"); // a window object
	win.document.close();
}


function checkField(form)
{
	if (form.TEXTFIELD.value == "")
	{
		alert("Field is empty!");
		form.SEARCH.disabled = true;
		return false;
	}
	else
		form.submit();
		return true;
}

