$(document).ready(function() {

// Center product thumbnails

	$('#thumbProduct img').each(function() {
		curImgWidth = $(this).attr('width');
		$('#thumbProduct img').css({
			'display':'block',
			'width': curImgWidth,
			'margin':'10px auto'
		});
	});

// Code for jquery lightbox
	
	$('#thumbProduct a').lightBox({
		txtImage:'Photo',
		txtOf: '/',
		containerResizeSpeed: 400,
		overlayBgColor: '#d1d1d1',
		overlayOpacity: .5,
		imageBtnClose: 'images/lightbox/lightbox-btn-close.gif',
		imageBtnPrev: 'images/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: 'images/lightbox/lightbox-btn-next.gif',
		imageBlank: 'images/lightbox/lightbox-blank.gif',
		imageLoading: 'images/lightbox/lightbox-ico-loading.gif'
	});	

// Tablesorter 

	$('table#product-listing.striped')
	.tablesorter({ widgets:['zebra'], sortList:[[4,1],[0,0],[1,0]] });

// Code to turn product table rows different colors & highlight when moused over
	
	$('table.striped tbody tr')
	.mouseover(function() {
		$(this).addClass('highlight');
		$(this).css('cursor','pointer');
	})
	.mouseout(function() {
		$(this).removeClass('highlight');
	});
	
// Code to put quotes around testimonials

	$('.testimonials blockquote p').prepend('&ldquo;');
	$('.testimonials blockquote p').append('&rdquo;');
	
// Target proper page for navLists

	function whatLink() {
		if ('#content.lists') {
		"lists-detail.php?";
		} else
		if ('#content.sale') {
		"sale-detail.php?";
		} else
		if ('#content.rent') {
		"rent-detail.php?";	
		}
	};
		
});