$(document).ready(function() {
    $(".images a").click(function() {
    	$(".images a").removeClass("active");
    	$(this).addClass("active");
    	$("#bigimg").attr("src", $(this).attr("href"));
    	return false;
    });
    
    $("#main-nav li").hover(function() {
    	$(this).children("ul").show();
    }, function() {
    	$(this).children("ul").hide();
    });
    	
    
    $(".openclose").click(function() {
    	r = $(this).attr("rel");
    	rel = $("#" + r);
    	if(rel.is(":visible")) {
    		$(this).addClass("closed");
    		rel.slideUp();
    		$.cookies.set("dp" + r, "none");	
		} else {
			$(this).removeClass("closed");
			rel.slideDown();
    		$.cookies.set("dp" + r, "block");	
		}
    });
    
    $("#product-images a").click(function() {
    	var hr = $(this).attr("href");
    	$("#product-image img").animate({"opacity":0.7}, 200, function() {
    		$(this).attr("src", hr).animate({"opacity":1}, 200);
    	});
    	
    	return false;
    });
    
    $("a.changescherp").live("click", function() {
    	h = $(this).attr("href");
    	$("img.imgbig").attr("src", h);
    	return false;
    });
});
/*
$(function() {
	if($.browser.msie) {
		var zIndexNumber = 10000;
		$('body *').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
		
		tmp = $("#collection7");
		z = tmp.css("zIndex");
		tmp.css("zIndex", (z+100));
	}
});
*/
