$(function() {
  Shadowbox.init({ handleOversize: "drag" });
  
  $('.arrows:first').css('display','none');
  $('#fMenu ul li:last').css('border','0px');
  $('#fMenu2 ul li:last').css('border','0px');
  $('#customnav li:last').css('border','0px');
  $('.col:last').css('background','url(./images/design/spacer.gif)');
    
  $("#finishbtn").click(function () {
      $("#finishes").slideToggle("slow");
      
      var title = $(this).attr("title");
      if ( title == "View finishes" ) {
       $(this).attr("title", "Hide finishes");
       $(this).removeClass('viewFinish');
       $(this).addClass('hideFinish');
      } else{
       $(this).attr("title", "View finishes");
       $(this).removeClass('hideFinish');
       $(this).addClass('viewFinish');
      } 
   });
   

/* ------------------------------- */
// Equal Heights
/* ------------------------------- */
function equalHeight(group) {
    tallest = 0;
    group.each(function() {
       thisHeight = $(this).height();
       if(thisHeight > tallest) {
        tallest = thisHeight;
      }
    });
    group.height(tallest);
}

equalHeight($(".col p"));
equalHeight($(".productthumb .productname"));

if ( $('div.expander').length )
{

$('div.expander').expander({
    slicePoint: 500,
    widow: 2,
    expandSpeed: 0
  });

}
  
});


 function doAjax( url ) {

   var title = $("#sel_link").attr("title");
   
    if ( title == "Add to SELECTOR" ) {
     url = url + '&action=add';
    } else {
     url = url + '&action=del';
    }

    $.ajaxq ("ajaxqueue", 
    {
        url: url,
        cache: false,
        success: function(html) {
        $("#sel_count").html(html);
              
         if ( title == "Add to SELECTOR" ) {
          $("#sel_link").attr("title", "Remove from SELECTOR");
          $("#sel_link img").removeClass('aselector');
          $("#sel_link img").addClass('rselector');
          } else {
          $("#sel_link").attr("title", "Add to SELECTOR");
          $("#sel_link img").removeClass('rselector');
          $("#sel_link img").addClass('aselector');
         }
        }
    });
}

function doDel( url ) {
 var status = window.confirm("Do you wish to remove this product from the Selector?");
   if ( status == true ) {
    document.location.href = url; 
  }  
}

