$(document).ready(function() {

    $("ul.sf-menu").superfish();
    $('.sf-menu li a img').hover(function() {
        $(this).fadeTo(200,0.8).fadeTo(200,1);
    });
    
    
    $(".icheckmain").click(function(){
        if($(this).is(":checked"))
            $(this).closest('table').find(".icheck").attr("checked", "checked");
        else
            $(this).closest('table').find(".icheck").removeAttr("checked");
    });

    $(".quick_del_item").click(function(){
        if (confirm('Are you sure you want to delete this?'))
        {
            $(this).closest('table').find('.icheck').removeAttr('checked');
            $(this).closest('tr').find('.icheck').attr('checked', 'checked');
            // $(this).closest('form').submit(); //this does not work.. don't know why
            $(this).closest('form').find('.submit').click();
        }
        else return false;
    });

    $('.delform').submit(function() {
        return confirm('Are you sure you want to delete selected item(s)?');
    });

});