function reloadFrame(frame)
{
  //top.frames[frame-1].location.reload();
  top.frames['f'+frame].location.reload();
  return true;
} 

function setField( FieldName, FieldValue, submitform) {
	document.form.elements[FieldName].value = FieldValue;
	if( submitform == 1 ) {
		document.form.submit();
	}
	return false;
}

function setField2( FieldName1, FieldValue1, FieldName2, FieldValue2, submitform) {
	document.form.elements[FieldName1].value = FieldValue1;
	document.form.elements[FieldName2].value = FieldValue2;
	if( submitform == 1 ) {
		document.form.submit();
	}
	return false;
}

/*	Opens a popup-window with the specified url, title, width and height
	Set scroll = 1 for scrollbars and resizeable = 1 if window is to be resizable
	the popup-window is placed in the middle of the screen
	Returns a reference to the new popup-window */
function openPopup( url, title, width, height, scroll, resize )
{
	if( width == 0) {
		width = screen.width - parseInt( screen.width * 0.15 );
		height = screen.height - parseInt( screen.height * 0.3 );
	}
	var param = "width=" + width;
	param += ",height=" + height;
	param += ",left=" + ( parseInt( screen.width / 2 ) - width / 2 );
	param += ",top=" + ( parseInt( screen.height / 2 ) - height / 2 );
	param += ",scrollbars=" + scroll;
	param += ",resizable=" + resize;
	//alert(param);
	self.open( url, title, param );
	//return('');
}

/*	Closes the specified window if open */
function closePopup( win )
{
	if ( win && ! win.closed )
		win.close();
}

/*	Opens a popup-window with helptexts in upper-left-corner of screen */
function openHelp( program, anchor )
{
	var url = "test";
	url += "?Program=" + program;
	url += "&Anchor=" + anchor;
	self.open( url, "Help", "width=500,height=375,scrollbars=1,resizable=1,left=0,top=0" );
}
