function openWin(id, w, h) {
	var screenH, screenW
	screenH = screen.height
	screenW = screen.width
	
	var leftPos, topPos
	leftPos	= parseInt((screenW-w)/2)
	topPos = parseInt((screenH-h)/2)
	
	window.open(id,'','status=yes,scrollbars=yes,resizable=yes,width='+w+',height='+h+', left='+leftPos+', top='+topPos+'');
}


function openWin2(id, w, h) {
	var screenH, screenW
	screenH = screen.height
	screenW = screen.width
	
	var leftPos, topPos
	leftPos	= parseInt((screenW-w)/2)
	topPos = parseInt((screenH-h)/2)
	
	window.open(id,'','status=no,scrollbars=no,resizable=no,width='+w+',height='+h+', left='+leftPos+', top='+topPos+'');
}


function openModalWin(id, w, h) {
	window.showModalDialog(id, window, "dialogHeight: "+h+"px; dialogWidth: "+w+"px; edge: Raised; center: Yes; help: No; resizable: No; status: Yes;");
}

function doLicenceSearch()
{

	if (frmProductDetail.hidVendorID.value == "" || frmProductDetail.hidVendorID.value == -1)
	{
		alert ("You must select a vendor before searching.");
		frmProductDetail.submit();
		return false;
	}
	else
	{
		if (frmSearchLicence.searchCode.value != "" || 
			frmSearchLicence.searchDescription.value != "")
		{
			frmProductDetail.hidSearchCode.value=frmSearchLicence.searchCode.value;
			frmProductDetail.hidSearchDescription.value=frmSearchLicence.searchDescription.value;
			frmProductDetail.submit();
			return true;
		}
		else
		{
			alert ("Please enter at least one of the search criteria.");
			frmProductDetail.submit();
			return false;
		}
	}
}

function disableButton(btnObject)
{
	btnObject.disabled=true;
}