function toggleevents(id) {
var thisone = document.getElementById(id);
if(thisone.style.display == 'none')
thisone.style.display = '';
else
thisone.style.display = 'none';
}
function toggleannouncements(id) {
var thisone = document.getElementById(id);
if(thisone.style.display == 'none')
thisone.style.display = '';
else
thisone.style.display = 'none';
}

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
		str = '';
	} else {
		var str = "height=" + strHeight + ",innerHeight=" + strHeight;
		str += ",width=" + strWidth + ",innerWidth=" + strWidth;
		if (window.screen) {
			var ah = screen.availHeight - 30;
			var aw = screen.availWidth - 10;
	
			var xc = (aw - strWidth) / 2;
			var yc = (ah - strHeight) / 2;
	
			str += ",left=" + xc + ",screenX=" + xc;
			str += ",top=" + yc + ",screenY=" + yc;
		}
	}
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+","+str;
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+","+str;
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}