// Some javascript functions for TrackIT.

// Sets the text in the browsers status bar (e.g. for mouseover
// effects. Don't forget to reset the status bar at mouseout!
function displayStatus(message) {
		window.status = message ;
		return true ;
}

function resetStatus() {
	 window.status= '' ;
	 return true ;
}

////////////
// Some code concerning the wait popup window.
//

var waitPopup = null ;


function showWait(_url) {
	// Open the wait popup
		var _width = 250 ;
		var _height = 100 ;
		var _left = (screen.width - _width) / 2 ;
		var _top = (screen.height - _height) / 2 ;
	
		config='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no' ;
		config += ',dependent=yes' ;
		config += ',width=' + _width ;
		config += ',height=' + _height ;
		config += ',left=' + _left ;
		config += ',top=' + _top ;

		waitPopup = window.open (_url,"waitPopup", config) ;
}
	
function closeWait() {
	if (waitPopup && waitPopup != null) {
			waitPopup.close() ;
	}
}

	
// Handler for page unload. Closes the wait popup, if defined.	
function unloadHandler() {
	closeWait() ;
}

//////////////////////
// Function to support forms.
//

function submitOnEnter(event, formName) {
	if (window.event) {
		// IE
		e = window.event ;
	} else if (event) {
		// Not IE, but a browser that supports the DOM2.
		e = event ;
	} 
	if (e && e.keyCode && e.keyCode == 13) {
		// We have an event, which has a keyCode field (not DOM, but IE, Firefox and maybe others have it) 
		// and it has the value 13 meaning 'enter'.
		form = document.getElementById(formName) ;
		if (form) {
			form.submit() ;
		} else {
			alert("Form " + formName + " not found.") ;
		}
	}
		
}

	
