/// <reference path="jquery-1.7.1.js" />
/// <reference path="jquery.tablednd.js" />

$(document).ready(function () {
    $("#table-1").tableDnD();
    changeDragDrop();
    
    $("#ddl1").change(function () {
       changeDragDrop();
       
    });

    $("#btnDialog").click(function () {
        ConfirmOKCancel("hello there lovely!");
    });

    $("#confirmdialog").dialog(
       {
           autoOpen: false,
           buttons: {
               'OK': function () { $(this).dialog('close'); return true; },
               'Cancel': function () { $(this).dialog('close'); return false; }
           }
       });

   
});

function ConfirmOKCancel(msg) {
   
    $('#confirmdialog p').text(msg);
    $('#confirmdialog').dialog('open');
};

function changeDragDrop()
{
    if ($("#ddl1").val() == "1")
        $("#table-1 tr").addClass("nodrop nodrag");
    else
        $("#table-1 tr").removeClass("nodrop nodrag");
}

