/*
 * Script to handle display and fade in of product compare checkboxes 
 * 
 */

//DOM Ready
$(document).ready(function () {
	
	//the hover callback handles mouseover and mouseout in one event
	$('.compare-hover').hover(function () {
		$(this).find('.ProductCompareButton').fadeIn('fast').addClass('focused');
	}, function () {
		// mouse out
		
		//we see if we can find a checkbox that is 'checked' within this LI.
		//only hide the compare box if one DOESN'T exist
		if(!$(this).find('.ProductCompareButton input:checkbox').attr('checked'))
			$(this).find('.ProductCompareButton').hide();
		
		//this has the effect of leaving a selected compare checkbox visible
		//to the user
	})
});