var thewin;

function popup(url, width, height, args)
{
	var popupwin = new Object();
	
	var fullArgs = args;
	fullArgs += ',width=' + width;
	fullArgs += ',height=' + height;
	fullArgs += ',left=' + Math.round((screen.width - width)/2);
	fullArgs += ',top=' + Math.round((screen.height - height)/2);
	
	popupwin.win = window.open(url, 'popwin', fullArgs);
	
	popupwin.win.focus();
}

function popupdemo(url, width, height, args)
{
	var popupwin = new Object();
	
	var fullArgs = args;
	fullArgs += ',width=' + width;
	fullArgs += ',height=' + height;
	fullArgs += ',left=' + Math.round((screen.width - width)/2);
	fullArgs += ',top=' + Math.round((screen.height - height)/2);
	
	popupwin.win = window.open(url, 'popdemowin', fullArgs);
	
	popupwin.win.focus();
}


function popupalert_deprecated(url, width, height, args)
{
	var popupwin = new Object();
	
	var fullArgs = args;
	fullArgs += ',width=' + width;
	fullArgs += ',height=' + height;
	fullArgs += ',left=' + Math.round((screen.width - width)/2);
	fullArgs += ',top=' + Math.round((screen.height - height)/2);
	fullArgs += ',title="Hey"'
	
	popupwin.win = window.open('blank.asp', 'alertwin', fullArgs);
	
	popupwin.win.location.href = url;
	popupwin.win.focus();
	
}

function closeandrefresh()
{
	window.opener.focus();
	window.opener.location.reload();
	window.close();
}

function refreshparent()
{
	window.opener.location.reload();

}

function closeandredirect()
{
	var url;
	window.opener.focus();
	
	url = window.opener.location.href;

	window.opener.location.href=url;
	window.close();
}

function gotoURL(url, args)
{
	document.location.href=url;
}