// Başarı' ya özel

var sKeysPressed = ""
function fKeyPress(){
	sKeysPressed += event.keyCode
}

function fAL(){
	//if(sKeysPressed == sKeys)
		window.open('_admin_login.php','adminlogin','width=100, height=165');
}

// ÜST MENU için ALTMENÜ açma/kapama
var objAktif

function fAltMenuOn(no){
  fAltMenuOff()
  id = "d_MenuUstAltMenu_"+no
  obj = fGetID(id)
  if(obj){
    obj.style.display = "block"    
    objAktif = obj
  }
}

function fAltMenuOff(){
  //obj = "d_MenuUstAltMenu_"+no
  if(objAktif){
    objAktif.style.display = "none"    
  }
}

// Anasayfadan Admin Sayfası açma
function fOpenAdminPage(key,sString){
  window.open('admin/index.php?b='+key+sString,'AdminPage','width=960,height=700,resizable=yes,scrollbars=yes')
}

////////////////////

// VARIABLES


// FUNCTIONS
function fGetID(ID){
    return document.getElementById(ID)
}

function Jump(sayfa,deger,obj){
    if(obj.options[obj.selectedIndex].value)
        eval("self.location='"+sayfa+"?"+deger+"="+obj.options[obj.selectedIndex].value+"'")
}

function FindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function ShowHide(oDiv,id){
  oDiv = id ? FindObj(oDiv) : oDiv
  durum = oDiv.style.display
  oDiv.style.display = (durum == "none" || !durum) ? "block" : "none"
  return false;
}

function fEnable(ID){
  fGetID(ID).disabled = false
  fGetID(ID).className = ""
}

function fDisable(ID){
  fGetID(ID).disabled = true
  fGetID(ID).className = "disabled"
}

function Dialog(sayfa,tablo,kolon,kriter,id,obj,width,height){
    sayfa = "edit/"+sayfa+".php?tablo="+tablo+"&kolon="+kolon+"&kriter="+kriter+"&id="+id
    params = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;scroll:no;status:no"
    return_value = showModalDialog(sayfa,obj,params);
    return false
}

function DialogSimple(sayfa,obj,width,height){
    params = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;scroll:no;status:no"
    return_value = showModalDialog("edit/"+sayfa+".php",obj,params);
    return false
}

function Focus(obj){
    prev_back = obj.parentNode.style.backgroundColor
    obj.parentNode.style.backgroundColor = "#FFCC00"
}

function Blur(obj){
    obj.parentNode.style.backgroundColor = prev_back
}

function fSil(sUpdTable,sUpdKriterValue,sUpdKriterColumn,obj){  
	if(confirm('Kaydı silmek istediğinizden emin misiniz?')){
    obj.removeNode(true)
    xajax_fxSil(sUpdTable,sUpdKriterValue,sUpdKriterColumn)    
  }
  else
    return false;
}

function fSilResim(sDir,sFileName,obj,onPath){
	var onPath = onPath
    if(confirm('Resmi silmek istediğinizden emin misiniz?')){
        edit_frame.location.href=onPath+'edit/resim_sil.php?sDir='+sDir+'&sFileName='+sFileName
        obj.removeNode(true)
    }
    else
        return false;
}

function FlashGoster(file,w,h){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+w+'" height="'+h+'">')
    document.write('<param name=movie value="'+file+'">')
    document.write('<param name=quality value=high>')
    document.write('<param name=wmode value=transparent>')
    document.write('<embed src="'+file+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" wmode="transparent">')
    document.write('</embed>')
    document.write('</object>')
}

function fFileSelect(obj){
  obj.style.backgroundColor='#00FF00'
}

function fMenuUstAltMenuAyar(){
  obj = fGetID('d_MenuUstAltMenu');
  obj.style.left = (document.body.scrollWidth-910)/2+"px"
  //obj.style.top = document.body.scrollTop+30+"px"
  obj.style.display = 'block'
}
