//=============Book Order Form =============================

var justValidating = true
function validateBookForm(bookform)  // validate  data
  {
  if (!validateRealname(bookform.realname.value))  // first name valid?
    {
    bookform.realname.focus()
    return false
    }
  	if (!validateAddress(bookform.address.value))  // Address details?
    {
    bookform.address.focus()
    return false
    }
	if (!validateCounty(bookform.county.value))  // State details?
    {
    bookform.county.focus()
    return false
    }
	if (!validatePostcode(bookform.postcode.value))  // fZIP Code details
    {
    bookform.postcode.focus()
    return false
    }
	if (!validateCity(bookform.city.value))  // City Details?
    {
    bookform.city.focus()
    return false
    }
	 if (!validateCountry(bookform.country.value))  // Country Details?
    {
    bookform.country.focus()
    return false
    }
	if (!validateMailname(bookform.mailname.value))          // email valid?
    {
    bookform.mailname.focus()
    return false
    }

	
//-----------------------------------------------
  
  
  if (justValidating)  // only show alert box if validating, not submitting
    alert("Your data is valid. You may submit the form.")  // all data valid
  return true
  }

function validateRealname(realname)
  {
  if (isBlank(realname))               // first name field blank?
    {
    alert("Enter your name, please!")
    return false
    }
    return true
  }
  
function validateAddress(address)
  {
  if (isBlank(address))               // Address is blank?
    {
    alert("Enter the Address Details, please!")
    return false
    }
  return true
  }
 function validateCounty(county)
  {
  if (isBlank(county))               // State is blank?
    {
    alert("Enter your County Details, please!")
    return false
       }
  return true
  }
  function validatePostcode(postcode)
  {
  if (isBlank(postcode))               // Post Code is blank?
    {
    alert("Enter your Post Code Dtails, please!")
    return false
       }
  return true
  }
   
 function validateCity(city)
  {
  if (isBlank(city))               // City is blank?
    {
    alert("Enter your City Details, please!")
    return false
    }
    return true
  } 
 function validateCountry(country)
  {
  if (isBlank(country))               // country name is blank?
    {
    alert("Enter a Country, please!")
    return false
    }
    return true
  } 
  
function isBlank(testStr)
  {
  if (testStr.length == 0)                     // nothing entered?
    return true
  for (var i = 0; i <= testStr.length-1; i++)  // all spaces?
    if (testStr.charAt(i) != " ")
      return false
  return true
  }
function validateMailname(mailname)
  {
  if (isBlank(mailname))                       // email blank?
    {
    alert("Enter your email address, please!")
    return false
    }
  var atsignPos = mailname.indexOf("@", 0)     // check for @
  if (atsignPos == -1)	
    {
    alert("Enter a valid email address with an @, please!")
    return false
    }
  if (mailname.indexOf(".", atsignPos) == -1)  // check for . after @	
    {
    alert("Enter a valid email domain after the @, please!")
    return false
    }
  return true
  }

//!===========--Bulletin Form--====================================-->


var justValidating = true
function validateForm(form)  // validate data
  {
  if (!validateName(form.name.value))  // first name valid?
    {
    form.name.focus()
    return false
    }
  if (!validateAddress1(form.address1.value))  // Address Details?
    {
    form.address1.focus()
    return false
    }
	if (!validateAddress2(form.address2.value))  // Address Details?
    {
    form.address2.focus()
    return false
    }
	if (!validateAddress3(form.address3.value))  // Address Details?
    {
    form.address3.focus()
    return false
    }
	if (!validateEMail(form.email.value))          // email valid?
    {
    form.email.focus()
    return false
    }
  
  if (justValidating)  // only show alert box if validating, not submitting
    alert("Your data is valid. You may submit the form.")  // all data valid
  return true
  }
function validateName(name)
  {
  if (isBlank(name))               // first name field blank?
    {
    alert("Enter your name, please!")
    return false
    }
  if (name.indexOf(" ", 0) != -1)  // two names?
    {
    alert("Enter one name only, please!")
    return false
    }
  return true
  }
function isBlank(testStr)
  {
  if (testStr.length == 0)                     // nothing entered?
    return true
  for (var i = 0; i <= testStr.length-1; i++)  // all spaces?
    if (testStr.charAt(i) != " ")
      return false
  return true
  }
  
  function validateAddress1(address1)
  {
  if (isBlank(address1))               // Address1 is blank?
    {
    alert("Enter address details in the first line, please!")
    return false
    }
  return true
  }
  
   
  function validateAddress2(address2)
  {
  if (isBlank(address2))               // Address2 is blank?
    {
    alert("Enter the address details in the second line, please!")
    return false
    }
  return true
  }
   
  function validateAddress3(address3)
  {
  if (isBlank(address3))               // Address3 is blank?
    {
    alert("Enter address details in the third line, please!")
    return false
    }
  return true
  }
  
  
function validateEMail(email)
  {
  if (isBlank(email))                       // email blank?
    {
    alert("Enter your email address, please!")
    return false
    }
  var atsignPos = email.indexOf("@", 0)     // check for @
  if (atsignPos == -1)	
    {
    alert("Enter a valid email address with an @, please!")
    return false
    }
  if (email.indexOf(".", atsignPos) == -1)  // check for . after @	
    {
    alert("Enter a valid email domain after the @, please!")
    return false
    }
  return true
  }
// end JS hide -->


//===============Contact Form Validation========================//

var justValidating = true
function validatecontForm(contform)  // validate data
  {
  if (!validatecontName(contform.contname.value))  // first name valid?
    {
    contform.contname.focus()
    return false
    }
  if (!validatecontAddress1(contform.contaddress1.value))  // Address Details?
    {
    contform.contaddress1.focus()
    return false
    }
	if (!validatecontAddress2(contform.contaddress2.value))  // Address Details?
    {
    contform.contaddress2.focus()
    return false
    }
	if (!validatecontAddress3(contform.contaddress3.value))  // Address Details?
    {
    contform.contaddress3.focus()
    return false
    }
	if (!validatecontEMail(contform.contemail.value))          // email valid?
    {
    contform.contemail.focus()
    return false
    }
  
  if (justValidating)  // only show alert box if validating, not submitting
    alert("Your data is valid. You may submit the form.")  // all data valid
  return true
  }
function validatecontName(contname)
  {
  if (isBlank(contname))               // first name field blank?
    {
    alert("Enter your name, please!")
    return false
    }
	return true
	}
 // if (contname.indexOf(" ", 0) != -1)  // two names?
  //  {
  //  alert("Enter one name only, please!")
  //  return false
 //   }
 
function isBlank(testStr)
  {
  if (testStr.length == 0)                     // nothing entered?
    return true
  for (var i = 0; i <= testStr.length-1; i++)  // all spaces?
    if (testStr.charAt(i) != " ")
      return false
  return true
  }
  
  function validatecontAddress1(contaddress1)
  {
  if (isBlank(contaddress1))               // Address1 is blank?
    {
    alert("Enter address details in the first line, please!")
    return false
    }
  return true
  }
  function validatecontAddress2(contaddress2)
  {
  if (isBlank(contaddress2))               // Address2 is blank?
    {
    alert("Enter the address details in the second line, please!")
    return false
    }
  return true
  }
   
  function validatecontAddress3(contaddress3)
  {
  if (isBlank(contaddress3))               // Address3 is blank?
    {
    alert("Enter address details in the third line, please!")
    return false
    }
  return true
  }
  
  
function validatecontEMail(contemail)
  {
  if (isBlank(contemail))                       // email blank?
    {
    alert("Enter your email address, please!")
    return false
    }
  var atsignPos = contemail.indexOf("@", 0)     // check for @
  if (atsignPos == -1)	
    {
    alert("Enter a valid email address with an @, please!")
    return false
    }
  if (contemail.indexOf(".", atsignPos) == -1)  // check for . after @	
    {
    alert("Enter a valid email domain after the @, please!")
    return false
    }
  return true
  }
// end JS hide -->

//================Site Navigation===================


<!--
img1=new Image()
img1.src="images/med.jpg"
img2=new Image()
img2.src="images/med.jpg"
ns6_index=0

function change(e){

if(!document.all&&!document.getElementById)
return

if (!document.all&&document.getElementById)
ns6_index=1

var source=document.getElementById&&!document.all? e.target:event.srcElement
if (source.className=="folding"){
var source2=document.getElementById&&!document.all? source.parentNode.childNodes:source.parentElement.all
if (source2[2+ns6_index].style.display=="none"){
source2[0].src="images/med.gif"
source2[2+ns6_index].style.display=''
}
else{
source2[0].src="images/med.gif"
source2[2+ns6_index].style.display="none"
}
}
}
document.onclick=change
//-->
