var newwin;

function launchwin(winurl, winname, winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl, winname, winfeatures);

	if(javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}

//Function to open pop up window
function openWin(theURL, winName, features) {
  	window.open(theURL, winName, features);
}


 function AbortEntry(sMsg, eSrc)
 {
  window.alert(sMsg);
  // set focus and highlight to the offending error
  eSrc.focus();
  //eSrc.select();
 }

 function HandleError(eSrc)
 {
  // make sure the input is a numeric value
  var val = parseInt(eSrc.value);
  if (isNaN(val))
  {
   return AbortEntry("Must be a number.", eSrc);
  }

  // make sure the value is not negative
  if (val <= 0)
  {
   return AbortEntry("Please enter a positive number.", eSrc);
  }
 }
