
function clrtxt(fieldObject){//Clear Text box
   fieldObject.value="";}

function getRadioValue(radiobtn){//Check if radio button is checked
   var value = null;
   for (var i=0; i<radiobtn.length; i++){
       if (radiobtn[i].checked) {
           value = radiobtn[i].value;}
        }
    return value;
} 
function validateform(theForm){
var counter=0;
if(theForm.CustName.value=="")
    {
      alert("Please Enter Your Name in the space provided");
      theForm.CustName.focus();
      return (false);
    }
if(theForm.CustEmail.value=="")
    {
      alert("Please Enter Your Email Address in the space provided");
      theForm.CustEmail.focus();
      return (false);
    }
	
var Temp     = theForm.CustEmail.value
var AtSym    = Temp.indexOf('@')
var Period   = Temp.lastIndexOf('.')
var Space    = Temp.indexOf(' ')
var Length   = Temp.length - 1   // Array is from 0 to length-1

if ((AtSym < 1) ||                     // '@' cannot be in first position
   (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
   (Period == Length ) ||             // Must be atleast one valid char after '.'
   (Space  != -1))                    // No empty spaces permitted
    { alert('Please enter a valid e-mail address!');
      theForm.CustEmail.focus();
      return (false);
     }
return (true);
}
