// Quick way to test for Nav4 and IE4
version4 = false

if(navigator.appVersion.charAt(0) == "4") version4 = true

function displayPopup(url,name,height,width,evnt) {
var properties = "toolbar=0,location=0,height="+height
properties = properties+",width="+width
if(evnt != null) {
if(navigator.appName == "Microsoft Internet Explorer") {
properties = properties+",left="+(evnt.screenX + 10)
properties = properties+",top="+(evnt.screenY + 10)
}else { // Navigator coordinates must be adjusted for scrolling
properties = properties+",left="+(evnt.screenX - pageXOffset + 10)
properties = properties+",top="+(evnt.screenY - pageYOffset + 10)
}
}
popupHandle = open(url,name,properties)
}
function closePopup() {
// mouseOut was introduced with JavaScript 1.1, so Navigator 2 users will
// have to manually close the window
if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}

function setFocus(strCtrlName)
{
	eval('document.forms[0].' + strCtrlName + '.focus()');
}

function hasChanged(strOrgValue, strNewValue, strHdnField)
{
	if(strOrgValue.toLowerCase() != strNewValue.toLowerCase())
	{
		alert('document.forms[0].' + strHdnField + '.value = "true"');
	}			
}

function openWindow(strURL, strWinName, intWidth, intHeight, ynScroll, ynResize)
{ 
	var intLeft = (screen.width - intWidth) / 2; 
	var intTop = (screen.height - intHeight) / 2; 
	strWinProps = 'height=' + intHeight + ',width=' + intWidth +',top=' + intTop +',left=' + intLeft +',scrollbars='+ ynScroll + ',resizable=' + ynResize
	win = window.open(strURL, strWinName, strWinProps) 
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } 
}

function reloadClose()
{
	window.opener.focus();
	window.opener.location.reload();
	closeSelf()();
}

function closeSelf()
{
	window.close();
}

function submitForm()
{
	document.forms[0].submit();
}

function setOpenerValue(strFormKey, strFormValue)
{
	eval('window.opener.document.forms[0].' + strFormKey + '.value = "' + strFormValue + '"')
}

function closeSetFocus()
{
	window.opener.focus();
	closeSelf();
}

function popUpCheck()
{
	if(window.opener != null)
	{
		reloadClose();
	}
}



