/**
 * Таблица
 */
PZ.Widget.JGrid = new function(){
	
	this.config = {};
	
	this.action = function(t,t2,u){
		var id = jQuery('#grid').getGridParam('selrow');
		if (id) return PZ.Widget.Window.confirm(t2,u+id);
		alert(t);
		return false;		
	}

	this.location = function(url){
		var id = jQuery('#grid').getGridParam('selrow');
		if (id) return location.href = url+id;
		alert('Выберите запись');
		return false;		
	}	
	
	this.multiaction = function(t,t2,u){
		var ids = jQuery('#grid').getGridParam('selarrrow');
		if (ids.length>0)return PZ.Widget.Window.confirm(t2,u+ids);
		
		alert(t);
		return false;
	}
	
	this.getsize = function(){
	
                    var hw = $(window).height();
                    var hp = $('#adminpanel').height();
                    var hd = $('.pageheader').height();
                    //var ft = $('#ft').height();
                    if ($('div').is('#toolbar')==false)
						var hb = hw-(hp+hd)-175;
					else 	
						var hb = hw-(hp+hd)-222;
		return hb;
	}
	
}




function debouncer( func , timeout ) {
   var timeoutID , timeout = timeout || 200;
   return function () {
      var scope = this , args = arguments;
      clearTimeout( timeoutID );
      timeoutID = setTimeout( function () {
          func.apply( scope , Array.prototype.slice.call( args ) );
      } , timeout );
   }
}




