
/* check enquiry form */
function enquiryForm(theForm) {
  allCorrect=true ;
  
  if (theForm.Name.value=="" || 
	  theForm.Phone.value=="" ||
	  theForm.Email.value=="" ) {
    allCorrect=false ;
  }
  if (allCorrect==false)
  {
    alert("Please fill in your Name, Phone and Email.") ;
	return false ;
  } 
    return true ;
}

/* Generic check email function*/
function checkEmail(emailAddy) {
  if (emailAddy.value.length==0)
  {
    return true ;
  }
  if (emailAddy.value.indexOf("@",0) < 1 || emailAddy.value.indexOf(".",0) < 1)
  {
    alert("Please check the field:\n The email address appears incorrectly formed") ;
    emailAddy.focus() ;
	return false ;
  }
  return true ;
}

/* Generic phone number checker allowing brackets for prefix */
function checkPhone(phoneField) {
  allNumeric=true ;
  if (phoneField.value.length==0)
  {
    return true ;
  }
  
  for (i=0 ; i<phoneField.value.length ; i++)  {    checkChar=phoneField.value.charAt(i) ;
    if (checkChar!=' ' && checkChar!='\(' && checkChar!='\)'  && (checkChar<'0' || checkChar>'9') )
	{
	  allNumeric=false ;
	}  
  }
  
  if (allNumeric==false)
  {
    alert("Please check the field:\n Only numbers, spaces and \(\) permitted");
	phoneField.focus() ;
	return false ;
  }
  return true ;
}
function FlashControl(ClsId,Url,Width,Height,AutoStart)
{
	document.write('<object classid="' + ClsId + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + Width + '" height="' + Height + '">')
	document.write('<param name="movie" value="' + Url + '">')							  
	document.write('<param name="wmode" value="Opaque">')
	document.write('<param name="quality" value="high">')
	document.write('<embed src="' + Url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + Width + '" height="' + Height + '" wmode="Opaque"></embed>')
	document.write('</object>')
}