//-open popup window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features)
}

//-open popup window
function winPOP(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features)
}

//control for instruction window
var bookWindow;
function newWindow(bookgif) {
	if (!bookWindow || bookWindow.closed) {
	bookWindow = window.open(bookgif,'bookWin','scrollbars=yes,width=250,height='+mainheight+',left='+leftPos+',top=1');
	//bookWindow.focus();
	}else{
		bookWindow.focus();
	}
}

//control to close instruction window
function closeInstructWindow() {
	if (bookWindow && !bookWindow.closed){
		bookWindow.close();
	}
}

function isDigits(str) {
        var i
        for (i = 0; i < str.length; i++) {
                mychar = str.charAt(i)
                if (mychar < "0" || mychar > "9")
                        return false
        }
        return true
}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

function isEmpty(s)
      { return ((s == null) || (s.length == 0)) }
	
