function openUrl( name, url, w, h )
{	//
	// openUrl
	// Opens the url in a window with the specified name.
	//
	var x = screen.availWidth / 2 - w / 2;
	var y = screen.availHeight / 2 - h / 2 - 50;
	var newWindow = window.open(url, name, "left=" + x + ", top=" + y + ", width=" + w + ", height=" + h + ", location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes");
    newWindow.focus();
}

function openReportResults( name, url, w, h )
{	//
	// openReportResults
	// Opens the report results at the specified url in a window with the specified name.
	//
	var x = screen.availWidth / 2 - w / 2;
	var y = screen.availHeight / 2 - h / 2 - 50;
	var newWindow = window.open(url, name, "left=" + x + ", top=" + y + ", width=" + w + ", height=" + h + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, toolbar=no");
    newWindow.focus();
}

function openUrlFullScreen( strUrl )
{	//
	// openUrlFullScreen
	//
    var newWindow = window.open(strUrl, "PageView", "menubar=no,scrollbars=no,resizable=no,status=no,location=no,fullscreen=yes");
    newWindow.focus();
}

function showStory( storyUrl )
{	//
	// showStory
	// Opens the specified page containing a story in a new window.
	//
	var w = 750;
	var h = 600;
	var x = screen.availWidth / 2 - w / 2;
	var y = screen.availHeight / 2 - h / 2 - 40;
	window.open(storyUrl, "_blank", "left=" + x + ", top=" + y + ", width=" + w + ", height=" + h + ", location=no, menubar=yes, resizable=yes, scrollbars=yes");
}

function CheckField( strFieldId, strFieldName )
{	//
	// CheckField
	// Determines if the specified field contains a valid value.
	//
	var objField;

	if( (objField = getObject(strFieldId)) == null )
		return false;

	if( objField.value == '' )
	{	alert( 'You need to specify a value for the \'' + strFieldName + '\' field');
		objField.focus();
		return false;
	}

	return true;
}