function signup()
{	
	//EMAIL VALIDATION
	var goodEmail 	= $F("nwsmail").match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\.si)|(\.eu)|(\.yu)|(\..{2,2}))$)\b/gi);
	apos		= $F("nwsmail").indexOf("@");
	dotpos		= $F("nwsmail").lastIndexOf(".");
	lastpos		= $F("nwsmail").length-1;
	var badEmail 	= (apos<1 || dotpos-apos<2 || lastpos-dotpos<2);

	if (($F("nwsmail") == "") || (!goodEmail && badEmail))		
	{
		//alert("Prosim vpišite vaš E-naslov");
		$("nwsmail").focus();
		return false;
	}
	//YOU MAY WANT TO CHANGE THE URL IN THE LINE BELOW
	var url = "ajax-newsletter-signIn.asp";
	var params='nwsmail='+($F("nwsmail"));
	new Ajax.Request(url, {onComplete:showResponse, onException:showException, onFailure:showException, asynchronous:true, method:"post", evalScripts:false, postBody:params});
	$("submit").hide();
	$("loading").show();

	function showResponse(req)
	{	
		if (req.responseText=="1")	//1. added to contacts	//2.already in contacts
		{
			$("nwsmail").clear();
			$("loading").hide();
			$("okmessage").show();
			$("submit").show();
			$("nomessage").hide();
		return true;
		}
		if (req.responseText=="0")	//1. added to contacts	//2.already in contacts
		{
			$("nwsmail").clear();
			$("loading").hide();
			$("nomessage").show();
			$("submit").show();
			$("okmessage").hide();
		return true;
		}
		if (req.responseText=="error")	
		{
			//alert("napaka. Prosim poizkusite kasneje.");
			$("nwsmail").clear();
			$("loading").hide();
			$("submit").show();
		}
	}
	function showException()
	{
		//alert("Ste že vpisani.");
		$("loading").hide();
		$("submit").hide();
		$("nwsmail").clear();
		$("nomessage").show();
		/*$("loading").show();*/
	}
}

