function popup(url, winname, width, height)
{
  var Win = window.open(url,
                        winname,
                        'width=' + width +
                        ',height=' + height +
                        ',location=no,menubar=no,status=no,toolbar=no,scrollbars=1,resizable=1,left=50,top=50');
}

function openWindow(url, winname, width, height, left, top)
{
  var Win = window.open(url,
                        winname,
                        'width=' + width +
                        ',height=' + height +
                        ',location=no,menubar=yes,status=no,toolbar=no,scrollbars=1,resizable=1,' +
                        'left=' + left +
                        ',top=' + top);
}

function fullWindow(url, winname, width, height, left, top)
{
  var Win = window.open(url,
                        winname,
                        'width=' + width +
                        ',height=' + height +
                        ',location=yes,menubar=yes,status=yes,toolbar=yes,scrollbars=1,resizable=1,' +
                        'left=' + left +
                        ',top=' + top);
}

function toolWindow(url, winname, width, height, left, top)
{
  var Win = window.open(url,
                        winname,
                        'width=' + width +
                        ',height=' + height +
                        ',location=no,menubar=yes,status=no,toolbar=yes,scrollbars=1,resizable=1,' +
                        'left=' + left +
                        ',top=' + top);
}

function checkNonBlank(bAlert, oField)
{
  var bOk = true;

  if (oField.value.length == 0) {
    bOk = false;
    if (bAlert) {
      alert("This field is a required field");
      oField.focus();
    }
  }

  return bOk;
}

function checkInt(bAlert, oField)
{
  var bOk = true;
  var nOldValue = parseInt(oField.value);

  if (isNaN(nOldValue)) {
    bOk = false;
    if (bAlert) {
      alert("This field must contain a numeric value." + oField.value);
      oField.focus();
    }
    else
     oField.value = "0";
  }

  return bOk;
}

function showQtyExplanation()
{
	$('qty_explanation').style.display = 'block';
}

function hideQtyExplanation()
{
	$('qty_explanation').style.display = 'none';
}

