/**
 * 
 */


$(function()
{
  $('#login-link').fancybox();
  
  //applying table effects
  $('table tr:odd').removeClass('odd').addClass('odd');
  $('table tr:not(:has(th))').hover(
        function () 
        {
          $(this).addClass('hover');
        }, 
        function () 
        {
          $(this).removeClass('hover');
        });
  
  $('a.add-to-quotation').click(function(e)
  {
    e.preventDefault();
    $.fancybox.showActivity();
    
    $.post($(this).attr('href'),function(data, textStatus,xmlReq)
    {
      //showing message to the user
      
      $.fancybox({content : data, onComplete : function()
      {
        ks_refresh_basket();
        
      }});

    });

  });
    
});

function ks_refresh_basket()
{
  $.get($.ff.genUrl('basket/loadbox'),function(data)
  {
    
    $('#basket-box-container').hide().html(data);
    $('#basket-box-container').slideDown();
    
  });
}

function ks_refresh_login_stuff()
{
  $('#login-link-container').load($.ff.genUrl('customer/loadloginlink'));
  ks_refresh_basket();
}
