function signup()
{	
	var goodEmail 	= $F("email").match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	apos		= $F("email").indexOf("@");
	dotpos		= $F("email").lastIndexOf(".");
	lastpos		= $F("email").length-1;
	var badEmail 	= (apos<1 || dotpos-apos<2 || lastpos-dotpos<2);

	if (($F("email") == "") || (!goodEmail && badEmail))		
	{
		alert("Lutfen gecerli bir mail adresi girin.");
		$("email").focus();
		return false;
	}
	var url = "maillist.php";
	var params='email='+$F("email");
	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" || req.responseText=="0")	
		{
			$("loading").hide();
			$("okmessage").show();
			$("submit").show();
			$("email").clear();
		}
		if (req.responseText=="error")	
		{
			alert("Hata olustu.Lutfen tekrar deneyin.");
			$("loading").hide();
			$("okmessage").hide();
			$("submit").show();
		}
	}
	function showException()
	{
		alert("Server ve istemci arasinda bir hata olustu.Daha sonra tekrar deneyin.");
		$("loading").hide();
		$("okmessage").hide();
		$("submit").show();
		$("email").clear();
	}
}