// JavaScript Document
function MailFormKontrol(form)
{
	var msg;
	msg="";
	if ( form.email.value=="" )
	{
		msg=msg+"» Please enter your e-mail !" 
	}
	else
	{
		if(MailKontrol(form.email)== false)
		{	msg=msg+"\n» Your e-mail is irrelevant please try again !" }
	}
	if(form.isim.value!="")
	{	
		if(IsimKontrol(form.isim.value)== false)
		{	msg=msg+"\n» Please check your name !" }
	}
	if(msg=="")
	{	form.submit(); }
	else
	{
	alert(msg);
	form.focus();
	}
}
function MailKontrol(email)
{
	if (email.value!="")
	{	
		if (email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
		{ 	
    		email.focus();
			return false;	
		} 
		else
			return true;
	}
}
function IsimKontrol(name) 
{	
	var key;
	var keychar;
	for (i=0; i<name.length ; i++)
	{
		key = name.charCodeAt(i);
		keychar=name.charAt(i);
		if ((keychar.search(/^[a-zA-Z][-a-zA-Z ]*$/) > -1))
		{	continue;	}
		else if ((key == 32)||(key == 231)|| (key==199) || (key==287) || (key==286) || (key==305) || (key==105)|| (key==304) || (key==351) || (key==350) || (key==252) || (key==220)|| (key==246)|| (key==214))
		{	continue; }
		else
  			 return false;
	}
}


