  function ismaxlength(obj){
    var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
    if (obj.getAttribute && obj.value.length>mlength)
    obj.value=obj.value.substring(0,mlength)
  }

  function mOvr(src,renk1,renk2,img) {
    if (!src.contains(event.fromElement)) {
       if (renk1 != ''){ src.bgColor = renk1; src.background = ''; }
       if (renk2 != ''){ src.style.color = renk2; }
       if (img != ''){ src.background = img; }
       src.style.cursor = 'pointer';
    }
  }
  function mOut(src,renk1,renk2,img) {
    if (!src.contains(event.toElement)) {
       if (renk1 != ''){ src.bgColor = renk1; src.background = ''; }
       if (renk2 != ''){ src.style.color = renk2; }
       if (img != ''){ src.background = img; }
       src.style.cursor = 'default';
    }
  }
  function mOvrYazi(src,renk) {
    if (renk != ''){ src.style.color = renk; }
    src.style.cursor = 'pointer';
  }
  function mOutYazi(src,renk) {
    if (renk != ''){ src.style.color = renk; }
    src.style.cursor = 'default';
  }
  function changeURL(gelenURL) {
    window.location.href = gelenURL;
  }
  function TitleDegistir(gelen){
    document.title = gelen;
  }
function submitLogout() {
  var onay = confirm("Yönetim panelinden çıkılacak!.."+'\n'+"İşlemi onaylıyor musunuz?")
  if (onay == true){
     return true
  }  else{
     return false
  }
}
function submitDel() {
  var onay = confirm("Seçili kayıt silinecek!.."+'\n'+"İşlemi onaylıyor musunuz?")
  if (onay == true){
     return true
  }  else{
     return false
  }
}

function getObj(id) {
    var ie = false;
    if (document.all) { ie = true; }
    if (ie) {
       return document.all[id];
    }  else {
       return document.getElementById(id);
    }
}
function ResimSecMod(gID,gMod){
    var gSTR = showModalDialog("./popresimsec.php?mod="+gMod, "Resim Seçimi", "resizable: no; help: no; status: no; scroll: yes; ");
    if ((gSTR != null) && (gSTR != "") && (gSTR != "ESC")) {
       gAdi = gSTR;
       if (gAdi.substring(0, 3)=='../') { gAdi = gAdi.substring(1, gAdi.length); }
       var picker = getObj(gID);
       picker.value=gAdi;
    }
}

function ResimSec(gID){
    var gSTR = showModalDialog("./popresimsec.php", "Resim Seçimi", "resizable: no; help: no; status: no; scroll: yes; ");
    if ((gSTR != null) && (gSTR != "") && (gSTR != "ESC")) {
       gAdi = gSTR;
       if (gAdi.substring(0, 3)=='../') { gAdi = gAdi.substring(1, gAdi.length); }
       var picker = getObj(gID);
       picker.value=gAdi;
    }
}
function ResimFlashSec(gID){
    var gSTR = showModalDialog("./popresimsec.php?swf=swfOn", "Resim Seçimi", "resizable: no; help: no; status: no; scroll: yes; ");
    if ((gSTR != null) && (gSTR != "") && (gSTR != "ESC")) {
       gAdi = gSTR;
       if (gAdi.substring(0, 3)=='../') { gAdi = gAdi.substring(1, gAdi.length); }
       var picker = getObj(gID);
       picker.value=gAdi;
    }
}
function ResimSecReklam(gID){
    var gSTR = showModalDialog("./popresimsecreklam.php?swf=swfOn", "Resim Seçimi", "resizable: no; help: no; status: no; scroll: yes; ");
    if ((gSTR != null) && (gSTR != "") && (gSTR != "ESC")) {
       gAdi = gSTR;
       if (gAdi.substring(0, 3)=='../') { gAdi = gAdi.substring(1, gAdi.length); }
       var picker = getObj(gID);
       picker.value=gAdi;
    }
}
function ResimSecBestOf(gID){
    var gSTR = showModalDialog("./popresimsecbestof.php?swf=swfOn", "Resim Seçimi", "resizable: no; help: no; status: no; scroll: yes; ");
    if ((gSTR != null) && (gSTR != "") && (gSTR != "ESC")) {
       gAdi = gSTR;
       if (gAdi.substring(0, 3)=='../') { gAdi = gAdi.substring(1, gAdi.length); }
       var picker = getObj(gID);
       picker.value=gAdi;
    }
}
function ResimDegistir(id,resimAdi){
    var sp = getObj(id);
    sp.innerHTML = resimAdi;
}
function BaslikDegistir(id,baslik){
  if(getObj(id)){
     var sp = getObj(id);
     if(baslik=="kapat"){
        sp.style.display="none";
     }else{
        sp.innerHTML = baslik;
     }
  }
}

function popNew(url,ww,hh){
  var yenipencere = null;
  yenipencere=window.open('','yenipencere','width=' + ww + ',height=' + hh + ',status=no,toolbar=no,menubar=no,directories=no, location=no,scrollbars=no,resizable=no,alwaysRaised=yes,screenX=1,screenY=1,titlebar=yes,z-lock=yes,left=10,top=10');
  yenipencere.location.href=url;
  if (yenipencere != null) {
     if (yenipencere.opener == null){
        yenipencere.opener = self;
     }
     yenipencere.location.href=url;
     yenipencere.focus();
  }
}


  function trtemizle(str){
     var trler=new Array("ç","ğ","ı","ö","ş","ü","\\(","\\)"," ");
     var engler=new Array("c","g","i","o","s","u","","","-");
     str = str.toLowerCase();
     var xxx="[" + engler[2] + "][" + engler[3] + "]";
     for(i=0;i<9;i++){
        str = str.replace(new RegExp(trler[i], "gi" ),engler[i]);
     }
     return(str);
  }

