// logging to firebug

jQuery.fn.log = function (msg) {
  console.log("%s: %o", msg, this);
  return this;
};

$(document).ready(function()  
{  
  $('.fade-album-with-description').innerfade(
    { speed: "slow", timeout: 4000, type: 'sequence', containerheight: '380px' }
  );
  $('.fade-album-without-description').innerfade(
    { speed: "slow", timeout: 4000, type: 'sequence', containerheight: '340px' }
  );
  /* $('.popeye').popeye(); */

  // $("#slide-viewer").slideView();
  
  slide("#category-wrapper", 8, 0, 150, .8);
});




function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
  // creates the target paths
  // var list_elements = navigation_id + " li.sliding-element";
  var list_elements = navigation_id + " li";
  var link_elements = list_elements + " a";
  
  // initiates the timer used for the sliding animation
  var timer = 0;
  
  // creates the slide animation for all list elements 
  $(link_elements).each(function(i)
  {
    
    var url = $.jqURL.url()
    if (! (url.match("dzqxh.com/$") || url.match("4000/$")) ) return;
    // margin left = - ([width of element] + [total vertical padding of element])
    
    var element_in = "0px";
    $(this).css("margin-left",element_in);
    // updates timer
    timer = (timer*multiplier + time);
    
    var paddding_left = "0px";
    $(this).animate({ marginLeft: paddding_left }, timer);
    $(this).animate({ marginLeft: "15px" }, timer);
    $(this).animate({ marginLeft: paddding_left }, timer);
  });

  // creates the hover-slide effect for all link elements     
  /*
  $(link_elements).each(function(i)
  {
    $(this).hover(
    function()
    {
      $(this).animate({ paddingLeft: pad_out }, 150);
    },    
    function()
    {
      $(this).animate({ paddingLeft: pad_in }, 150);
    });
  });
  */
}

