function imageRequestForm(theForm) {
	allCorrect=true ;
  	if (theForm.strImageRequestFirstName.value=="" || 
    	theForm.strImageRequestLastName.value=="" || 
		theForm.strImageRequestEmail.value=="" || 
		theForm.strImageRequestTelephone.value=="") {
			allCorrect=false ;
	}
	if (allCorrect==false) {
		alert("Please fill in all fields marked *") ;
		return false;
	} else {
		return true;
	}
}

function checkCart(theForm) {
	allCorrect=true ;
  	if (theForm.strOrderPurpose.value=="") {
			allCorrect=false ;
	}
	if (allCorrect==false) {
		alert("Please fill in all fields marked *") ;
		return false;
	} else {
		return true;
	}
}

/* Check that fields have values. */
function tblcustomerForm(tblcustomer) {
  allCorrect=true ;
  
  if (tblcustomer.strCustomerEmail1.value=="" || 
      tblcustomer.strCustomerEmail2.value=="" ||
	  tblcustomer.strCustomerPassword1.value=="" ||
      tblcustomer.strCustomerPassword2.value=="" ||
	  tblcustomer.strCustomerFirstName.value=="" ||
      tblcustomer.strCustomerLastName.value=="" ||
      tblcustomer.strCustomerAddress.value=="" ||
      tblcustomer.strCustomerCity.value=="" ||
      tblcustomer.strCustomerPostcode.value=="" ||
      tblcustomer.strCustomerCountryCode.value=="" ||
	  tblcustomer.strCustomerTelephone.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
if (tblcustomer.strCustomerEmail1.value != tblcustomer.strCustomerEmail2.value)
  {
    alert("Entered email addresses are not the same")
	tblcustomer.strCustomerEmail2.focus()
	tblcustomer.strCustomerEmail2.select()
	return false 
  } 
if (tblcustomer.strCustomerPassword1.value != tblcustomer.strCustomerPassword2.value)
  {
    alert("Entered passwords are not the same")
	tblcustomer.strCustomerPassword1.focus()
	tblcustomer.strCustomerPassword1.select()
	return false 
  } 
    return true ;
}

function checkoutForm(checkout) {
  allCorrect=true ;
  
  if (checkout.idDelivery.value=="" || 
      checkout.idPayment.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

function emailForm(email) {
  allCorrect=true ;
  
  if (email.strCustomerEmail1.value=="" || 
      email.strCustomerEmail2.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

function billingForm(billing) {
  allCorrect=true ;
  
  if (billing.strCustomerFirstName.value=="" ||
      billing.strCustomerLastName.value=="" ||
      billing.strCustomerAddress.value=="" ||
      billing.strCustomerCity.value=="" ||
      billing.strCustomerPostcode.value=="" ||
      billing.strCustomerCountryCode.value=="" ||
	  billing.strCustomerTelephone.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

function deliveryeditForm(deliveryedit) {
  allCorrect=true ;
  
  if (deliveryedit.strCustomerDeliveryName.value=="" ||
      deliveryedit.strCustomerDeliveryFirstName.value=="" ||
      deliveryedit.strCustomerDeliveryLastName.value=="" ||
      deliveryedit.strCustomerDeliveryAddress.value=="" ||
      deliveryedit.strCustomerDeliveryCity.value=="" ||
      deliveryedit.strCustomerDeliveryPostcode.value=="" ||
      deliveryedit.strCustomerDeliveryCountryCode.value=="" ||
	  deliveryedit.strCustomerDeliveryTelephone.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

function deliveryaddForm(deliveryadd) {
  allCorrect=true ;
  
  if (deliveryadd.strCustomerDeliveryName.value=="" ||
      deliveryadd.strCustomerDeliveryFirstName.value=="" ||
      deliveryadd.strCustomerDeliveryLastName.value=="" ||
      deliveryadd.strCustomerDeliveryAddress.value=="" ||
      deliveryadd.strCustomerDeliveryCity.value=="" ||
      deliveryadd.strCustomerDeliveryPostcode.value=="" ||
      deliveryadd.strCustomerDeliveryCountryCode.value=="" ||
	  deliveryadd.strCustomerDeliveryTelephone.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

function passwordForm(password) {
  allCorrect=true ;
  
  if (password.strCustomerPasswordOld.value=="" ||
      password.strCustomerPassword1.value=="" ||
	  password.strCustomerPassword2.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
if (password.strCustomerPassword1.value != password.strCustomerPassword2.value)
  {
    alert("Entered passwords are not the same")
	password.strCustomerPassword1.focus()
	password.strCustomerPassword1.select()
	return false 
  } 
    return true ;
}

/* Special purpose routine to check the fields that are supposed to be filled have been filled
   or else return back to the form. */
function contactForm(contact) {
  allCorrect=true ;
  
  if (contact.FirstName.value=="" || 
      contact.LastName.value=="" ||
	  contact.Phone.value=="" ||
	  contact.Email.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in all fields marked *") ;
	return false ;
  } 
    return true ;
}

