this.screenshotPreview = function(){	
		xOffset = 40;
		yOffset = 30;
		
	jQuery("a.preview").hover(function(e){
			this.t = this.title;
			this.title = "";	
			var c = (this.t != "") ? "<br/>" + this.t : "";
			jQuery("body").append("<div id='preview'><img src='"+ this.rel +"' alt='Loading' />"+ c +"</div>");								 
			jQuery("#preview")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.fadeIn("slow");						
	    },
		function(){
			this.title = this.t;	
			jQuery("#preview").remove();
	    });	
		jQuery("a.preview").mousemove(function(e){
			jQuery("#preview")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
		});			
	};

jQuery(document).ready(function($) {
	screenshotPreview();    
	$('.grouped-overlay-link').live({
	  	click: function(event) {
			event.preventDefault();
			$(this).next('div.grouped-overlay').css("height", parseInt($(this).parent().css("height")) - 10);
			$(this).next('div.grouped-overlay').css("width", parseInt($(this).parent().css("width")) - 10);
	  		$(this).next('div.grouped-overlay').show('slow');
		}
	});
	
	$('.grouped-overlay').live({
		click: function() {
			$(this).hide('slow');
		}
	});
	
	$('.grouped-product-thumb').live({
		mouseover: function() {
			$(this).parent().prev().html('<img src="'+$(this).attr('rel')+'" alt="'+$(this).attr('alt')+'"/>');
		}
	});
	
	$(".expand-img").click( function() {
		alt = $(this).attr("src");
		$(this).attr("src",$(this).attr("rel"));
		$(this).attr("rel",alt);
		
		if ($.browser.msie) {
			if(document.getElementById('mcat-'+$(this).attr("id")).style.display == 'none') {
				document.getElementById('mcat-'+$(this).attr("id")).style.display = 'block'; 
			} else {
				document.getElementById('mcat-'+$(this).attr("id")).style.display = 'none'; 
			}
		} else {
			$(this).parent().next("ul").toggle();
		}
	});
	
});

