﻿$(document).ready(function () {
    $.featureList(
$("#tabs li a"),
$("#output li"), {
    start_item: 0
}
);
    //Default Action
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
    //On Click Event
    $("ul.tabs li").click(function () {
        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active content
        return false;
    });




    //ads navigator

    var len = $("#list").find("ul").children().length;
    if (len > 8)
        len = 8


    if (len > 0) {



        $("#list").jCarouselLite({
            btnNext: "#navtop",
            btnPrev: "#navbottom",
            vertical: true,
            visible: len,
            auto: 2500,
            speed: 1000
        });
    }

    $('.Btnvote').click(function (event) {
        event.preventDefault();
        var Op_ID = $("#referendumcont input[name='Vote']:checked").val();
        if (isNaN(Op_ID))
            alert('لم تقم بتحديد خيار التصويت');
        else {







            $.ajax({
                type: "get",
                cache: false,
                url: 'ajax.aspx?Flag_ID=1&Op_ID=' + Op_ID,
                success: function (Chart) {

                    $('#VoteChart').html(Chart);
                    $("#referendumcont input[name='Vote']").attr('disabled', true);
                    $("#referendumcont input[name='Vote']").attr('checked', false);
                    $('.Btnvote').attr('disabled', true);
                    //   $.fancybox({ 'content': $('#VoteChart').parents().html() }); 
                }

            });







        }
    });


    $(".Voteresult").fancybox({
        'titlePosition': 'inside',
        'transitionIn': 'none',
        'transitionOut': 'none'
    });








});


