

var __hdlWin=null

function WindowModalDialogDetail(URL,WScale,HScale)
{
    alert(URL)
	W=Math.round(screen.availWidth * WScale)
	H=Math.round(screen.availHeight * HScale)
	L=screen.availWidth - W -50
	window.showModalDialog(URL,null,"toolbar=0,scrollbars=1,resizable=1,width=" + W + ",Height=" + H + ",top=10,left="+L)
}

function WindowDetail(URL,WScale,HScale)
{
   
	W=Math.round(screen.availWidth * WScale)
	H=Math.round(screen.availHeight * HScale)
	L=screen.availWidth - W -50
	
	
	if (__hdlWin != null && ! __hdlWin.closed) {
		__hdlWin.focus()
	}
	else
		__hdlWin=window.open(URL,null,"toolbar=0,scrollbars=1,resizable=1,width=" + W + ",Height=" + H + ",top=10,left="+L)
}

function WindowDetailFixed(URL,W,H)
{      
	L=screen.availWidth - W -50
	if (__hdlWin != null && ! __hdlWin.closed) {
		__hdlWin.focus()
	}
	else
		__hdlWin=window.open(URL,null,"toolbar=0,scrollbars=1,resizable=1,width=" + W + ",Height=" + H + ",top=10,left="+L)
}

function EnterToClick(enterObjId, clickObjId)
{
	var el =  document.getElementById(enterObjId)
	if (el.addEventListener)
		el.addEventListener("keypress", function(event) {
			if (event.keyCode==13)
			{
				document.getElementById(clickObjId).click();
				return false;
			}
		}, true);
	else
		el.attachEvent('onkeypress', function() {
			if (event.keyCode==13)
			{
				document.getElementById(clickObjId).click();
				return false;
			}
		});
}
