var vBrowserType = "";
if (window.navigator.userAgent.indexOf("Firefox") != -1) vBrowserType = "Firefox";
if (window.navigator.userAgent.indexOf("MSIE") != -1) vBrowserType = "IE";
if (window.navigator.userAgent.indexOf("SV1") != -1) vBrowserType = "IESP2";
if (vBrowserType)
{
	var w = screen.availWidth;
	var h = screen.availHeight;
}

function openWindow(url, name, width, height, scrollbar)
{
	self.name = "main"; 
	var leftPos = (w-width)/2, topPos = (h-height)/2;
	popupWin = window.open(url, name, "width=" + width + ",height=" + height + ",scrollbars=" + scrollbar + ",top=" + topPos + ",left=" + leftPos + ",toolbar=no,directories=no,menubar=no");
}

function openWin(winName, urlLoc, w, h, showStatus, isViewer)
{
	l = (screen.availWidth - w)/2;
	t = (screen.availHeight - h)/2;
	features = "toolbar=no";  // yes|no 
	features += ",location=no";  // yes|no 
	features += ",directories=no"; // yes|no 
	features += ",status=" + (showStatus?"yes":"no"); // yes|no 
	features += ",menubar=no";   // yes|no 
	features += ",scrollbars=" + (isViewer?"yes":"no");  // auto|yes|no 
	features += ",resizable=" + (isViewer?"yes":"no");  // yes|no 
	features += ",dependent";   // close the parent, close the popup, omit if you want otherwise 
	features += ",height=" + h;
	features += ",width=" + w;
	features += ",left=" + l;
	features += ",top=" + t;
	winName = winName.replace(/[^a-z]/gi,"_");
	return window.open(urlLoc,winName,features);
}

function checkNum(fldsrc)
{
	var vField = fldsrc;
	var vValue = document.getElementById(fldsrc).value;
	var bReset = false;
	if (isNaN(vValue) && vValue != "")
	{
		bReset = true;
		alert("Item quantity must be a number\n");
	}
	if (vValue.indexOf('.') >= 0)
	{
		bReset = true;
		alert("Item quantity cannot contain a decimal\n");
	}
	if (bReset == true)
	{
		document.getElementById(fldsrc).value = "";
		//setTimeout("document.getElementById(vField).focus()", 10);
	}
}
