function isEmail(string)
{
if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}

function check()
	{ 
	
		var sw=0;
		var newsl=0;

		if (document.getElementById('nume').value.length == 0)
		{
			alert('Va rugam sa va introduceti numele! \n');
			sw=1;
		}
		if ((document.getElementById('email').value.length == 0)&&(sw==0))
		{
			alert('Va rugam sa va introduceti adresa de e-mail! \n');
			sw=1;
		}  
		if ((isEmail(document.getElementById('email').value) == false)&&(sw==0))
		{
			alert('Va rugam sa introduceti o adresa de e-mail valida! \n');
			sw=1;
		}
		if ((document.getElementById('tel').value.length == 0)&&(sw==0))
		{
			alert('Va rugam sa va introduceti numarul de telefon! \n');
			sw=1;
		}																
		if ((document.getElementById('message').value.length == 0)&&(sw==0))
		{
			alert('Va rugam sa introduceti mesajul dvs.! \n');
			sw=1;
		}  			    				
	if (sw==0)
	{	    
	    window.location.href='http://z.ekontent.ro/DoEmail.aspx?redirect=http://www.primarie6.ro/contact/mesaj-trimis.aspx&from='+document.getElementById('email').value+'&to=media@primarie6.ro&subiect=Petitie%20electronica&mesaj=Nume: '+document.getElementById('nume').value+'<br /> E-mail: '+document.getElementById('email').value+'<br /> Telefon: '+document.getElementById('tel').value+'<br /> Mesaj: '+document.getElementById('message').value;
	}
}

      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }





function newsletter()
	{ 
	
		var sw=0;

		if (document.getElementById('inscriere').value.length == 0)
		{
			alert('Va rugam sa va introduceti adresa de e-mail! \n');
			sw=1;
		}
		if ((isEmail(document.getElementById('inscriere').value) == false)&&(sw==0))
		{
			alert('Va rugam sa introduceti o adresa de e-mail valida! \n');
			sw=1;
		}	
	    				
	if (sw==0)
	{	    
	    window.location.href='http://www.primarie6.ro/homepage/utils/newsletter.aspx?subscription_email='+document.getElementById('inscriere').value+'&subscription_birthday=12.12.2007&subscription_sex=1&subscription_active=1';
	}
}