function validform()
   {     
     if(document.getElementById('firstname').value=="")
      {
         alert('Please insert your first name.');
         document.getElementById('firstname').focus();
         return false;
      }
     var text=document.getElementById('firstname').value;
     for ( c=0; c < text.length; c ++ )
      {
        alpha = (text.charCodeAt(c)>=65 && text.charCodeAt(c)<=90) || (text.charCodeAt(c)>=97 && text.charCodeAt(c)<=122 ) || text.charCodeAt(c)==32
        if ( !alpha )
         {
           alert('Sorry, invalid first name.\nType alphanumeric character (a-z) only.');
           document.getElementById('firstname').select();
           return false;
         }
      }      
     if(document.getElementById('lastname').value=="")
      {
         alert('Please insert your last name.');
         document.getElementById('lastname').focus();
         return false;
      }
     var text=document.getElementById('lastname').value;
     for ( c=0; c < text.length; c ++ )
      {
        alpha = (text.charCodeAt(c)>=65 && text.charCodeAt(c)<=90) || (text.charCodeAt(c)>=97 && text.charCodeAt(c)<=122 ) || text.charCodeAt(c)==32
        if ( !alpha )
         {
           alert('Sorry, invalid last name.\nType alphanumeric character (a-z) only.');
           document.getElementById('lastname').select();
           return false;
         }
      }   
     if(document.getElementById('day').value=="")
      {
         alert('Please select day.');
         document.getElementById('day').focus();
         return false;
      }   
     if(document.getElementById('mon').value=="")
      {
         alert('Please select month.');
         document.getElementById('mon').focus();
         return false;
      }
     if(document.getElementById('year').value=="")
      {
         alert('Please select year.');
         document.getElementById('year').focus();
         return false;
      }
     if(document.getElementById('address').value=="")
      {
         alert('Please insert address.');
         document.getElementById('address').focus();
         return false;
      }
     if(document.getElementById('contactnumber').value=="")
      {
         alert('Please insert contact number.');
         document.getElementById('contactnumber').focus();
         return false;
      }   
     if(isNaN(document.getElementById('contactnumber').value) == true)
      {
         alert("Sorry, invalid contact number.\nOnly numbers between 0-9.");
         document.getElementById('contactnumber').select();
         return false;
      }
     if(document.getElementById('email').value=="")
      {
         alert('Please insert your e-mail.');
         document.getElementById('email').focus();
         return false;
      } 
     var errMsg,pos;
     errMsg = '';
     pos = document.getElementById('email').value.indexOf("@")
     if (pos == -1)
      {
         alert("Sorry, invalid e-mail id.");
         document.getElementById('email').select();
         return false;
      }
     else if (document.getElementById('email').value.lastIndexOf(".") < pos)
      {
         alert("Sorry, invalid e-mail id.");
         document.getElementById('email').select();
         return false;
      }    
     if(document.getElementById('appliedfor').value=="")
      {
         alert('Please select position applied for.');
         document.getElementById('appliedfor').focus();
         return false;
      }    
     if(document.getElementById('education').value=="")
      {
         alert('Please select educational qualifications.');
         document.getElementById('education').focus();
         return false;
      }
     else if(document.getElementById('education').value=="Others")
      {
        if(document.getElementById('otherquali').value=="")
         {
            alert('Please select educational qualifications.');
            document.getElementById('otherquali').focus();
            return false;
         }
      }
     if(document.getElementById('workexp').value=="")
      {
         alert('Please select work experience.');
         document.getElementById('workexp').focus();
         return false;
      }
     if(document.getElementById('industry').value=="")
      {
         alert('Please select last industry worked with.');
         document.getElementById('industry').focus();
         return false;
      }
     else
      {
         return true;
      }
   }

  function checkqualification()
   {               
     if(document.getElementById('education').value=="Others")
      {
        document.getElementById('otherquali').disabled=false;
      }
     else
      {
        document.getElementById('otherquali').value="";
        document.getElementById('otherquali').disabled=true;
      }
   }