$(function() { 
  $('a.lightbox').lightBox({fixedNavigation:true});
  $('a#pg_img').lightBox() ;
  $('a#pg_txt').lightBox() ;
});

$(document).ready(function() {
  $("table.parts").tablesorter({sortList:[[2,1]], widgets: ['zebra']}) ;
  $("#slideshow a").click(function() {
		var i = $(this).attr("href"); 
		$("#large_image img").attr({ src: i });
		return false;		
	});
	
	// quotation form verification
	$("form#quote").submit(function() {
	  var hasError = false ;
	  $(".required").each(function() {
	    if ($(this).val() == '') {
	      $(this).addClass('quote-error') ;
	      hasError = true ;
	    } else {
	      $(this).removeClass('quote-error') ;
	    }
	  });
	  // do we have any errors
	  if (hasError) {
	    var msg = "Fields highlighted in red are required fields and must be "
	       + "filled in before continuing." ;
	    alert(msg) ;
	  }
	  return !hasError ; 
	});
});