function toggle_display(elementID) {
        var e = document.getElementById(elementID);
        if(e.style.display == "block") {
                e.style.display='none';
        }
        else {
                e.style.display='block';
        }
}

function popUp(url, w, h) {
	// Center popup in the middle of the screen
	var leftPos = (screen.width) ? (screen.width-w)/2 : 0;
	var topPos = (screen.height) ? (screen.height-h)/2 : 0;
	
	var windowprops = "width=" + w + ",height=" + h + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=" + topPos + ",left=" + leftPos + "";
		imgwin = window.open(url,'remote',windowprops);
}

function insertFrame(url, w, h, style) {
	var frame = '<iframe src="' + url + '"';
	frame += ' style="height: ' + h + 'px; width: ' + w + 'px;';
	if (!style) {
		style = 'border: 3px solid black; position: absolute; top: 50px; left: 0;';
	}
	frame += ' ' + style;
	frame += '"></iframe>';
	
	document.write(frame);
}
