       
function UpdateLoginGroupDetails() {

          var result;  
          var HeaderText;
          var grid = document.getElementById('ctl00_MainContent_grdCustProfile');

          if (grid != null) {
              for (var j = 0; j < grid.rows[0].cells.length; j++) {

                  if (HeaderText == null) {
                      HeaderText = grid.rows[0].cells[j].innerText;
                  }
                  else {
                      HeaderText = HeaderText + "," + grid.rows[0].cells[j].innerText;
                  }
              }
              var cname = "Column";
              var d = new Date();
              d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));
              var expires = "expires=" + d.toGMTString();
              document.cookie = cname + "=" + HeaderText + "; " + expires;

              chkCookie();                  
          }                  
      }      

 function chkCookie() {

     var user = getCookie("Column");
     document.getElementById('ctl00$MainContent$OtpHiddenField').value = user 
     
     
 }
     function getCookie(cname) {
         var name = cname + "=";
         var ca = document.cookie.split(';');
         for (var i = 0; i < ca.length; i++) {
             var c = ca[i];
             if (c.indexOf(name) == 0)return c.substring(name.length, c.length);
         }
         return "";
     }