
		$(document).ready(function() {
			if ($(".richerproductimage").length != 0) {
				$(".productimage").hide();
				$(".rcproppingtxt").hide();
				$(".richerproductimage").show();
			}
			
			if ($("li#image0 span.zoomimageurl").attr("title") != null ) {
				
				$("span.zoominfo").show();
				$(".jqzoom").jqzoom();
			}
			if ($("li#image0 span.zoomimageurl").attr("title") == null ) {
				var medImage = $("#currentimage img#largeImg");
				$("a.jqzoom").remove();
				$("#currentimage").prepend(medImage);
			}
				$("ul.thumbs").show();
				$("a.videopop").show();
				
				$("a.largeimagepop").hide();
				$("li#image0").addClass('active');
				
				$(".thumbs li a").click(function() {
					var zoomImg = $(this).parent().find("span.zoomimageurl").attr("title");
					var activeImage = $(this).parent().find("span.largeimgurl").attr("title");
			        var activeAlt = $(this).parent().find("span.largeimgalt").attr("title");    
			        var videoLink = $(this).parent().find(".videopopup a").attr("href");
					if ( zoomImg != null) {
						$("span.zoominfo").show();
						$('div.jqZoomPup').remove();
						$(this).parent().addClass('active');
						$(this).parent().removeClass('inactive');
						$(this).parent().siblings().removeClass('active');
						$(this).parent().siblings().addClass('inactive');
						if (activeImage != null) {
		                	$("#currentimage").html('<a class="jqzoom" title="Mouse over to zoom in" href="' + zoomImg + '"  ><img class="lrgprodimage" alt="' + activeAlt + '" src="' + activeImage + '" id="largeImg"/></a>');       	
		            	};
		            	if (activeImage == null) {
		                	$("#currentimage").html(''); 
		                	$("span.zoominfo").hide();      	
		            	};
		            	$(".jqzoom").attr({href: zoomImg}); 
		          		$("a.videopop").attr({href: videoLink}); 
			      		$(".jqzoom").attr({title: "Mouse over to zoom in"});
			          	$(".jqzoom").jqzoom();
			            return false;
		          		
		            };
		            if ( zoomImg == null) {
		                $("span.zoominfo").hide();
		            	$('div.jqZoomPup').remove();
						$(this).parent().addClass('active');
						$(this).parent().removeClass('inactive');
						$(this).parent().siblings().removeClass('active');
						$(this).parent().siblings().addClass('inactive');
						$("#currentimage").html('<img class="lrgprodimage" alt="' + activeAlt + '" src="' + activeImage + '" id="largeImg"/>');
		          		return false;
		            };
	       		 });
		});

