
var Tree_Menu =
{
    Menu_Konumu  : "", // Scriptin ana konumu.
    Image_Acik   : null,   // Menü açıkken görünen imaj.
    Image_Kapali : null, // Menü kapalıyken görünen imaj.
    Image_Eki    : "_Imaj", // Menü adının sonuna eklenerek <img> tagının bulunmasında kullanılır.

    Create: function(Acik_Imaj, Kapali_Imaj)
    {
        this.Image_Acik = Acik_Imaj;
        this.Image_Kapali = Kapali_Imaj;
    },

    Refresh: function(Id)
    {
        var Obj = Get_Obj(Id);

        if (Obj)
        {
            if(Obj.style.display == "block") // Menü açık ise kapat.
                this.Hide(Obj, Id);
            else // Menü kapalı olduğundan göster.
                this.Show(Obj, Id);
        }
    },

    Show: function(Obj, Id)
    {
        Obj.style.display = "block";
        // document.images[Id + this.Image_Eki].src = this.Menu_Konumu + this.Image_Acik;

        Img = Get_Obj(Id + this.Image_Eki);

        if (Img)
            Img.src = this.Menu_Konumu + this.Image_Acik;

    },

    Hide: function(Obj, Id)
    {
        Obj.style.display = "none";
        // document.images[Id + this.Image_Eki].src = this.Menu_Konumu + this.Image_Kapali;

        Img = Get_Obj(Id + this.Image_Eki);

        if (Img)
            Img.src = this.Menu_Konumu + this.Image_Kapali;
    }
}

var Menu_HTML = // Açılır menü html kodu oluşturur.
{
    Row_Height          : "23px", // Varsayılan <TABLE>.<TR> yüksekliği.
    Ikon_Width          : "18px", // Başlığın önünde gösterilecek imajın <TABLE>.<TR>.<TD> uzunluğu.
    Alt_Menu_Ikon_Width : "20px", // Alt menü imajının <TABLE>.<TR>.<TD> uzunluğu.
    Index               : 9999,   // Katmanların z-index değeri. Her katmanda bu değişken artırılır.
    Alt_Menu_Imaji      : null,

    Menuler: new Array(),

    Create: function(Menu_Imaji)
    {
        this.Alt_Menu_Imaji = Menu_Imaji;
    },
    
    Menu_Count: function()
    {
        return (this.Menuler.length);
    },

    Items_Count: function(Menu_Poz)
    {
        return (this.Menuler[Menu_Poz].Items.length);
    },

    TMenu: function() // TMenu sınıfı
    {
        Menu =
        {
            Parent_Id          : null,        // Menünün açılması sırasında bu tagın left ve top pozisyonları dinamik olarak kullanılır.
            Menu_Id            : null,        // Menü için kullanılacak isim.
            Width              : 0,           // Menü uzunluğu.
            Items              : new Array(), // Menü başlıkları.
            Serit_Rengi        : null,        // Seçili itemin rengi.
            Imaj_Sutunu_Kullan : false,       // Başlığın önündeki imaj sütunu.
            Menu_Rengi         : null,        // Menünün arkaplan rengi.
            Menu_Kenar_Rengi   : null,        // Menü çerçevesinin kenar rengi.
            Golge_Uzunluğu     : "0px",       // Sağ ve alt kenarın kalınlığı.
            Golge_Rengi        : null         // Sağ ve alt kenarın rengi.
        }

        return Menu;
    },

    TMenuItem: function() // TMenuItem sınıfı
    {
        TMItem =
        {
            Item_Id       : null, // Item id`si ve adı.
            Baslik        : null, // Text başlık.
            Ikon          : null, // Başlığın önünde gösterilecek imaj.
            Alt_Menu_Id   : null, // Alt menu id`si.
            Link          : null, // OnClick olayında açılacak sayfa url`si
            Form_Link     : null  // OnClick olayında çağrılacak fonksiyon.
        }

        return TMItem;
    },

    Menu_Ekle: function(_Parent_Id, _Menu_Id, _Width, _Serit_Rengi, _Imaj_Sutunu_Kullan, _Menu_Rengi, _Menu_Kenar_Rengi, _Golge_Uzunluğu, _Golge_Rengi)
    {
        var Cnt = this.Menu_Count();
        this.Menuler[Cnt] = new this.TMenu();

        with (this.Menuler[Cnt])
        {
            Parent_Id          = _Parent_Id;          // Menünün açılması sırasında bu tagın left ve top pozisyonları dinamik olarak kullanılır.
            Menu_Id            = _Menu_Id;            // Menü için kullanılacak isim.
            Width              = _Width;              // Menü uzunluğu.
            Items              = new Array();         // Menü başlıkları.
            Serit_Rengi        = _Serit_Rengi;        // Seçili itemin rengi.
            Imaj_Sutunu_Kullan = _Imaj_Sutunu_Kullan; // Başlığın önündeki imaj sütunu.
            Menu_Rengi         = _Menu_Rengi;         // Menünün arkaplan rengi.
            Menu_Kenar_Rengi   = _Menu_Kenar_Rengi;   // Menü çerçevesinin kenar rengi.
            Golge_Uzunluğu     = _Golge_Uzunluğu;     // Sağ ve alt kenarın kalınlığı.
            Golge_Rengi        = _Golge_Rengi;        // Sağ ve alt kenarın rengi.
        }
    },

    Item_Ekle: function(_Menu_Id, _Baslik, _Ikon_Src, _Alt_Menu_Id, _Link, _Form_Link)
    {
        function Menu_Bul()
        {
            for (i = 0; i < Menu_HTML.Menu_Count(); i++)
                if (Menu_HTML.Menuler[i].Menu_Id == _Menu_Id)
                    return (i);

            return (-1);
        }

        /* --- Item_Ekle --- */

        var Menu_Poz = Menu_Bul();

        if (Menu_Poz > -1)
        {
            var Item_Poz = this.Items_Count(Menu_Poz);
            this.Menuler[Menu_Poz].Items[Item_Poz] = new this.TMenuItem();

            with (this.Menuler[Menu_Poz].Items[Item_Poz])
            {
                Item_Id     = '__Istanbul_Yazilim_Menu_Item_' + Item_Poz.toString();  // Item id.
                Baslik      = _Baslik;      // Text başlık.
                Alt_Menu_Id = _Alt_Menu_Id; // Alt menu id`si.
                Link        = _Link;        // OnClick olayında açılacak sayfa url`si
                Form_Link   = _Form_Link;   // OnClick olayında çalışacak form gönderme fonksiyonu.

                if (_Ikon_Src != null)
                {
                    Ikon     = new Image()
                    Ikon.src = _Ikon_Src;    // Başlığın önünde gösterilecek imaj.
                }
            }
        }
    },

    ToHTML: function()
    {
        var S;
//                'Get_Obj(\'' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '\').style.backgroundColor=\'red\';' +

        function Ekle_Anablok(Menu_Poz)
        {
            // Tüm parçaları kapsayan menü penceresi oluşturuluyor.

            Menu_HTML.Index++; // Katmanın z-index değeri.

            S = '<div id="' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '"' +
                'style="width:' + Menu_HTML.Menuler[Menu_Poz].Width.toString() + 'px;' +
                'z-index:' + Menu_HTML.Index.toString() +  ';' +
                'background-color:' + Menu_HTML.Menuler[Menu_Poz].Menu_Rengi + ';' +
                'border:1px solid ' + Menu_HTML.Menuler[Menu_Poz].Menu_Kenar_Rengi + ';';

                if (parseInt(Menu_HTML.Menuler[Menu_Poz].Golge_Uzunluğu) > 0) // Gölge var ise
                {
                    S += 'border-right:' + Menu_HTML.Menuler[Menu_Poz].Golge_Uzunluğu + ' solid ' + Menu_HTML.Menuler[Menu_Poz].Golge_Rengi + ';' +
                         'border-bottom:' + Menu_HTML.Menuler[Menu_Poz].Golge_Uzunluğu + ' solid ' + Menu_HTML.Menuler[Menu_Poz].Golge_Rengi + ';';
                }

                S += '"' + 'class="Menu_Popup" onmouseout="iMenu.Menu_Gizle(null);">' + CRLF;
        }

        function Ekle_Item(Menu_Poz, Item_Poz, Alt_Menu_Imaji)
        {
            S += '<tr style="height:' + Menu_HTML.Row_Height + '" valign="middle"' +
                 'onmouseover="iMenu.Mouse_Over(this, \'' + Menu_HTML.Menuler[Menu_Poz].Serit_Rengi + '\');';

            if (Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Alt_Menu_Id != null)
                S += //'alert(Obj_Left(\'' + Menu_HTML.Menuler[Menu_Poz].Parent_Id + '\'));alert(Obj_Width(\'' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '\'));' +
                     'iMenu.Alt_Menu_Goster(Get_Obj(\'' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '\'),' +
                     Item_Poz.toString() + ',' +
                     'Get_Obj(\'' + Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Alt_Menu_Id + '\'))"' + CRLF;
            else
                S += 'iMenu.Alt_Menu_Yok_Goster(Get_Obj(\'' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '\'))"' + CRLF;

            S += 'onmouseout="' +
                 'iMenu.Mouse_Out(this, \'' + Menu_HTML.Menuler[Menu_Poz].Menu_Rengi + '\');' +
                 'iMenu.Menu_Gizle(Get_Obj(\'' + Menu_HTML.Menuler[Menu_Poz].Menu_Id + '\'))">' + CRLF;


            // Sol imaj sütunu.
            if (Menu_HTML.Menuler[Menu_Poz].Imaj_Sutunu_Kullan == true)
            {
                // Alternatif background-color renkleri: #D4D0C8, #D8E4FA, #D9F4ED, #E9E9E9, #DDEEFF
                S += '<td style="width:' + Menu_HTML.Ikon_Width + ';background-color:#E9E9E9" align="center" valign="middle">' + CRLF;

                // Soldaki imaj
                if (Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Ikon != null)
                    S += '<img src="' + Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Ikon.src + '" />' + CRLF;
                    // S += '<img src="' + Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Ikon.src + '" width="16" height="16" />' + CRLF;
                else
                    S += '&nbsp;'

                S += '</td>' + CRLF;
            }

            // Menü başlığı.
            if (Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Link != null && Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Link != "")
                S += '<td>&nbsp;<a href="index.php" style="text-decoration:none;color:black;">' +
                     Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Baslik + '</a>' + CRLF + '</td>' + CRLF;
            else
            if (Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Form_Link != null && Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Form_Link != "")
                S += '<td onmouseover="this.style.cursor = iMenu.Cursor" onclick="' + Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Form_Link + '">&nbsp;' +
                     '<span onmouseover="this.style.textDecoration = iMenu.Text_Decoration" onmouseout="this.style.textDecoration = \'none\'">' +
                     Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Baslik + '</span>' + CRLF + '</td>' + CRLF;
            else
                S += '<td>&nbsp;' + Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Baslik + CRLF + '</td>' + CRLF;

            // Alt menü olduğunu gösteren ikon sütunu.
            S += '<td style="width:' + Menu_HTML.Alt_Menu_Ikon_Width + '" align="center" valign="middle">';

            // Alt menü ikonu.
            if (Menu_HTML.Menuler[Menu_Poz].Items[Item_Poz].Alt_Menu_Id != null)
                S += '<img src="' + Alt_Menu_Imaji + '" />';
                // S += '>';
            else
                S += '&nbsp;';

            S += '</td>' + CRLF + '</tr>';
        }

        function Ekle_Items(Menu_Poz, Alt_Menu_Imaji)
        {
            S += '<table style="border-collapse:collapse;border-color:none" border="0" cellpadding="0" cellspacing="0" width="100%">' + CRLF;

            for (j = 0; j < Menu_HTML.Items_Count(Menu_Poz); j++)
                Ekle_Item(Menu_Poz, j, Alt_Menu_Imaji);

            S += '</table>' + CRLF + '</div>';
        }

        function Dokumana_Ekle()
        {
            document.write(S);
        }

        /* --- ToHTML --- */

        for (i = 0; i < this.Menu_Count(); i++)
            if (this.Items_Count(i) < 1)
                continue;
            else
            {
              Ekle_Anablok(i);
              Ekle_Items(i, this.Alt_Menu_Imaji);
              Dokumana_Ekle();
            }
    }
}

var iMenu =  // Açılır menü 
{
    Acik_Menuler          : new Array(), // Açılmış olan tüm menüler.
    Gizlenen_Menu         : null, // Bu menüden sonrakiler kapatılır.
    Gosterilen_Menu       : {Parent_Menu:null, Parent_Index:null, Menu:null, x:null, y:null}, // Gösterilecek olan menü.
    Alt_Menu_Yok_Parent   : null, // Alt menüsü olmayan itemin parenti.
    Timer_Kapat_Handle    : null, // Menü kapatma sayıcısının tutamacı.
    Timer_Ac_Handle       : null, // Menü açma sayıcısının tutamacı.
    Timer_Ac_Slayt_Handle : null, // Animasyonlu menü açma sayıcısının tutamacı.
    Timer_Baslama_Suresi  : 75,  // MS türünden menü açmayı başlatma süresi.
    Timer_Kapatma_Suresi  : 400,  // MS türünden menü kapamayı başlatma süresi.
    Katmanlar             : new Array(), // Tüm menülerin kaydı.
    Row_Height            : parseInt(Menu_HTML.Row_Height), // 25,   // Varsayılan <TABLE>.<TR> yüksekliği.
    Menu_Rengi            : "white", // "yellow", // "#DDEEFF",
    Menu_Serit_Rengi      : "khaki", // "#DDEEFF",
    Mouse_Over_Color      : "#000000",
    Mouse_Out_Color       : "#000000",
    Text_Decoration       : "none", // "underline",
    Cursor                : "pointer", // "default"

    /*
     * @Seffaflik         : 0,   // Sayıcı içinde kullanılır. Her artımında nesne biraz daha belirginleşir.
     * @AZAMI_SEFFAFLIK   : 100, // Seffaflik değişkeninin alabileceği azami değer.
     * @SLAYT_ADIMI       : 5,   // Seffaflik değişkeninin her seferinde artacağı miktar.
     * @SLAYT_ARALIGI     : 1,   // Animasyon sayıcısının çağrılma aralığı.
    */
    Slayt : {Seffaflik: 0, AZAMI_SEFFAFLIK: 100, SLAYT_ADIMI: 5, SLAYT_ARALIGI: 5},

    Katman_Ekle: function(Katman_Obj)
    {
        this.Katmanlar[this.Katmanlar.length] = Katman_Obj;
    },

    Mouse_Over_TD: function(TD1, TD2, TD3)
    {
        // TD1, TD2, TD3 ile bildirilen menü itemin "table.td" sitilini değiştirir.

        var T1 = Get_Obj(TD1);
        var T2 = Get_Obj(TD2);
        var T3 = Get_Obj(TD3);

        T1.style.backgroundColor = 'yellow';
        T1.style.border          = 'solid';
        T1.style.borderWidth     = '1px';
        T1.style.borderColor     = 'red';

        T2.style.backgroundColor = 'yellow';
        T2.style.border          = 'solid';
        T2.style.borderWidth     = '1px';
        T2.style.borderColor     = 'red';

        T3.style.backgroundColor = 'yellow';
        T3.style.border          = 'solid';
        T3.style.borderWidth     = '1px';
        T3.style.borderColor     = 'red';
    },

    Mouse_Out_TD: function(TD1, TD2, TD3)
    {
        // TD1, TD2, TD3 ile bildirilen menü itemin "table.td" sitilini değiştirir.

        var T1 = Get_Obj(TD1);
        var T2 = Get_Obj(TD2);
        var T3 = Get_Obj(TD3);

        T1.style.backgroundColor = "#D4D0C8";
        T1.style.border          = "solid";
        T1.style.borderWidth     = "1px";
        T1.style.borderColor     = "#D4D0C8";

        T2.style.backgroundColor = "#FFFFFF";
        T2.style.border          = "solid";
        T2.style.borderWidth     = "1px";
        T2.style.borderColor     = "#FFFFFF";

        T3.style.backgroundColor = "#FFFFFF";
        T3.style.border          = "solid";
        T3.style.borderWidth     = "1px";
        T3.style.borderColor     = "#FFFFFF";
    },

    Mouse_Over: function(Item, Item_BackgroundColor)
    {
        // Item ile bildirilen menü itemin sitilini değiştirir.

        Item.style.backgroundColor = Item_BackgroundColor;
        Item.style.color = this.Mouse_Over_Color;

        /*
        Item.style.border          = "solid";
        Item.style.borderWidth     = "1px";
        Item.style.borderColor     = "red";
        */
    },

    Mouse_Out: function(Item, Item_BackgroundColor, Item_Color)
    {
        // Item ile bildirilen menü itemin sitilini değiştirir.
        Item.style.backgroundColor = Item_BackgroundColor;
        Item.style.color = this.Mouse_Out_Color;

        /*
        Item.style.border          = "none";
        Item.style.borderWidth     = "1px";
        Item.style.borderColor     = "#FFFFFF";
        */
    },

    Seffaf_Yap: function (Obj, Opacity)
    {
        return; // Transparent özelliği şimdilik iptal edildi. Kullanılmak istenirse buradan açılabilir.

        // Obj nesnesinin görünümünü Opacity`deki gibi yapar.

        if (Obj != null)
        {
            Obj = Obj.style;

            if (Obj.opacity != null)
                Obj.opacity = (Opacity / 100);

            if (Obj.MozOpacity != null)
                Obj.MozOpacity = (Opacity / 100);

            if (Obj.KhtmlOpacity != null)
                Obj.KhtmlOpacity = (Opacity / 100);

            /*  IE`de yazı inceldiğinden bu işlem iptal edildi.
            if (Obj.filter != null)
                Obj.filter = "alpha(opacity=" + Opacity.toString() + ")";
                // Obj.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + Opacity.toString() + ")";
            */
        }
    },

    Stop_Timer_Kapat: function()
    {
        // Timer_Kapat_Handle sayıcısını durdurur.
        clearTimeout(this.Timer_Kapat_Handle);
        this.Timer_Kapat_Handle = null;
    },

    Stop_Timer_Ac: function()
    {
        // Timer_Ac_Handle ve Timer_Ac_Slayt_Handle sayıcılarını durdurur.
        clearTimeout(this.Timer_Ac_Handle);
        this.Timer_Ac_Handle = null;
        this.Stop_Timer_Ac_Slayt();
    },

    Stop_Timer_Ac_Slayt: function()
    {
        // Timer_Ac_Slayt_Handle sayıcısını durdurur.
        clearTimeout(this.Timer_Ac_Slayt_Handle);
        this.Timer_Ac_Slayt_Handle = null;
    },

    Seffaflik_Full: function()
    {
        // Slayt sayıcı çalışıyorsa durdur ve slayt uygulanan katmanı tamamen göster.
        if (this.Timer_Ac_Slayt_Handle != null)
        {
            this.Stop_Timer_Ac_Slayt();
            this.Seffaf_Yap(this.Gosterilen_Menu.Menu, this.Slayt.AZAMI_SEFFAFLIK);
            this.Slayt.Seffaflik = 0;
        }
    },

    Menu_Ara: function(Menu)
    {
        // Menu menüsünü Acik_Menuler dizinde arar. Bulunamaz ise -1 döner.
        for (i = 0; i < this.Acik_Menuler.length; i++)
            if (this.Acik_Menuler[i] == Menu)
                return (i);

        return (-1);
    },

    Menuleri_Kapat: function(Menu_Poz)
    {
        // Menu_Poz`dan itibaren açık olan tüm menüleri kapatır.

        if (this.Acik_Menuler.length < 1) // Menü boş ise
            return;

        // Kapatılmayacak olan menüleri sakla.
        Temp_Acik_Menuler = new Array(Menu_Poz);
        for (i = 0; i < Menu_Poz; i++)
            Temp_Acik_Menuler[i] = this.Acik_Menuler[i];

        // Kapatılacak olan menüleri gizle.
        for (;Menu_Poz < this.Acik_Menuler.length; Menu_Poz++)
        {
            this.Acik_Menuler[Menu_Poz].style.display = "none";
        }

        // Yeni listeyi oluştur.
        this.Acik_Menuler = new Array(Temp_Acik_Menuler.length);
        for (i = 0; i < Temp_Acik_Menuler.length; i++)
            this.Acik_Menuler[i] = Temp_Acik_Menuler[i];
    },

    Tum_Menuleri_Kapat: function()
    {
        // Kayıtlı tüm menüleri kapatır.

        this.Stop_Timer_Kapat();
        this.Stop_Timer_Ac();


        if (this.Katmanlar.length < 1 && this.Acik_Menuler.length > 0)
        {
            for (i = 0; i < this.Acik_Menuler.length; i++)
                this.Acik_Menuler[i].style.display = "none";

            this.Acik_Menuler = new Array();
        }

        for (i = 0; i < this.Katmanlar.length; i++)
            this.Katmanlar[i].style.display = "none";
    },

    Callback_Alt_Menu_Yok: function()
    {
        // Alt menüsü olmayan bir item üzerinde olduğumuzdan sonraki açık menüleri kapat.

        var i;

        i= this.Menu_Ara(this.Alt_Menu_Yok_Parent);

        // Parent_Menu`den sonrakileri kapat.
        if (i > -1)
            this.Menuleri_Kapat(i + 1);
    },

    Alt_Menu_Yok_Goster: function(Parent_Menu)
    {
        // Parent_Menu`den sonraki açık menüleri kapatır.
        this.Seffaflik_Full();
        this.Stop_Timer_Kapat();
        this.Stop_Timer_Ac();
        this.Alt_Menu_Yok_Parent = Parent_Menu;
        this.Timer_Ac_Handle = setTimeout("Alt_Menu_Yok_Goster()", this.Timer_Baslama_Suresi);
        return true;
    },

    Menu_Goster_Slayt: function()
    {
        // Gosterilen_Menu.Menu nesnesinin görünümünü ayarlar.

        this.Slayt.Seffaflik += this.Slayt.SLAYT_ADIMI;

        if (this.Slayt.Seffaflik < this.Slayt.AZAMI_SEFFAFLIK)
        {
            this.Seffaf_Yap(this.Gosterilen_Menu.Menu, this.Slayt.Seffaflik);
            this.Timer_Ac_Slayt_Handle = setTimeout("Menu_Goster_Slayt()", this.Slayt.SLAYT_ARALIGI);
        }
        else
        {
            this.Seffaf_Yap(this.Gosterilen_Menu.Menu, this.Slayt.AZAMI_SEFFAFLIK);
            this.Stop_Timer_Ac_Slayt();
            this.Slayt.Seffaflik = 0;
        }
    },

    Callback_Menu_Goster: function()
    {
        // Menu ile bildirilen menüyü gösterir.

        var i;

        // Üzerinde bulunduğumuz menünün görünümü her ihtimale karşı full boyanıyor.
        if (this.Gosterilen_Menu.Parent_Menu != null)
            this.Seffaf_Yap(this.Gosterilen_Menu.Parent_Menu, this.Slayt.AZAMI_SEFFAFLIK);

        // Açılacak olan menü zaten açıksa sonrakileri kapat ve çık. Çünkü önceki parent menü üzerine gidilmiş.
        i= this.Menu_Ara(this.Gosterilen_Menu.Menu);
        if (i > -1)
        {
            this.Menuleri_Kapat(i + 1);
            return true;
        }


        // Parent_Menu`den sonrakileri kapat.
        if (this.Gosterilen_Menu.Parent_Menu == null)
            this.Tum_Menuleri_Kapat();
        else
        {
            i= this.Menu_Ara(this.Gosterilen_Menu.Parent_Menu);
            if (i > -1)
                this.Menuleri_Kapat(i + 1);
        }


        // Menüyü göster.
        if (this.Gosterilen_Menu.Menu != null)
        {
            var L = 0;
            var T = 0;

            // Açılacak olan menünün left ve top noktasını ayarla.
            if (this.Acik_Menuler.length > 0)
            {
                // Left noktası.
                L = parseInt(this.Acik_Menuler[0].style.left);
                for (i = 0; i < this.Acik_Menuler.length; i++)
                    L += parseInt(this.Acik_Menuler[i].style.width) - 4;

                // Top noktası.
                T = parseInt(this.Gosterilen_Menu.Parent_Menu.style.top) +
                    (this.Gosterilen_Menu.Parent_Index * this.Row_Height);
            }
            else
            {
                L = this.Gosterilen_Menu.x;
                T = this.Gosterilen_Menu.y;
            }

            // Açılacak olan menüyü, açık menüler listesine ekle.
            this.Acik_Menuler[this.Acik_Menuler.length] = this.Gosterilen_Menu.Menu;

            this.Gosterilen_Menu.Menu.style.left = L.toString() + "px";
            this.Gosterilen_Menu.Menu.style.top  = T.toString() + "px";

            this.Seffaf_Yap(this.Gosterilen_Menu.Menu, 0)

            this.Gosterilen_Menu.Menu.style.display = "block";

            if (this.Gosterilen_Menu.Parent_Menu == null)
                this.Time_Aktif_Object = setTimeout("Menu_Goster_Slayt()", 1);
            else
                this.Time_Aktif_Object = setTimeout("Menu_Goster_Slayt()", this.Slayt.SLAYT_ARALIGI);
        }

        return true;
    },

    Menu_Goster: function(Parent_Menu, Parent_Index, Menu, x, y)
    {
        // Menu ile bildirilen menüyü (x, y) koordinatlarında gösterir.
        this.Seffaflik_Full();
        this.Stop_Timer_Kapat();
        this.Stop_Timer_Ac();
        this.Gosterilen_Menu.Parent_Menu  = Parent_Menu;
        this.Gosterilen_Menu.Parent_Index = Parent_Index;
        this.Gosterilen_Menu.Menu         = Menu;
        this.Gosterilen_Menu.x            = x;
        this.Gosterilen_Menu.y            = y;

        if (Parent_Menu == null) // Menü ilk kez açılıyor ise (Başlık üzerine gelerek açılıyor ise)
            this.Callback_Menu_Goster();
        else
            this.Timer_Ac_Handle = setTimeout("Menu_Goster()", this.Timer_Baslama_Suresi);

        return true;
    },

    Alt_Menu_Goster: function(Parent_Menu, Parent_Index, Menu)
    {
        // Menu ile bildirilen menüyü (x, y) koordinatlarında gösterir.
        this.Seffaflik_Full();
        this.Stop_Timer_Kapat();
        this.Stop_Timer_Ac();
        this.Gosterilen_Menu.Parent_Menu  = Parent_Menu;
        this.Gosterilen_Menu.Parent_Index = Parent_Index;
        this.Gosterilen_Menu.Menu         = Menu;
        this.Gosterilen_Menu.x            = 0;
        this.Gosterilen_Menu.y            = 0;

        if (Parent_Menu == null) // Menü ilk kez açılıyor ise (Başlık üzerine gelerek açılıyor ise)
            this.Callback_Menu_Goster();
        else
            this.Timer_Ac_Handle = setTimeout("Menu_Goster()", this.Timer_Baslama_Suresi);

        return true;
    },

    Menu_Gizle: function(Menu)
    {
        // Menu ile bildirilen menüden sonrakileri gizler.
        this.Stop_Timer_Kapat();
        this.Gizlenen_Menu = Menu;
        this.Timer_Kapat_Handle = setTimeout("Menu_Gizle()", this.Timer_Kapatma_Suresi);
        return true;
    },

    Callback_Menu_Gizle: function()
    {
        // Gizlenen_Menu ile bildirilen menüden sonrakileri gizler.

        if (this.Gizlenen_Menu == null && this.Acik_Menuler.length > 0)
        {
            this.Menuleri_Kapat(0);
            return;
        }

        var i = this.Menu_Ara(this.Gizlenen_Menu);

        // Açılacak olan menüden sonrakileri kapat.
        if (i > -1)
            this.Menuleri_Kapat(i + 1);
    }
}

function Menu_Goster()
{
    iMenu.Callback_Menu_Goster();
}

function Menu_Goster_Slayt()
{
    iMenu.Menu_Goster_Slayt();
}

function Alt_Menu_Yok_Goster()
{
    iMenu.Callback_Alt_Menu_Yok();
}

function Menu_Gizle()
{
    iMenu.Callback_Menu_Gizle();
}
