$.ff = 
{
  _vars : {},

  set : function(name,value)
  {
    $.ff._vars[name] = value;
  
  
  },
  
  get : function(name)
  {
    return $.ff._vars[name];
  },
  
  genUrl : function(internalUri)
  {
    var controller = $.ff.get('controller_name');
    if(controller == '' || controller == undefined)
    {
      return '/' + internalUri;
    }
    else
    {
      return '/'+controller+'.php/'+internalUri;
    }
  }
}





$.intval = function (v)
{ 
  v = parseInt(v); 
  return isNaN(v) ? 0 : v; 
}; 

//applying table effects
$(document).ready(function() 
{
  //searching for list tables rows
  $('table.list tr:odd').addClass('odd');
  $('table.list tr').hover(
	      function () 
	      {
	          $(this).addClass('hover');
	      }, 
	      function () 
	      {
	    	  $(this).removeClass('hover');
	      });

  
});



//applying confirmation for delete buttons
$(document).ready(function() 
{
  //searching for list tables rows
  $('a.icon.delete').click(function(e)
  {
    if(!confirm("Czy chcesz usunąć obiekt?"))
    {
		  e.preventDefault();
		  e.stopImmediatePropagation();
    }
	  
  });
  

		  
});

