/* Most of the code source from:
 * http://www.pat-burt.com/web-development/how-to-do-a-css-popup-without-opening-a-new-window/
 * Edited by City on a Hill Press Web Dev
 * Thanks to the original author for this solution! */

function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}
function modalMask_size(loginDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		modalMask_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			modalMask_height = document.body.parentNode.clientHeight;
		} else {
			modalMask_height = document.body.parentNode.scrollHeight;
		}
	}
	var modalMask = document.getElementById('modalMask');
	modalMask.style.height = modalMask_height + 'px';
}
function popup(windowname) {
	modalMask_size(windowname);
	toggle('modalMask');
	toggle(windowname);		
}