  function FormValidator(theForm)
  {	  
	if (theForm.name.value == "" ) 
    {
      alert("Please provide your name.");
      theForm.name.focus();
      return (false);
    }      
    if (theForm.telephone.value == "" && theForm.email.value == "" ) 
    { 
	  alert("Please provide at least one method for us to contact you by.");
      theForm.name.focus();
	  return (false);
    }
    else 
	{
	  if(theForm.email.value != ""){
		if(check_email(theForm.email.value)==false){
		  return(false);
		}
	  }
	  if(theForm.telephone.value != ""){
		if(check_tel(theForm.telephone.value)==false){
		  return(false);
		}
	  }
    }
  }
  function check_tel(tel){
	var checkOK = "0123456789 ";
	var checkStr = arguments[0];
	var allValid = true;
	for (i = 0;  i < tel.length;  i++)
	{
	  ch = checkStr.charAt(i);
	  for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
	  break;
	  if (j == checkOK.length)
	  {
	  allValid = false;
	  break;
	  }
	}
	if (!allValid)
	{
	  alert("You seem to have entered an invalid character in your telephone number");
	  return (false);
	}
  }

  function check_email(email){
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
	var checkStr = arguments[0];
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
	  ch = checkStr.charAt(i);
	  for (j = 0;  j < checkOK.length;  j++)
	  if (ch == checkOK.charAt(j))
	  break;
	  if (j == checkOK.length)
	  {
	  allValid = false;
	  break;
	  }
	}
	if (!allValid)
	{
	  alert("You seem to have entered an invalid character in your email address");
	  return (false);
	}
	if ((checkStr.indexOf ('@',0) == -1 ||
	checkStr.indexOf ('.',0) == -1) &&
	checkStr != "")
	{
	  alert("The email address you have entered is not a valid email address");
	  return (false);
	} 
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(checkStr))) { 
	  alert("The email address you have entered is not a valid email address");
	  return (false);
	}
  }






$(document).ready(function() 
{
$('#client-logos li.cp-1').qtip({
   content: "<h3>Securitek supplied..</h3><ul class='service-bullets'><li>CCTV Installation</li><li>CCTV Maintenance</li></ul>",
   position: {
	 corner: {
	   target: 'topMiddle',
	   tooltip: 'bottomMiddle'
	 }
   },
   style: { 
      width: 200,
      padding: 5,
      background: '#333',
      color: 'white',
      textAlign: 'center',
      border: {
         width: 0,
         radius: 5,
         color: '#333'
      },
      tip: 'bottomMiddle',
      name: 'dark' // Inherit the rest of the attributes from the preset dark style
   }
   });  
  
  
$('#client-logos li.cp-2').qtip({
   content: "<h3>Securitek supplied..</h3><ul class='service-bullets'><li>CCTV Maintenance</li></ul>",
   position: {
	 corner: {
	   target: 'topMiddle',
	   tooltip: 'bottomMiddle'
	 }
   },
   style: { 
      width: 200,
      padding: 5,
      background: '#333',
      color: 'white',
      textAlign: 'center',
      border: {
         width: 0,
         radius: 5,
         color: '#333'
      },
      tip: 'bottomMiddle',
      name: 'dark' // Inherit the rest of the attributes from the preset dark style
   }
   });  
  
  
$('#client-logos li.cp-3').qtip({
   content: "<h3>Securitek supplied..</h3><ul class='service-bullets'><li>CCTV Installation</li><li>Fire Alarms</li></ul>",
   position: {
	 corner: {
	   target: 'topMiddle',
	   tooltip: 'bottomMiddle'
	 }
   },
   style: { 
      width: 200,
      padding: 5,
      background: '#333',
      color: 'white',
      textAlign: 'center',
      border: {
         width: 0,
         radius: 5,
         color: '#333'
      },
      tip: 'bottomMiddle',
      name: 'dark' // Inherit the rest of the attributes from the preset dark style
   }
   });  
  
  
  
	$(function() {
		$(".lavaLampBottomStyle").lavaLamp({
			fx: "backout",
			speed: 700,
			click: function() {}
		});
	});
	
$("#contact-button").hover(
    function () {
	  $(this).stop().animate({ backgroundColor: "#CA1D2A" }, 1000);
    }
  );

$("#contact-box").hover(
    function () {
	  $('#contact-button').stop().animate({ backgroundColor: "#CA1D2A" }, 1000);
    }, 
	function () {
	  $('#contact-button').stop().animate({ backgroundColor: "#6c0" }, 2000);
	}
  );




  
});





