// calculate the ASCII code of the given character
function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function sayiKontrol(val){
  var val=document.getElementById(val);	
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);
  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */
  var rakamlar = new Array(0,1,2,3,4,5,6,7,8,9,',','.');
  if(rakamlar.toString().indexOf(lchar) ==-1){
	var myNumber = val.value.substring(0, (strLength) - 1);
	alert("Sadece rakam giriniz!");
	val.value = myNumber;
  }
  return false;
}

//// Doğrulama fonksiyonu
function dogrulama(sayfaUrl){
  if (confirm("Silmek İstediğinizden eminmisiniz?")) {
    document.location = sayfaUrl;
  }
}

//// Sayfa çıktısı doğrulama
function CiktiUyari(){
	if(confirm ("Çikti Almak Istiyormusunuz ?"))
	{
	window.print();
	window.close(self);
	}
return;
}


function PencereAc(url, name, w, h){
// Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url, name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=no');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}


////// Ajax işlemleri için  XMLHttpRequest nesnesi oluşturuluyor

function XMLHTTP_Olustur(){

	if(window.XMLHttpRequest)
	{
	// Code for IE7+, Firefox,Chrome... 	
		return new XMLHttpRequest();	
	}
	
	if(window.ActiveXObject)
	{
	// code for IE6, IE5	
	return new ActiveXObject("Microsoft.XMLHTTP");			
	}

}

/////// Formda Seçili Alan //////////////////////////////////

function etkili(alan){	
	document.getElementById(alan).className="secili";
}

function etkisiz(alan){	
	document.getElementById(alan).className="";
}
