var gradientH = 300;

window.onload = function() {
	var winH = 0;
	if(window.innerHeight) {
		winH = window.innerHeight;
	} else if(document.documentElement.clientHeight) {
		winH = document.documentElement.clientHeight;
	} else if(document.body.offsetHeight) {
		winH = document.body.offsetHeight;
	}

	var fillH = winH - 20 - 232;
	if(fillH < document.getElementById("secondaryNav").offsetHeight) {fillH = document.getElementById("secondaryNav").offsetHeight;}
	document.getElementById("secondaryBlock").style.height = fillH + "px";
	
	if(winH < gradientH) {
		document.getElementById("bottomGrad").style.bottom = "-" + (gradientH-winH) + "px";
	} else {
		document.getElementById("bottomGrad").style.bottom = "0px";
	}
}

window.onresize = function() {
	var winH = 0;
	if(window.innerHeight) {
		winH = window.innerHeight;
	} else if(document.documentElement.clientHeight) {
		winH = document.documentElement.clientHeight;
	} else if(document.body.offsetHeight) {
		winH = document.body.offsetHeight;
	}

	var fillH = winH - 20 - 232;
	if(fillH < document.getElementById("secondaryNav").offsetHeight) {fillH = document.getElementById("secondaryNav").offsetHeight;}
	document.getElementById("secondaryBlock").style.height = fillH + "px";

	if(winH < gradientH) {
		document.getElementById("bottomGrad").style.bottom = "-" + (gradientH-winH) + "px";
	} else {
		document.getElementById("bottomGrad").style.bottom = "0px";
	}
}