﻿function ElemanAl(isim)
{
    return document.getElementById(gDegBasi + isim);
}

function isNull(a) 
{
    return typeof a == 'object' && !a;
}

function SeciliRenkAyarla(obj)
{
    if (obj.readOnly == false)
    {
        obj.className = "AdaTextSecili";
        obj.select();
    }
    else
    {
        obj.className = "AdaTextSeciliKapali";
    }
}

function NormalRenkAyarla(obj)
{
    if (obj.readOnly == false)    
        obj.className = "AdaText";
    else
        obj.className = "AdaTextKapali";    
}

function GerekliKontrolu(obj)
{
}    

function PopupMesajGoster(baslik, icerik)
{
	$("#divPopupMesaj").dialog({ 
		draggable: true,
		resizable: false,
		modal: true,
		width: 700,
		title: baslik,
		beforeclose: function(event, ui){$('#divPopupMesaj').dialog('destroy');},
		buttons: { "Tamam": function() { $(this).dialog("destroy"); }} 
	});
	document.getElementById("divPopupMesaj").innerHTML = icerik;	
}




function beklemeyeAlGenel()
{
	beklemeyeAlGenelMesaj();
}

function beklemeyeAlGenelMesaj(mesaj)
{
	if (mesaj == null || mesaj == "")
		mesaj = "Lütfen bekleyin...";

    $('#divBeklemeGenel').dialog({ 
        closeOnEscape: false,
        draggable: false,
        resizable: false,
        modal: true,
        beforeclose: function(event, ui) { return false; },
        minHeight: 0,
        title: mesaj
    });
}

function beklemedenCikGenel()
{    
    $('#divBeklemeGenel').dialog('destroy');    
}

function onayla(msj, fonksiyonStr)
{
   document.getElementById("divConfirmation").innerHTML = msj;
   $("#divConfirmation").dialog({
		bgiframe: true,
		resizable: false,
		height:140,
		modal: true,
		beforeclose: function(event, ui) { $('#divConfirmation').dialog('destroy'); return false; },
		overlay: {
			backgroundColor: '#000',
			opacity: 0.5
		},
		title: "Onayla",
		buttons: {
			Tamam: function() {
			    eval(fonksiyonStr);
				$(this).dialog('destroy');
			},
			İptal: function() {
				$(this).dialog('destroy');
			}
		}
	});
}
