// cycle function
function cycle()
{
  // move first table up
  $("div#latest table").eq(0).animate({marginTop:"-60px"}, 1000, function()
  {
    // move top table to bottom
    //$("div#latest table").eq(0).appendTo("div#latest");
    
    // reset top top table margin and move to bottom
    $("div#latest table").eq(0).css({marginTop:"0px"}).appendTo("div#latest");

    // set up next fade
    setTimeout("cycle();", 3000);
  });
  
  /*
  // position next table ontop of current and fade it in
  $("div#latest table").eq(3).css({marginTop:"-180px"}).fadeIn(1000, function()
  {
    // remove top table
    $("div#latest table").eq(0).css({display:"none"});
    
    // reset margin
    $(this).css({marginTop:"0px"});
    
    // move top table to bottom
    $("div#latest table").eq(0).appendTo("div#latest");
    
    // set up next fade
    //setTimeout("cycle();", 5000);
  });
  */
}

// cycle latest products
$("document").ready(function()
{
  // hide all but first product table
  /*
  $("div#latest table").css({display:"none"});
  
  // show first three
  $("div#latest table").eq(0).css({display:"table"});
  $("div#latest table").eq(1).css({display:"table"});
  $("div#latest table").eq(2).css({display:"table"});
  */
  
  setTimeout("cycle();", 3000);
});
