﻿$(document).ready(function () {
    f_enter();
    $("#liEnstitu").hover(function () {
        var h = $("#ulEnstitu").height();
        //$("#ulEnstitu").stop(true,true).slideDown(600).animate({ "height": h }, 600);
        $("#ulEnstitu").stop(true, true).slideDown(500);
    }, function () {
        $("#ulEnstitu").stop(true, true).slideUp(0);
    });

    $("#liPersonel").hover(function () {
        $("#ulPersonel").stop(true, true).slideDown(500);
    }, function () {
        $("#ulPersonel").stop(true, true).slideUp(0);
    });

    //    $("#liBirim").hover(function() {
    //        $(".ulAltC2").slideDown(600);
    //    }, function() {
    //        $("#ulBirim").hide(10);
    //    });
    $("#liBirim").hover(function () {
        $("#ulBirim").stop(true, true).slideDown(500);
    }, function () {
        $("#ulBirim").stop(true, true).slideUp(0);
    });
    $(".ulAltC2").hide();
    $("li.liAlt2").hover(function () {
        $(".ulAltC2").stop(true, true).hide();
        var ID = $(this).attr("id").replace("li", "");
        //alert(ID);
        $("#ul" + ID).stop(true, true).show();
    }, function () {
        $("#ul" + ID).stop(true, true).slideUp(0);
        //$(".ulAltC2").hide();
    });

    $("#liProje").hover(function () {
        $("#ulProje").stop(true, true).slideDown(500);
    }, function () {
        $(".ulAltC1").stop(true, true).slideUp(0);
    });
    $("#lipsonuc").hover(function () {
        $("#ulpsonuc").stop(true, true).show();
    }, function () {
        $(".ulAltPC").stop(true, true).slideUp(0);
    });
    $("#lipdevam").hover(function () {
        $("#ulpdevam").stop(true, true).show();
    }, function () {
        $(".ulAltPC").stop(true, true).slideUp(0);
    });


    $("#liEgitim").hover(function () {
        $("#ulEgitim").stop(true, true).slideDown(500);
    }, function () {
        $("#ulEgitim").stop(true, true).slideUp(0);
    });


    $("#liRapor").hover(function () {
        $("#ulRapor").stop(true, true).slideDown(500);
    }, function () {
        $("#ulRapor").stop(true, true).slideUp(0);
    });



    $(".ulAltCL").hide();
    $("li.liAltL").hover(function () {
        var ID = $(this).attr("id").replace("liL", "");
        $("#ulL" + ID).stop(true, true).slideDown(500);
    }, function () {
        $(".ulAltCL").stop(true, true).slideUp(0);
    });

    $("html,body").hover(function () {
        $(".ulAltC,.ulAltC1,ulAltPC").hide(0);
    });



    $("h1.h1bC").hover(function () {

        var ID = $(this).attr("id").replace("h1b", "");
        if ($("#ulBaglanti" + ID + " > li").size() > 0)
            $("#ulBaglanti" + ID).stop(true, true).slideDown();
    }, function () {
        $(".ulBaglanti").stop(true, true).slideUp(0);
    });


    f_Istatistik();
});

function OyVer() {

    var spn = $("#lblOyVer");
    $(spn).addClass("spnLoadK");

    //var unvan=$("input[name=unvan]").val(); 
    //    var unvan;
    //    for (var i = 0; i < form.unvan.length; i++) {
    //        if (form.unvan[i].checked) {
    //            unvan = form.unvan[i].value;
    //            break;
    //        }
    //    }
    //    alert(unvan);
    //var ID = $("#RadioButtonListAnket input:selected").val();
    //alert($('#<%=RadioButtonListAnket.ClientID %> input[type=radio]:checked').val());
    //alert($("#RadioButtonListAnket").find("input[@checked]").val());

    var ID = $("input:radio[name='choices']:checked").val();
    //alert(ID);


    jQuery.ajax({
        type: "POST",
        url: 'Handler/H_Anket.aspx?ID=' + ID + '&Tur=3',
        data: "{}",
        success: function(msg) {
        jQuery.facebox("<div class='dprfl divFacebox'>" + msg + "</div>");
        $(spn).removeClass("spnLoadK");
        },
        error: function(e) {
            alert(e.responseText);
            //UrunGetir(ID);
        }
    });
}

function FaceKapat() {
    $(document).trigger('close.facebox');
}

function f_divAra() {
    var v = $("#txtAra").val();
    if (v != "")
        location.href = "Arama.aspx?ID=" + v;
}
function f_enter() {

    jQuery("#txtAra").keydown(function (e) {
        
        if (e.keyCode == 13) {
            
            f_divAra()
            return false;
        }
    });
}



function f_Istatistik() {
    $("#divIstatistik").addClass("LoadSepet");
    jQuery.ajax({
        type: "POST",
        url: "Handler/H_Istatistik.aspx",
        data: "{}",
        success: function (msg) {
            $("#divIstatistik").removeClass("LoadSepet");
            $("#divIstatistik").html(msg);
        },
        error: function (e) {
            //alert(e.responseText);
            jQuery.facebox("<div class='dprfl divFacebox'>Küçük bir hata oluştu. <br> Lütfen tekrar deneyiniz.</div>");

        }
    });
}

