//open a standard pop-up window


function doOpen(url)
{
	var w = 800;
	var h = 600;
	openCenteredPopup(url, w, h);
}

function doOpen(url, w, h, name)
{
	openCenteredPopup(url, w, h, name);
}


function openCenteredPopup(url, w, h) {
	var winName = Math.round(Math.random() * 10000000);
	openCenteredPopup(url, w, h, winName);
}

function openCenteredPopup(url, w, h, name) {
	var screenWidth  = screen.availWidth;
   	var screenHeight = screen.availHeight;

	var left = (screenWidth - w)/2;
	var top = (screenHeight - h)/2;

	window.open(url, name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width="+w+",height="+h+",left="+left+",top="+top)
}

// open a centered popup window

function doOpenWithScroll(url, w, h, name)
{
	openCenteredPopupWithScrollbars(url, w, h, name);
}

function openCenteredPopupWithScrollbars(url, w, h) {
	var winName = Math.round(Math.random() * 10000000);
	openCenteredPopupWithScrollbars(url, w, h, winName);
}


function openCenteredPopupWithScrollbars(url, w, h) {
	var screenWidth  = screen.availWidth;
   	var screenHeight = screen.availHeight;

	var left = (screenWidth - w)/2;
	var top = (screenHeight - h)/2;

	var winName = Math.round(Math.random() * 10000000);

	window.open(url,winName,"toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width="+w+",height="+h+",left="+left+",top="+top)
}
