var count = 0;
var arrItems = new Array()
/***********************************************************************
Purpose : Multi languange Support
Created By : Ranjith N
Created Date : 25-July-2011
***********************************************************************/
$(function(){    
   
   $(window).unload( function (){onWindowsUnload();});   
   
});

function updateWidgetData() {
 //var items = [];
 $('.column').each(function() {
 var columnId = $(this).attr('id');
 $('.form-box', this).each(function(i) {
 var collapsed = 0;
 if ($(this).find('.form-tbl').css('display') == "none")
 collapsed = 1;
 arrItems[count]='id=' + $(this).attr('id') +'&collapsed=' + collapsed + '&order=' + i + '&column=' + columnId;
 count++;
 //$.post('../Forms/Widgets.aspx', 'id=' + $(this).attr('id') +
 //'&collapsed=' + collapsed + '&order=' + i + '&column=' + columnId, function(response) {});
 });
 });
 }
function onWindowsUnload()
{
    if(arrItems.length != 0)
    {
        if(confirm("Are you sure you want to save the settings?"))
        {
            for(var j=0;j<arrItems.length;j=j+1)
            {
                var dataString = arrItems[j].toString();
                $.post('../Forms/Widgets.aspx?'+dataString);
            }
        }
    }
}