/*
 * Get the value of a selected radio button
 */
function getCheckedValue(radioObj)
{
	if(!radioObj)
		return "";

	var radioLength = radioObj.length;

	if(radioLength == undefined)
	{
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	}

	for(var i = 0; i < radioLength; i++)
	{
		if(radioObj[i].checked)
			return radioObj[i].value;
	}

	return "";
}


/*
 * Creates a general purpose popup window
 */
function popUpWin(url,width,height,options)
{
	if(typeof popup == "undefined" || popup.closed)
	{
		if(options == "")
			options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1';

        options += ',width='+width+',height='+height;
		popup = window.open("","",options);
	}

	popup.focus();
	popup.location = url;
}

function popUpWinScrolling(url,width,height,options)
{
	if(typeof popup == "undefined" || popup.closed)
	{
		if(options == "")
			options = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1';

        options += ',width='+width+',height='+height;
		popup = window.open("","",options);
	}

	popup.focus();
	popup.location = url;
}