
  function BenefitCheck()
  {
       var stopcache = new Date().getTime();

                    
                    $('#benefitcheck').load("BenefitCheck.php" , function (){

                    $( "#benefitcheck" ).dialog({

                       height    : 250,
                       width     : 400,
                       modal     : true,
                       stack     : true,
                       resizable : false,

                       title : 'Benefit Check',

                       open: function() {

                               
                               $(".ui-widget-overlay").css({
                                 position: 'fixed',
                                 top: '0'
                               });
                             },
                       close : function(event, ui) {
                                  $('#benefitcheck').html('');
                                  $(this).dialog('destroy');
                               },

                       buttons: {
                         "Submit": function(event) {

                           

                               $("body").css("cursor", "progress");

                               $.ajax({
                                   url     : 'benefitchecksave.php?stopcache='+ new Date().getTime(),
                                   type    : 'POST',
                                   cache   : false,
                                   context : $(this),
                                   data    : {'surname'       : $('#edtSurname').val(),
                                              'membershipno'  : $('#edtMembershipNo').val(),
                                              'idno'          : $('#edtIDNo').val()
                                             },
                                   success : function(resp){

                                               if (resp != ''){
                                                 alert(resp);
                                               };
                                               
                                               $( this ).dialog( "close" );},

                                   error   : function(resp){
                                               alert('Error' + resp);
                                             }
                               });



                               $("body").css("cursor", "default");
                           
                          },
                          Cancel: function() {
                            $( this ).dialog( "close" );
                          }
                         }                               

                      });
                 });
  }

