function getScrollHeight() {
	pageHeight = document.body.offsetHeight;
	bodyHeight = window.innerHeight;
	if (!bodyHeight) {
	    //IE
		bodyHeight = document.documentElement.clientHeight;
	}
	if(pageHeight < bodyHeight) {
	    return bodyHeight;
	    
	} else {
		return pageHeight;
	}
}



function resize(top, fullheight, padding){
	var topelement = document.getElementById(top);
	var mydiv = document.getElementById(fullheight);
	var scrollheight = getScrollHeight();

	if (mydiv) {
        //Firefox
		var height = scrollheight - topelement.offsetHeight - padding;
		var finalheight = height + "px";
	}
	mydiv.style.height = finalheight;
}