/* Calculate height of page and position footer at the bottom */

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		 
		 if(windowHeight<=940)
		 	windowHeight=972;
		if (windowHeight > 0) {
			
			var topsectionHeight = document.getElementById('frameTop').offsetHeight;
			var contentHeight = document.getElementById('frameContent').offsetHeight;
			var footerElement = document.getElementById('frameBottom');
			var footerHeight  = footerElement.offsetHeight;
			 
			if (windowHeight - (topsectionHeight + contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative'; 
				 footerElement.style.top = (windowHeight - (topsectionHeight + contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}

window.onload = function() {
	setFooter();
	
}
window.onresize = function() {
	setFooter();
}

function validate_form ( )
{
    valid = true;

    if ( document.getElementByID('theForm').age.checked == false )
    {
        alert ( "You must check the box confirming that you are at least 21 years of age in order to join the Antica mailing list." );
        valid = false;
    }

    return valid;
}
