function ChkBlank(obj,message) {
	if (IsBlank(obj)) {		
		alert(message);
		obj.focus();
		obj.select();
		return false;
	}
	else
		return true;
}
// ------------------------------------------------------------------------------------
function IsBlank(obj) {
	objValue=obj.value;
	objValue=objValue.replace(/ /g,"")

	return (objValue=="") ? true : false;
}
// ------------------------------------------------------------------------------------
function isEmail (obj,message) {
	var objValue=obj.value;
	var i = 1;
	var objValueLength = objValue.length;
	while ((i < objValueLength) && (objValue.charAt(i) != "@")) { 
		i++
	}
	if ((i >= objValueLength) || (objValue.charAt(i) != "@")) {
		alert(message);
		obj.focus();
		obj.select();
		return false;
	}
	else i += 2;
		
	while ((i < objValueLength) && (objValue.charAt(i) != ".")) { 
		i++
	}
	if ((i >= objValueLength - 1) || (objValue.charAt(i) != ".")) {
		alert(message);
		obj.focus();
		obj.select();
		return false;
	}
	else {
		var checkOK = "ÇĞİÖŞÜçğıöşü ";
		var myStr = obj.value;
	
		var allValid = true;
		for (i = 0;  i < myStr.length;  i++) {
			ch = myStr.charAt(i);
		
			for (j = 0;  j < checkOK.length;  j++) {
				if (ch == checkOK.charAt(j)) {
					allValid = false;
				}
			}
		}
		
		if (!allValid) {
			alert("Hata!\nE-mail adresinizde Türkçe karakter kullanmayın ve boşluk bırakmayın!");
			obj.focus();
			obj.select();
			return false;
		}
		else {
			if (myStr.charAt(myStr.length-1)=="." || myStr.charAt(myStr.length-1)==",") {
				alert(message);
				obj.focus();
				obj.select();
				return false;
			}
			else
				return true;
		}
	}
}
// ------------------------------------------------------------------------------------
function setStatusBar(str) {
	window.status=str;
}
// ------------------------------------------------------------------------------------
function UyeMesajSilConfirm(mid) {
	if (confirm("Bu mesajı silmek istediğinize emin misiniz?"))
		document.location.href="mesajsil.asp?mid=" + mid
}
// ------------------------------------------------------------------------------------
function chkSameValue(obj1,obj2,message) {
	obj1Value=obj1.value;	
	obj1Value=obj1Value.replace(/ /g,"");
	obj2Value=obj2.value;	
	obj2Value=obj2Value.replace(/ /g,"");

	if (obj1Value!=obj2Value) {
		alert(message);
		obj2.focus();
		obj2.select();
		return false;
	}
	else
		return true;
}
// ------------------------------------------------------------------------------------
function chkLength(obj,message,thelength) {
	var objValueLength=obj.value.length;
	if (objValueLength<thelength) {
		alert(message);
		obj.focus();
		obj.select();
		return false;
	}
	else
		return true;		
}
// ------------------------------------------------------------------------------------
function popup(url, name, w, h){
	eval(window.open(url,name,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + w + ",height=" + h + ",screenX=50,screenY=50,top=250,left=250"));
}
// ------------------------------------------------------------------------------------
function chkNumeric(objName,mesaj) {
	var checkOK = "0123456789";
	var checkStr = objName;
	var allValid = true;

	for (i = 0;  i < checkStr.value.length;  i++) {
		ch = checkStr.value.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j == checkOK.length) {
			allValid = false;
			break;
		}
	}
	if (!allValid) {
		alert(mesaj);
		
		objName.select();
		objName.focus();
		return (false);
	}
	else
		return true;
}
// ------------------------------------------------------------------------------------