//Kullanıcı adı ve şifre kontrolü
	function isEmpty(s){return ((s == null) || (s.length == 0))}

	function isWhitespace (s)
	{
		var whitespace = " \t\n\r";
		var i;
		if (isEmpty(s)) return true
		for (i = 0; i < s.length;i++)	{
			var c = s.charAt(i);
			if (whitespace.indexOf(c) == -1)
					return false
		}
		return true
	}
	function check(form)
	{
		var user_nick = form.user_nick.value;
		var user_pass = form.user_pass.value;
		if (isWhitespace(user_nick) || isWhitespace(user_pass))
		{
	    alert("Lütfen kullanıcı adı ve şifrenizi eksiksiz giriniz.");
        form.user_nick.focus();
	    return false;
    }
    
    var loginPatt = /^\w{1}[-\.\w]{1,15}$/;
    var passPatt = /^[-\.\w]{6,16}$/;

		if (user_nick.length < 2 || user_pass.length > 16){
			alert("Kullanıcı adınızı kontrol edip tekrar deneyiniz.");
			form.user_nick.focus();
			return false;
	  } 
		return true
	}

//Arama kriteri kontrolü
function kontrol(fieldname,formname){
  if(!formname) formname = 0;
  if(document.forms[formname].elements[fieldname].value == ""){
	  document.forms[formname].elements[fieldname].focus();
	  return false;
  }
return true;
}
function check_arama(){
  if(!kontrol("kelime","arama")){ alert("Lütfen bir arama kriteri giriniz!!"); return false};
  return true;
}

//iframe e url gönderme
function selectilce(param)
{
  document.ilce.location = "online/ilceler.php?il="+param;  
}

//Dropdown menu
function selectFile(rURL)
{
 if (rURL != "") {
       location = rURL;
       }
}

//Popups
function popup(url, width, height) {
window.open(url,"newpopup","width="+ width +",height="+ height +",resizable=no,status=no,scrollbars=yes")
}
function dialog(url,width, height) {
showModalDialog(url, window.dialogArguments, "dialogWidth: "+ width +"px; dialogHeight: "+ height +"px; help: 0; status: 0; resizable:0; center:1")
}
function popup1() {
window.open("","popup1","width=760,height=550,resizable=no,status=no,scrollbars=yes")
}

function popup2() {
window.open("","popup2","width=200,height=75,resizable=no,status=no,scrollbars=no")
}
//Editör İçin
function popup3(url) {
window.open(url,"popup3","width=600,height=450,resizable=no,status=no,scrollbars=no")
}
//Üye profili
function popup5() {
window.open("","popup5","width=450,height=350,resizable=no,status=no,scrollbars=yes")
}