function kulHata(d1)
{
  if (d1 != "")
  {
    alert("Kullanıcı adı ve/veya parola geçersiz!")
  }
}

function denetle() {
    var num = document.kform.elements.length
    var dogruMu = true
        for (var i=0; i<num; i++) {
            if ((document.kform.elements[i].value == null ||
                document.kform.elements[i].value == "") &&
               (typeof document.kform.elements[i] != 'submit' ||
                typeof document.kform.elements[i] != 'reset'))
 { 
                dogruMu = false 
                alert("Formdaki " + document.kform.elements[i].name +
                    " alani doldurulmamis bulunuyor. Lütfen doldurunuz!") 
                break } 
        }  
        return dogruMu 
    } 

function renkAyarla(satir, renk)
{
    if (renk == '' || typeof(satir.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = satir.getElementsByTagName('td');
    }
    else if (typeof(satir.cells) != 'undefined') {
        var theCells = satir.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = renk;
    }

    return true;
}

function penAc(sayfaAdi, gen, yuk)
{
  // top değerini bulmak için:
  // taskbar yüksekliği = 32
  // menubar yüksekliği = 16
  // toolbar yüksekliği = 32
  // bu değerler toplamını top değerini bulurken -(eksi) olarak yazarız
  // burada sadece taskbar yüksekliğini çıkarıyoruz
  sol = (screen.width - gen) / 2;
  ust = (screen.height - yuk) / 2 - 32;
  x = window.open(sayfaAdi, "_blank", "menubar=0,toolbar=0,resizeable=0,status=1,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function penAcMenulu(sayfaAdi, gen, yuk)
{
  // top değerini bulmak için:
  // taskbar yüksekliği = 32
  // menubar yüksekliği = 16
  // toolbar yüksekliği = 32
  // bu değerler toplamını top değerini bulurken -(eksi) olarak yazarız
  // burada taskbar + menubar + toolbar (32 + 16 + 32 = 80) yüksekliğini çıkarıyoruz
  sol = (screen.width - gen) / 2;
  ust = (screen.height - yuk) / 2 - 80;
  x = window.open(sayfaAdi, "_blank", "menubar=1,toolbar=1,resizeable=1,status=1,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function penAcEski(sayfaAdi, sol, ust, gen, yuk)
{
  x = window.open(sayfaAdi, "_blank", "toolbar=0,resizeable=0,status=0,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function takvimAc(sayfaAdi, sol, ust, gen, yuk)
{
  x = window.open(sayfaAdi, "_blank", "toolbar=0,resizeable=0,status=0,scrollbars=0,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function winAc(sayfaAdi, sol, ust, gen, yuk)
{
  x = window.open(sayfaAdi, "_blank", "menubar=1,toolbar=1,resizeable=1,status=1,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function winAcbb(sayfaAdi, sol, ust, gen, yuk)
{
  x = window.open(sayfaAdi, "bbb", "menubar=1,toolbar=1,resizeable=1,status=1,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  x.focus();
}

function bosPencere(formAdi, sol, ust, gen, yuk)
{ 
  window.open("","pencere", "toolbar=0,resizeable=0,status=0,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  var a = window.setTimeout("document.formAdi.submit();",500);
}

function bosMenuluPen(formAdi, sol, ust, gen, yuk)
{ 
  window.open("","menuluPen", "menubar=1,toolbar=1,resizeable=1,status=1,scrollbars=1,left="+sol+",top="+ust+",width="+gen+",height="+yuk);
  var a = window.setTimeout("document.formAdi.submit();",500);
}

function secDegeri(secNesnesi)
{
//  return secNesnesi.options[secNesnesi.selectedIndex].value
  penAc (secNesnesi.options[secNesnesi.selectedIndex].value, 50, 50, 900, 500);
}

function genBul()
{
  var winW = 630;
  if (parseInt(navigator.appVersion)>3)
  {
    if (navigator.appName=="Netscape")
    {
      winW = window.innerWidth;
    }

    if (navigator.appName.indexOf("Microsoft")!=-1)
    {
      winW = document.body.offsetWidth;
    }
  }

  return winW;
}

function Clickbutton(e, targetButton) 
{
    if (e.keyCode == 13) 
    {
        targetButton.click();
        return false;
    }
    
    return true;
}

