function validEmail(f) { 

   var email; 
   var r;
   r=0;
   email=f.email.value; 
// 
        <!--Simon Dang 3-2001--> 
        invalidChars = " /:,;" 

        for (i=0; i<invalidChars.length; i++) { 
        // does it contain any invalid characters? 
            badChar = invalidChars.charAt(i) 
            if (email.indexOf(badChar,0) > -1) { 
       r=1;
                    // return false 
             } 
         } 
         atPos = email.indexOf("@",1) // there must be one "@" symbol 
         if (atPos == -1) { 
      r=1;
               // return false 
         } 
         if (email.indexOf("@",atPos+1) != -1) { // and only one "@" symbol 
      r=1;
                 //  return false 
          } 
         periodPos = email.indexOf(".",atPos) 
         if (periodPos == -1) {   // and at least one "." after the "@" 
      r=1;
            //return false 
         } 
         if (periodPos+3 > email.length) {// must be at least 2 characters 
      r=1;
              //  return false 
          } 
if(r==1)
	{
	alert("Adresa de email introdusa nu este buna."); 		
	return false;
	}	
else if(r!=1)
	{
          return true; 
	}          	  
}



function Validate()
{


    if (!document.form1.nfirma.value)
    {
        alert("Campul pentru nume firma este gol !Va rugam modificati!");
        document.form1.nfirma.focus();
        return false;
    }

    if (!document.form1.cpers.value)
    {
        alert("Campul pentru persoana de contact este gol !Va rugam modificati!");
        document.form1.cpers.focus();
        return false;
    }

    if (!document.form1.telmob.value)
    {
        alert("Campul pentru telefon mobil este gol !Va rugam modificati!");
        document.form1.telmob.focus();
        return false;
    }

    if (!document.form1.comentarii.value)
    {
        alert("Campul pentru comentarii este gol !Va rugam modificati!");
        document.form1.comentarii.focus();
        return false;
    }


if(!validEmail(form1))
{
	return false;
}


}


