
// Image Flipping.

image1A = new Image(157,57);
image1B = new Image(157,57);
image2A = new Image(157,57);
image2B = new Image(157,57);
image3A = new Image(157,57);
image3B = new Image(157,57);

image1A.src = "images/menu1.png";
image1B.src = "images/menu1a.png";
image2A.src = "images/menu2.png";
image2B.src = "images/menu2a.png";
image3A.src = "images/menu3.png";
image3B.src = "images/menu3a.png";

function SwapOut1()  {document.imageflip1.src  = image1B.src;
                     window.status = 'Software Solutions';}
function SwapBack1() {document.imageflip1.src  = image1A.src;
                     window.status = ' ';}
function SwapOut2()  {document.imageflip2.src  = image2B.src;
                     window.status = 'Web Tops';}
function SwapBack2() {document.imageflip2.src  = image2A.src;
                     window.status = ' ';}
function SwapOut3()  {document.imageflip3.src  = image3B.src;
                     window.status = 'Customer Base';}
function SwapBack3() {document.imageflip3.src  = image3A.src;
                     window.status = ' ';}

//-----------------------------------------------------------------------
// Check an entered email address.
//-----------------------------------------------------------------------
function checkEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

//-----------------------------------------------------------------------
// This function validates that the mandatory fields have been filled in.
//-----------------------------------------------------------------------
function validateFeedback() {

   // Check a name has been entered.
   mName = document.feedbackForm.mailName.value;
   if (mName == '') {
      alert("A name has not been entered!");
      document.feedbackForm.mailName.focus();
      return false;
   }
 
   // Check an email Address has been entered.
   mEmail = document.feedbackForm.mailEmail.value;
   if (mEmail == '') {
      alert("An email address has not been entered!");
      document.feedbackForm.mailEmail.focus();
      return false;
   }

   if (!checkEmail(mEmail)) {
      alert("An invalid email address has been entered!");
      document.feedbackForm.mailEmail.focus();
      return false;
   }
 
   // OK to submit.
   return true;
}
