
function previewMailLabel() {
		if (document.acctBarcodeForm.costCenter.value == ''){
			alert("A cost center is required in order generate a mail label.");
			document.acctBarcodeForm.costCenter.focus();
			return false;
		}
		document.acctBarcodeForm.action.value = 'previewMailLabel';
		document.acctBarcodeForm.costCenterDesc.value=DWRUtil.getValue('costCenterDesc');
		document.acctBarcodeForm.submit();
		return;
}

function print2MailLabel() {
		var alertCostCenterChangedMsg = "Cost center has been changed. Please wait until previewed barcode is refreshed and then resume printing. Thanks!";
		if (document.acctBarcodeForm.costCenter.value == ''){
			alert("A cost center is required in order generate a mail label.");
			document.acctBarcodeForm.costCenter.focus();
			return false;
		}
		if (document.acctBarcodeForm.costCenterOld.value != '' && (document.acctBarcodeForm.costCenter.value != document.acctBarcodeForm.costCenterOld.value)) {
			document.acctBarcodeForm.action.value = 'previewMailLabel';
			document.acctBarcodeForm.costCenterDesc.value=DWRUtil.getValue('costCenterDesc');
			document.acctBarcodeForm.submit();
			alert(alertCostCenterChangedMsg);
		}
		return;
}

function cleanCostCenterDesc() {
		if (document.acctBarcodeForm.costCenter.value == '') {
			blankCostCenterDesc();
			resetDateTime()
		}
		return;
}

function blankCostCenterDesc() {
			document.acctBarcodeForm.costCenterDesc.value = '';
}

function resetDateTime() {
			document.acctBarcodeForm.dateTime.checked;
}

function resetAll() {
		document.acctBarcodeForm.action.value = 'reset';
		document.acctBarcodeForm.submit();
		return;
}
if (window.addEventListener) {
  window.addEventListener("load", init, false);
}
else if (window.attachEvent) {
  window.attachEvent("onload", init);
}
else {
  window.onload = init;
}

function init() {
  DWRUtil.useLoadingMessage();
}