function showHideDivision(divName)
{
	var divDOM = findDOM (divName, 1);
	if (divDOM.display == "block")
		divDOM.display = "none";
	else
		divDOM.display = "block";
}
		
function confirmDelete (action, eventName, url)
{
	var msg = "Are you sure you want to " + action + " this " + eventName + "? \n\n";
	if (confirm (msg))
		location = url;
	else 
		return false;	
}

var win;

function openWindow (theURL, winWidth, winHeight, winScroll, winResize) {
	if (winWidth == null) winWidth = '480';
	if (winHeight == null) winHeight = '320';
	if (winScroll == null) winScroll = 'yes';
	if (winResize == null) winResize = 'yes';
	win = window.open(theURL, 'newWin', 'scrollbars='+winScroll+',resizable='+winResize+',width='+winWidth+',height='+winHeight);
	
	if (!win.opener)
         win.opener = self;
}

var winCentered;

function openWindowCentered (theURL, winWidth, winHeight) {

	var w = 480, h = 340;
	
	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}

//	if (document.all) {
	   /* the following is only available after onLoad */
	   /*w = document.body.clientWidth;
	   h = document.body.clientHeight;
	}
	else if (document.layers) {
	   w = window.innerWidth;
	   h = window.innerHeight;
	}*/
	
	//w = w + WINDOWS OFSET;
	//h = h + WINDOW OFFSET;
	
	var leftPos = (w-winWidth)/2, topPos = (h-winHeight)/2;
	
	//alert ('h: '+ h + ' __ topPos: ' + topPos);
	
	winCentered = window.open(theURL,'centeredWin','scrollbars=no,resizable=no,width=' + winWidth + ',height='+winHeight+',top='+topPos+',left='+leftPos);

	if (!winCentered.opener)
         winCentered.opener = self;
}

function navigateToPage(url, p)
{
	pID = p.options[p.selectedIndex].value

	if (pID != "") {
		document.location.href = url + pID;
	}
}
