$(document).ready(function () {

    //check box validation to update status
    $("#submitBulkStatus").click(function () {
        var changeStatus = $('#select_Status').val();
        if ($(".ListAll:checked").size() == 0) {
            jAlert(msgSelectItem);
            return false;
        } else if (changeStatus == "") {
            jAlert(lblSelectAction);
            return false;
        }
        if (changeStatus == 'D') {
            jConfirm(msgDeleteItem, 'Alert', function (r) {
                if (r == true) {
                    $('#formList').submit();
                }
            });
        } else {
            return true;
        }
        return false;
    });
	$(".changeStatus").click(function(){ 
		var id		=	$(this).attr("id");
		var status	=	$(this).attr("rel");
		$.ajax({
			type: "GET",
			url: GLOBAL_BASE_PATH+"/broucher/ajaxstatus/id/"+id+"/status/"+status+"",
			success: function(msg){ 
				location.reload();
			 }
		 });  			
	});
    /* $("[task=delete]").click(function () {
        var thehref = $(this).attr("rel");
        jConfirm(msgConfirmDelete, 'Alert', function (r) {
            if (r == true) {
                window.location.href = GLOBAL_BASE_PATH + thehref;
                return true;
            } else
                return false;
        });
    }) */
    //check box validation to update status
    $("#search").click(function () {
       if ($.trim($('#searchName').val()) == "" && $.trim($('#searchEmail').val()) == "" ) {
            jAlert(msgSelectSearchCriteria);
            return false;
        }
        return true;
    });
});