$(document).ready(function() {
	$(".shadow-white").each(function() {
		$(this).append("<div class='shadow-white-tl'></div><div class='shadow-white-t'></div><div class='shadow-white-tr'></div><div class='shadow-white-ml'></div><div class='shadow-white-mr'></div><div class='shadow-white-bl'></div><div class='shadow-white-b'></div><div class='shadow-white-br'></div>");
	});

	$(".shadow-header").each(function() {
		$(this).append("<div class='shadow-header-l'></div><div class='shadow-header-r'>");
	});

	if ($("#body").height() < 166) {
		$("#body").height(166);
	}

	if (window.location.pathname != "/") {
		$("#left-bar").css("height", $("#body").height()+"px");
	} else {
		if ($.browser.safari) {
			$("#left-bar").css("height", ($("#left-bar").height() - 20)+"px");
		}
		$("#right-bar").css("height", $("#left-bar").height()+"px");
	}

	/* Fix the shadow in IE 6 */
	if ($.browser.msie && $.browser.version == "6.0") {
		$(".shadow-white-ml, .shadow-white-mr").each(function() {
			$(this).css("height", $(this).parent().height()+"px");
		});

		$("#primary-nav > li").hover(function() {
			$(this).children("ul").show();
		}, function() {
			$(this).children("ul").hide();
		});
	}
	if ($.browser.msie && $.browser.version == "7.0") {
		$("#primary-nav > li").hover(function() {
			$(this).children("ul").show();
		}, function() {
			$(this).children("ul").hide();
		});
	}

	if (window.location.port != 80 && window.location.port != 443) {
		$("a[@href*='"+window.location.hostname+"']").each(function() {
			var href = $(this).attr("href").substr(7);

			if (href.indexOf(":") < 0) {
				$(this).attr("href", "http://" + href.replace(window.location.hostname, window.location.hostname + ":" + window.location.port));
			}

			return this;
		});
	}

	/*$(".customer-service").hover(function() {
		var $img = $("img", this);
		var nimg = $img.attr("src").replace(/(\.jpg)/, '_over$1');
		$img.attr("src", nimg);
	}, function() {
		var $img = $("img", this);
		var nimg = $img.attr("src").replace(/_over(\.jpg)/, '$1');
		$img.attr("src", nimg);
	});*/
});
