// JavaScript Document
function disableEnterKey(e, which){
	var key;      
    if(window.event){
		key = window.event.keyCode; //IE
	}
    else{
		key = e.which; //firefox
	}
	if (key!=13){
		return key;
	}
	else{
		if (which == 'controlNumber')FilterByGroup('All', 'All','All','yearID', 'controlNumber', 'acSearchControlNumber');
		else if (which == 'solrSearch')
		{
			var name = 'criteria';
			var txt = document.getElementById('criteria');
			if (txt == null) name = 'mcriteria';
			performTextSearch(name);
		}
		return false;
	}
}
function isNumberKey(evt)
{
	
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57 || charCode == 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;
			}
		}
	}
}

// Open printer friendly page
function printPage() {
	window.print();
}
// Open larger image 
function openImageWindow(URLtoOpen, windowName, src) {
	var string = src;
	newWindow = window.open(URLtoOpen + "?path=" + src, windowName, 'height=768,width=1024,location=no,toolbar=no,scrollbars=no');
	newWindow.focus()
}
function openNewWindow(URLtoOpen, windowName, src) 
{ 
    var string = src;
    newWindow=window.open(URLtoOpen+"?cn="+src, windowName, 'height=750,width=900,location=no,toolbar=no,scrollbars=yes, resizable=yes, status=yes');
    newWindow.focus()
}

function GetScreen() {
	var width = screen.width;
	var height = screen.height;
	var txtHeight = document.getElementById('hheight');
	var txtWidth = document.getElementById('hwidth');
	txtHeight.value = width;
	txtWidth.value = height;	
}
