$(document).ready(function(){
	$(".col1:eq(2),.col2:eq(2)").css({
		"border-bottom":"none"
	});
	$("[href][rel='external']").attr({target:"_blank"});
	
	$("#navigationPrimary li:last-child, #footerNav li:last-child, #prefooter a:last-child").css({
		"border-right":"none",
		"margin-right":"0",
		"padding-right":"0"
	});	
	$(".checkOutProcess li:last-child").css({
		"border-right":"none"
	});
	$("#prefooter a:last-child").css({
		"margin":"0"					 
	});
	//alert($(".threeColumn li").length);
	$(".threeColumn li:nth-child(3n)").css({
		"padding":"11px 0 0 11px",
		"border-right":"none"
	});
	if($(".threeColumn li").length%3==0){
		for(i=3;i>0;i--){
			$(".threeColumn li:eq("+($(".threeColumn li").length-i)+")").css({
				"border-bottom":"none"
			});
		}
	}else{
		for(i=$(".threeColumn li").length%3;i>0;i--){
			$(".threeColumn li:eq("+($(".threeColumn li").length-i)+")").css({
				"border-bottom":"none"
			});
		}
	}
	$(".threeColumn li:nth-child(3n-2)").css({
		"padding":"11px 11px 0 0"
	});
	$(".threeColumn li:eq(0), .threeColumn li:eq(1), .threeColumn li:eq(2)").css({
		"padding-top":"0"
	});
	$(".fourColumn li:nth-child(4n)").css({
		"padding":"11px 0 0 11px",
		"border-right":"none"
	});
	if($(".fourColumn li").length%4==0){
		for(i=4;i>0;i--){
			$(".fourColumn li:eq("+($(".fourColumn li").length-i)+")").css({
				"border-bottom":"none"
			});
		}
	}else{
		for(i=$(".fourColumn li").length%4;i>0;i--){
			$(".fourColumn li:eq("+($(".fourColumn li").length-i)+")").css({
				"border-bottom":"none"
			});
		}
	}
	$(".fourColumn li:nth-child(4n-3)").css({
		"padding":"11px 11px 0 0"
	});
	$(".fourColumn li:eq(0), .fourColumn li:eq(1), .fourColumn li:eq(2), .fourColumn li:eq(3)").css({
		"padding-top":"0"
	});
	$(".dropshadow").each(function(){
		$(this).width(parseInt($(this).children().width()));
		$(this).height(parseInt($(this).children().height()));
		$(this).append('<div class="shadow topLeft"></div><div class="shadow bottomRight"></div><div class="shadow topRight"></div><div class="shadow bottomLeft"></div>');
		//alert($(this).css("clear"))
		if($(this).attr("id")=="flashMovie"){
			var clear = "both";
			var marginleft = "10px"
		}else{
			var clear = $(this).children().css("clear");
			var marginleft = $(this).children().css("margin-left")
		}
		if($(this).children().css("float")=="right"){
			var position = "3px";
		}else{
			var position = "-3px";
		}		
		$(this).css({
			"clear":clear,
			"float":$(this).children().css("float"),
			"margin-top":$(this).children().css("margin-top"),
			"margin-right":$(this).children().css("margin-right"),
			"margin-bottom":$(this).children().css("margin-bottom"),
			"margin-left":marginleft,
			"left":position
		});
		$(this).children().css({
			"margin":"0 0 0 0"
		});
		$(this).children(":not(.shadow)").css({
			"position":"relative",
			"z-index":"700"
		});
		
	});
	$("#productNav h1 a").each(function(){
		var curTitle = $(this).attr("title");
		curTitle = curTitle.toLowerCase();
		var newTitle = curTitle.replace(" ","_");
		var imgSrc = "url(/images/cat_" + newTitle + ".gif)";
		$(this).append("<img id='cat' />");
		$(this).css("background-image",imgSrc);
	});
	$("#productNav h2 a").each(function(){
		var curTitle = $(this).attr("title");
		curTitle = curTitle.toLowerCase();
		var newTitle = curTitle.replace(" ","_");
		var imgSrc = "url(/images/subcat_" + newTitle + ".gif)";		
		$(this).css("background-image",imgSrc);
	});
});