function check(object_id) {
    with (document.getElementById(object_id))
        checked = !checked;
}


function validateForm() 
{
 var okSoFar=true
 with (document.phpformmailer)
 {
  
  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  var e1 = email.value
  var e2 = email2.value
  if (!(e1==e2) && okSoFar)
  {
    okSoFar = false
    alert ("Email addresses you entered do not match.  Please re-enter.")
    email.focus()
  }
  
  if (phone.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter a phone number.")
    thesubject.focus()
  }
  if (themessage.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter the details for your enquiry.")
    themessage.focus()
  }
  if (okSoFar==true)  submit();
 }
}

function validateForm1() 
{
 var okSoFar=true
 with (document.phpformmailer1)
 {
  
  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  if (okSoFar==true)  submit();
 }
}

function validateQuote() 
    { 
        var frm = document.forms["phpquote"];  
        var numericExpression = /^[0-9]+$/;
        var ndiscs = frm.ndiscs.value;
        var d1 = frm.elements.disc;

        if (!ndiscs.match(numericExpression) || ndiscs < 50) {
            alert("You must enter a number of discs from 50 to 1500.");            
            return false;
            setFocus("ndiscs");                        
        }
        
        if (ndiscs > 1500) {
            alert("Please contact us if you would like more than 1500 discs, for preferential rates.");            
            return false;
            setFocus("ndiscs");                        
        }
        
        for(var i=0; i<d1.length; i++){
            if(d1[i].checked) return true();
        }
        alert("You must select either CD, DVD or Blue-Ray Discs.");        
        return false; 
        
        setFocus("ndiscs");        
             
    }
    
function validateQuoteMail() 
{
 var okSoFar=true
 with (document.quotemailer)
 {
  if (name.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter your name.")
    thesubject.focus()
  }
  var foundAt = email.value.indexOf("@",0)
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email.focus()
  }
  var e1 = email.value
  var e2 = email2.value
  if (!(e1==e2) && okSoFar)
  {
    okSoFar = false
    alert ("Email addresses you entered do not match.  Please re-enter.")
    email.focus()
  }
  if (phone.value=="" && okSoFar)
  {
    okSoFar=false
    alert("Please enter a phone number.")
    thesubject.focus()
  }
  
  if (okSoFar==true)  submit();
 }
}
 
