// BOI, followed by one or more whitespace characters, followed by EOI.
var reWhitespace = /^\s+$/
// BOI, followed by one or more characters, followed by @,
// followed by one or more characters, followed by ., 
// followed by one or more characters, followed by EOI.
var reEmail = /^.+\@.+\..+$/
var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."
var iEmail = "This field must be a valid email address (like foo@bar.com). Please reenter it now."
var defaultEmptyOK = false
var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/
 var reInteger = /^\d+$/
// Check whether string s is empty.
function isEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}
// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace (s)
{   // Is s empty?
    return (isEmpty(s) || reWhitespace.test(s));
}
// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c -- in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.
function isEmail (s)
{   
	if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
    
    else {
       return reEmail.test(s)
    }
}
function isFloat (s)

{   if (isEmpty(s)) 
       if (isFloat.arguments.length == 1) return defaultEmptyOK;
       else return (isFloat.arguments[1] == true);

    return reFloat.test(s)
}
function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    return reInteger.test(s)
}

if( document.captureEvents && Event.MOUSEMOVE ) {
  //remove this part if you do not need Netscape 4 to work
  document.captureEvents( Event.MOUSEMOVE );
}
document.onMouseMove = detectMouseMove();
var xcoord;
var ycoord;
function detectMouseMove(e)
{
		if( !e ) 
			{
				if( window.event ) 
				{
				//Internet Explorer
				e = window.event;
				} 
				else 
				{
				//total failure, we have no way of referencing the event
				return;
				}
			}
			if( typeof( e.pageX ) == 'number' )
			{
			//most browsers
			xcoord = e.pageX;
			ycoord = e.pageY;
			} 
			else if( typeof( e.clientX ) == 'number' ) 
			{
			//Internet Explorer and older browsers
			//other browsers provide this, but follow the pageX/Y branch
			xcoord = e.clientX;
			ycoord = e.clientY;    
			} 
			else 
			{
			//total failure, we have no way of obtaining the mouse coordinates
			return;
			}
		//alert(xcoord);	
		window.status=xcoord + ' ' + ycoord;
	
}

//Function for popup window
function popUpWindow3(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  windowFeatures = 'width='+width+',height='+height+',left='+xcoord+', top='+ycoord+',screenX='+xcoord+',screenY='+ycoord+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0'
  popUpWin = window.open( URLStr, 'popUpWin', windowFeatures ) ; 
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  windowFeatures = 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'
  popUpWin = window.open( URLStr, 'popUpWin', windowFeatures ) ; 
}
function popUpWindow1(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  windowFeatures = 'width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+',toolbar=1,location=1,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'
  popUpWin = window.open( URLStr, 'popUpWin', windowFeatures ) ; 
}

