if(navigator.appName.indexOf("Netscape") != -1) {
	var isMozilla = true;
}
else {
	var isMozilla = false;
}

if(navigator.appName.indexOf("Microsoft") != -1) {
	var isIE = true;
}
else {
	var isIE = false;
}

Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};

function trim(str) {
   if(str != null)
     return str.replace(/^\s*|\s*$/g,"");
}

function focusdovizmiktari2(value, textfield){
	var myinput = document.getElementById(textfield);

	if(myinput.value==value)
	{
		myinput.value="";
        myinput.style.color='#333333';
	}

}
function focusoutdovizmiktari2(value,textfield){
	var myinput = document.getElementById(textfield);

	if(myinput.value=="")
	{
		myinput.value=value;
        myinput.style.color='#999999';
	}

}

function replaceChars(entry,toBeReplaced,replaceChar) {
    out = toBeReplaced; // replace this
    add = replaceChar; // with this
    temp = "" + entry; // temporary holder

    while (temp.indexOf(out)>-1) {
        pos= temp.indexOf(out);
        temp = "" + (temp.substring(0, pos) + add + 
        temp.substring((pos + out.length), temp.length));
    }
    return temp;
}

function addCommas(number) {
	var x=number;

	x+="";

	iLen=x.length;

	pos=x.indexOf(".");

	if (pos>-1) {
		iLen=pos;
	}

	temp="";

	temp=x.substring(iLen,x.length);
	for (var i=iLen-1;i>=0;i--)
		if ((iLen-i-1)%3==0&&i!=iLen-1)
			temp=x.charAt(i)+","+temp;
		else
			temp=x.charAt(i)+temp;
	return temp;
}


function isInteger (s) {
  var i;

  if (isEmpty(s))
  if (isInteger.arguments.length == 1) return 0;
  else return (isInteger.arguments[1] == true);

  for (i = 0; i < s.length; i++) {
     var c = s.charAt(i);

     if (!isDigit(c)) return false;
  }

  return true;
}

function isEmpty(s) {
  return ((s == null) || (s.length == 0))
}

function isDigit (c) {
  return ((c >= "0") && (c <= "9"))
}

function mailikontrolet(){
var mailim = document.getElementById("mailkayit").value;
var email=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
var donen=email.test(mailim);
var hatavarmi="";
if (mailim==""){
alert ("Lütfen Mail Adresinizi Giriniz !");
document.getElementById("mailkayit").focus(); 
hatavarmi="ok";
return false;
}
else if (mailim.length<5)
{
alert ("Mail Adresinizin Bu olduğuna eminmisiniz !");
document.getElementById("mailkayit").focus();
hatavarmi="ok";
return false;
}
else if (donen==false)
{
alert ("Hatalı Mail Adresi Girdiniz !\nLütfen Doğru Mail Adresi Giriniz !");
document.getElementById("mailkayit").focus();
hatavarmi="ok";
return false;
}


if(hatavarmi=="") {
    http.open('get', 'mailkayit.php?mailkayitkontrol=ok&mailkayit='+mailim);
    http.onreadystatechange = mailFonksiyonu;
    http.send(null);
	}
}
function mailFonksiyonu() {
    if(http.readyState==4 || http.readyState=="complete"){
        document.getElementById('beykentdovizkurtablosu').innerHTML = http.responseText;
		var img = document.getElementById("serbestkuryukleniyor");
        img.style.display = "none";
    }
}
