function returnSelection(radioField)
    {
    var selection = null;
    for (i=0; i < radioField.length; i++)
        {
        if (radioField[i].checked)
           {
           selection=radioField[i].value;
           return selection; 
           }
        }
    return selection; 
    }

  // Check if Field contains something
  function ContainsSomething(Field)
   {
   if ((Field.type == "text") || (Field.type == "textarea") || (Field.type == "password"))
      {
      if (Field.value == "")
         {
         return false;
         }
      }
   else
      {   
      if (returnSelection(Field) == null)
         {
         return false;
         }
      }

   return true;
   }
   
   function CheckSupportForm(Form){
  
  if(!ContainsSomething(Form.Name)){
    alert("Please enter your name.");
    Form.Name.focus();
    return false;
  }
   if(!IsValidEmail(Form.Email)){
    alert ("Email should not be blank or invalid");
    Form.Email.focus();
    return false;
  }
  if(!ContainsSomething(Form.Tel)){
    alert("Please enter your phone number");
    Form.Tel.focus();
    return false;
  }
 
  if(!ContainsSomething(Form.Fax)){
    alert("Please enter your fax number");
    Form.Fax.focus();
    return false;
  }
   

  return true;
}
   
  // Check for valid (ie containg "@", ".", 
  // and more than 6 characters) email-address in Field
  function IsValidEmail(Field)
    {
   if (!ContainsSomething(Field))
      {
      return false;
      }
    if (Field.value.indexOf("@")==-1  
        || Field.value.indexOf(".")==-1 
        || Field.value.indexOf(" ")!=-1 
        || Field.value.length<6)
       {
       return false;
       }
    else
       {
       return true;
       }
    }   
  
  // Check if Field contains a valid date of the form dd/mm/yy
  function IsValidDate(Field)
    {
   if (!ContainsSomething(Field))
      {
      return false;
      }
    var indate=Field.value;
    var sdate = indate.split("/")
  
    var chkDate = new Date(Date.parse(indate))

    var cmpDate = (chkDate.getMonth()+1)+
                   "/"+(chkDate.getDate())+
                   "/"+(chkDate.getYear())
    var indate2 = (Math.abs(sdate[0]))+"/"+(
                   Math.abs(sdate[1]))+
                   "/"+(Math.abs(sdate[2]))
    if (indate2 != cmpDate || cmpDate == "NaN/NaN/NaN")
       {
       return false
       }
    else 
       {
       return true;
       }	
    }

  // Check if Field contains numeric data only
  function IsNum(Field) 
    {
   if (!ContainsSomething(Field))
      {
      return false;
      }
    theNum = parseFloat(Field.value);
    if (Field.value != '' + theNum)
       {
       return false;
       }
    return true;
    }

  // Check if Field contains only letters
  function IsOnlyLetters(Field)
   {
   if (!ContainsSomething(Field))
      {

      return false;
      }
   var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZÜÖÄ'´"
   for (i=0; i < Field.value.length; i++)
       {
       var CheckChar = Field.value.charAt(i);
       CheckChar = CheckChar.toUpperCase();
       if (Letters.indexOf(CheckChar) == -1)
          {
          return false;
          }
       }
       return true;
    }

  // Check if Field contains only digits in range Min to Max
  function IsInRange(Field, Min, Max)
    {
    if (IsNum(Field) == false)
       {
       return false;
       }
    if (Field.value < Min || Max < Field.value) 
       {
       return false;
       }
    return true;
    }

  // Check if Field is not equal to strCompare
  function IsNotEqual(Field, strCompare)
    {
    if (Field.value== strCompare)
       {
       return false;
       }
    return true;
    }
  //compare two fields
  function IsNotEqual2(Field, Field2)
    {
    if (Field.value == Field2.value)
       {
       return false;
       }
    return true;
   }

