window.onload = WindowOnload;

function WindowOnload() {
	ResizeProductDetails();
}

function ResizeProductDetails() {
	if (document.getElementById("product_image") && document.getElementById("product_desc_overflow")) {
		imageHeight = document.getElementById("product_image").offsetHeight;
		productName = document.getElementById("lblProductName").offsetHeight;
		productOverflow = document.getElementById("product_desc_overflow");
		if (document.getElementById("product_sold_out")) {
			productOverflow.style.height = ((imageHeight-85)-productName) + "px";
		}
		else {
			productOverflow.style.height = ((imageHeight-54)-productName) + "px";
		}
		productOverflowChild = document.getElementById("product_desc_overflow_child");
		if (productOverflowChild.offsetHeight > productOverflow.offsetHeight) {
			productOverflow.style.paddingRight = "10px";
		}
	}
}

function SetupNavigation() {
	var sfEls = document.getElementById("wrapper_nav_main").getElementsByTagName("LI");
	var parentUL;
	var isIE6 = false;
	if (document.all) {
		if (typeof(document.body.style.maxHeight) == "undefined") {
			isIE6 = true;
			var ieFrame;
		}
	}
	if (isIE6 == true) {
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseout=function() {
				if (document.all) {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
			sfEls[i].onmouseover=function() {
				if (document.all) {
					this.className += " sfhover";
				}
			}
		}
	}
}
