function windowOpenCQAR(url)
{
	var w = "792";
	var h = 528;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	//var args = 'status=yes, resizable=yes, scrollbars=yes,height='+h+',width='+w+',top='+wint+',left='+winl	
	
/*	var win = window.open( url, 0, args );
	if (win)
	{
		win.focus();
	}
	else
	{
		alert("Error#1: Unable to focus window.");
	}*/
}

function windowOpenOLS(url)
{
	windowprops = "height=600,width=800,location=yes,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes";
	window.open(url, "Popup", windowprops);
}

function isInteger (s)
{
	var i;
	if (isEmpty(s))
		if (isInteger.arguments.length == 1) return false;
		else return (isInteger.arguments[1] == true);
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (!isDigit(c)) return false;
	}
	return true;
}

function isDigit (c)
{
	return ((c >= '0') && (c <= '9'))
}

function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function validateAndSend ()
{
	var elem = document.getElementById('drvzip5fld');
	if((elem.value.length ==5)&&(isInteger(elem.value)))
	{
		Form1.submit();
	}
	else
	{
		alert("Zip code must be 5 digits long (No non numeric characters allowed).");
		elem.focus();
		elem.select();
	}
	return false;
}
document.onkeydown=function(e){
	if (!e) var e = window.event;
		var code=e.keyCode ? e.keyCode:e.which;
	if(code==13)
	{
		if(e.srcElement.name == 'drvzip5fld')
		{
			validateAndSend();
			return false;
		}
	}	
}
