function checkmail()
{
	nume = document.getElementById('nume');
	if (nume.value == '')
	{
		alert("Va rugam completati numele");
		nume.focus();
		return false;
	}
	
	email = document.getElementById('email');
	telefon = document.getElementById('telefon');

	if (email.value == '' && telefon.value == '')
	{
  		alert("Va rugam completati telefonul sau adresa de e-mail");
		email.focus();		
		return false;	
	}
	
	if (email.value != '')
	{
		if(!check_email(email.value))
		{
			alert("Adresa de e-mail este incorecta");
		 	email.focus();
			return false;
		}	
	}
	
	mesaj = document.getElementById('mesaj');

	if (mesaj.value == '')
	{
		alert("Va rugam completati mesajul");
		mesaj.focus();
		return false;
	}	
		

}

function check_email(e) 
{
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++)
	{
		if(ok.indexOf(e.charAt(i))<0)
		{ 
			return (false);
		}
	} 
	
	if (document.images) 
	{
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) 
		{
			return (-1);		
		} 
	}
}