$(document).ready(function(){

  //hook the mouseup events to each header
  $("#slideContainer").children("#homeArrow").mouseup(function(){
 
    //find the body whose header was clicked
    var body = $(this).parent().children("#homeSlidingPanel");

    //slide the panel
    if(body.is(":hidden")){
      $(this).html('<a href="#"><img src="themes/standard/arrow_close.png" title="" alt="" /></a>');
      body.show("slide", { direction: "left" }, 'slow');
    }
    else{
      $(this).html('<a href="#"><img src="themes/standard/arrow_open.png" title="" alt="" /></a>');
      body.hide("slide", { direction: "left" }, 'slow');
    }
  });

  //hook the mouseup events to each header
  $("#slideContainer").children("#businessgiftArrow").mouseup(function(){
 
    //find the body whose header was clicked
    var body = $(this).parent().children("#businessgiftslidingPanel");

    //slide the panel
    if(body.is(":hidden")){
      $(this).html('<a href="#"><img src="themes/standard/arrow_close.png" title="" alt="" /></a>');
      //body.animate({width:'toggle'},2000);
      body.toggle('slide', {}, 'slow');
    }
    else{
      $(this).html('<a href="#"><img src="themes/standard/arrow_open.png" title="" alt="" /></a>');
     //body.animate({width:'toggle'},2000);
     body.toggle('slide', {}, 'slow');
    }
  });


  //hook the mouseup events to each header
  $("#slideContainer").children("#wholesaleArrow").mouseup(function(){
 
    //find the body whose header was clicked
    var body = $(this).parent().children("#wholesaleslidingPanel");

    //slide the panel
    if(body.is(":hidden")){
      $(this).html('<a href="#"><img src="themes/standard/arrow_close.png" title="" alt="" /></a>');
      body.show("slide", { direction: "left" }, 'slow');
    }
    else{
      $(this).html('<a href="#"><img src="themes/standard/arrow_open.png" title="" alt="" /></a>');
      body.hide("slide", { direction: "left" }, 'slow');
    }
  });

    $('.rollover').hover(function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('data-hover'));
        $(this).attr('data-hover', currentImg);
    }, function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('data-hover'));
        $(this).attr('data-hover', currentImg);
    });


    $('.loopimg').innerfade({ 
        animationtype: 'fade',
        speed: 2200,
        timeout: 4400,
        type: 'sequence'
    }); 

    $(".lavaLamp").lavaLamp({ fx: "linear", speed: 300 });



});
