 function validatelinkfrm(txt_webaddressID ,txt_titleID,txt_descriptionID ,txt_EmailID)
  {
    validity = true;
    if (!check_empty(document.getElementById(txt_webaddressID).value))
       
       {  
        alert('The webaddress field is empty!'); 
        document.getElementById(txt_webaddressID).focus();
        validity = false;
        return validity;
       }
      
      if(!check_url(document.getElementById(txt_webaddressID).value))
        { 
            alert('webaddress URL field is invalid!');
            document.getElementById(txt_webaddressID).focus();
            validity = false;
            return validity;
        }
               
        
    if (!check_empty(document.getElementById(txt_titleID).value))
       
       {  
        alert('The Title field is empty!'); 
        document.getElementById(txt_titleID).focus();
        validity = false;
        return validity;
       }
       
     if (!check_empty(document.getElementById(txt_descriptionID).value))
       
       {  
        alert('The Description field is empty!'); 
        document.getElementById(txt_descriptionID).focus();
        validity = false;
        return validity;
       }
       
       if (!check_empty(document.getElementById(txt_EmailID).value))
       {  
        alert('The email field is empty!'); 
        document.getElementById(txt_EmailID).focus();
        validity = false;
        return validity;
       }
       if (!check_email(document.getElementById(txt_EmailID).value))
        { 
         
        alert('Email address is invalid!'); 
        document.getElementById(txt_EmailID).focus();
        validity = false;
        return validity;
        }
       
    return validity;
    
  }
  
// returns false if empty
function check_empty(text) 
{
    return (text.length > 0); 
}

function check_email(address) 
{
  if ((address == "")|| (address.indexOf ('@') == -1) || (address.indexOf ('.') == -1))
      return false;
  return true;
}

function check_url(address) {
  if ((address == "")

    || (address.indexOf ('http://') == -1)
    || (address.indexOf ('.') == -1))
      return false;
  return true;
}