 $(function() {


        // carousel
        $("#carousel").jCarouselLite({
          btnNext: "#scrright",
          btnPrev: "#scrleft",
          scroll: 3,
          speed: 1500,
          circular: true,
          start: 0
        });


        // track mouse position, if it's insode page-header then show the
        // buttons
        var yPos;
        var xPos;

       $(document).mousemove(function(e){
         yPos = e.pageY;
         xPos = e.pageX ;

         if (yPos>=114 && yPos<=448) {
           $('#scrleft:hidden,#scrright:hidden').fadeIn();
         } else {
           if( $('select:focus').length==0) {
             $('#scrleft:visible,#scrright:visible').fadeOut();
             // remove any white bg from individual art images
             $('div.surround:visible').fadeOut();
             $('.lightboxselector').hide();
           }
         }
         //$('#left-column').html(e.pageX +', '+ e.pageY);
       });


       $('li.art-item div.art-image img').mouseover(function(){
         //fadeout all OTHER surrouds but NOT the one for current image
         $(this).parent('.art-image').parent('li').siblings().children('.art-image').siblings('div.surround:visible').fadeOut();

         $(this).parent().siblings('.surround').fadeIn();
         $(this).parent().siblings('.surround').children('img-details').addClass('over');
         $('.lightboxselector').hide();
       }) ;


       $('div.surround').mouseout(function(){
         if ($(this).children('.img-details').hasClass('over').length==0) {
           $(this).fadeOut();
           $('.lightboxselector').hide();
           $(this).children('.img-details').removeClass('over');
         }
       });

       $('li.art-item div.art-image img').click(function(){
         //grab teh link from eth moredetails link
         var url = $(this).parent().siblings('div').find('a.btn-moredet').attr('href');
         window.location = url;
       });



    $('.lightboxselector').hide();

    //add to lightbox button clicked
    $('a.btn-addlb').click(function(){
      if( $(this).siblings('.lightboxselector').length==1) {
        $(this).siblings('.lightboxselector').show();
        return false;
      }
    });

    //addnow for lightbox addition
    $('.addnow').click(function(){
      //check for a selected lightbox
      var newHref = $(this).attr('href') + '/lb/'+ $(this).siblings('.sellb').val();
      $(this).attr('href', newHref);
      //window.location.href = newHref;
      //alert(newHref);
      //return false;

    });



}); //end doc ready
