function git(url)
 {
  location.href = url;
 }
 
function SayiKontrol(e) 
 {
   olay = document.all ? window.event : e;
   tus = document.all ? olay.keyCode : olay.which;
   if(tus<48||tus>57) {
   if(document.all) { olay.returnValue = false; } else { olay.preventDefault(); }
    }
 }

function HarfKontrol(e) 
 {
   olay = document.all ? window.event : e;
   tus = document.all ? olay.keyCode : olay.which;
   if(tus>=48&&tus<=57) {
   if(document.all) { olay.returnValue = false; } else { olay.preventDefault(); }
   }
 }
function SelOn(ctrl)
 {
  ctrl.style.backgroundColor = '#F2F2F2';
 } 
 
function SelOff(er,ctrl)
 {
  ctrl.style.backgroundColor = er;
 } 

function rowstyleOn(ctrl)
 {
  ctrl.style.backgroundColor = '#DFF3FD';
  ctrl.style.borderColor = '#A0B3C2';
 }
function rowstyleOff(ctrl)
 {
  ctrl.style.backgroundColor = '';
  ctrl.style.borderColor = '#FFFFFF';
 } 
 
function SilmeOnay(url){
	input_box=confirm("Bu Kaydı Silmek İstediğimizden Emin misiniz?");
	if (input_box==true){ 
		git(url);
	}
}
function ajax(url,target)
 { url = url  + '&' + Math.random();
    // native XMLHttpRequest object
   document.getElementById(target).innerHTML = '&nbsp;';
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
       req.onreadystatechange = function() {ajaxDone(target);};
       req.open("GET", url, true);
       req.send(null);
   // IE/Windows ActiveX version
   } else if (window.ActiveXObject) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
       if (req) {
           req.onreadystatechange = function() {ajaxDone(target);};
           req.open("GET", url, true);
           req.send();
       }
   }
}function ajaxDone(target) {
   // only if req is "loaded"
   if (req.readyState == 4) {
       // only if "OK"
       if (req.status == 200 || req.status == 304) {
           results = req.responseText;
           document.getElementById(target).innerHTML = results;
       } else {
           document.getElementById(target).innerHTML="Hata:\n" +
               req.statusText;
       }
   }
}

  function getOffsetTop(elm) {

  var mOffsetTop = elm.offsetTop;
  var mOffsetParent = elm.offsetParent;

  while(mOffsetParent){
    mOffsetTop += mOffsetParent.offsetTop;
    mOffsetParent = mOffsetParent.offsetParent;
  }
 
  return mOffsetTop;
}

function getOffsetLeft(elm) {

  var mOffsetLeft = elm.offsetLeft;
  var mOffsetParent = elm.offsetParent;

  while(mOffsetParent){
    mOffsetLeft += mOffsetParent.offsetLeft;
    mOffsetParent = mOffsetParent.offsetParent;
  }
 
  return mOffsetLeft;
}
function softpopup(eleman, id)
{   
    var FRM = eleman;
    buttonElement = document.getElementById(id);
    document.getElementById(FRM).style.left = getOffsetLeft(buttonElement)+15;
    document.getElementById(FRM).style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight-10;
    document.getElementById(FRM).style.display="";
}
function softpopupclose(id)
{
    document.getElementById(id).style.display="none";
}