function WinOpen(url,winName){
	features = "toolbar=1,location=0,menubar=0,directories=0,resizable=1,status=1,scrollbars=1,width=550,height=200";
	newWin = window.open(url,winName,features);
	setTimeout('newWin.focus();',250);
}

function popWindow(url, name, width, height) {
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
    var opts = 'height=' + height + ',width=' + width + ",screenX=" + x + ",left=" + x + ",screenY=" + y + ",top=" + y + ',location=no,scrollbars=yes,menubar=no,resizable=no,status=no,toolbar=no';

    var newWindow = window.open(url, name, opts);
    newWindow.focus();

} 

if(document.addEventListener){ 
	document.addEventListener("keypress", HandleEnterKey, true); 
} 
else{ 
	document.attachEvent("onkeypress", HandleEnterKey); 
} 


// Handle the enter key for a section of a form, binding it to the provided submit buton 
function HandleEnterKey(event) { 
	var nav = window.Event ? true : false; 
	if (nav) { 
		return NetscapeEventHandler_KeyDown(event); 
	} else { 
		return MicrosoftEventHandler_KeyDown(); 
	} 
} 

function NetscapeEventHandler_KeyDown(e) { 
	if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { 
		e.returnValue = false; 
		e.cancel = true; 
		e.preventDefault(); 
		var att = e.target.attributes['SubmitControl']; 
			if(att!=null) 
				CallSubmit(att.value) 
				return false; 
	} 
	return true; 
} 

function MicrosoftEventHandler_KeyDown() { 
	if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit') { 
		event.returnValue = false; 
		event.cancel = true; 
		var att = event.srcElement.attributes['SubmitControl']; 
			if(att!=null) 
				CallSubmit(att.value) 
		return false; 
	} 
	return true; 
}

