function openWin(url, wname, w, h, extras) {

	if(wname.length < 1) {
		wname = 'divaWindow';
	}
	
	if(!(w > 0)) {
		w = 350;
	}
	
	if(!(h > 0)) {
		h = 250;
	}
	
	if(w > screen.width - 55)
		w = screen.width - 55;
	
	if(h > screen.height - 55)
		h = screen.height - 55;
	
	if(extras.length > 0) {
		extras = ',' + extras;
	}
	else {
		extras = ',' + 'locationbar=0,menubar=0,statusbar=0,toolbar=0,scrollbars=yes,status=0,location=0,resizable=yes';
	}
	
	newwin=window.open(url,wname,'width=' + w +',height=' + h + extras);
	newwin.focus();
}

function keyDownHandler(btn)
{
    // process only the Enter key
    if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        if(btn != null) {
			// submit the form by programmatically clicking the specified button
			btn.click();
        }
        else {
			//submit the form without button click
			document.forms[0].submit();
        }
    }
}
