
function onChangePriceListType(formField,contextPath){var downloadType=Form.Element.getValue($(formField));hideDownloadFormTypes();if(downloadType==0){requestPriceList_Popup(contextPath);}else if(downloadType==1){$('downloadDiscountForm').show();}else{$('downloadFullPriceListForm').show();}}
function requestPriceList_Popup(contextPath){Popup.open({url:contextPath+"/private/requestPriceList_Popup.do",width:700,height:700},null);}
function reloadContentBodyLeftOrders(){XT.doAjaxAction('reloadContentBodyOrders',this);}
function reloadContentBodyLeftInvoices(){XT.doAjaxAction('reloadContentBodyInvoices',this);}
function onChangeInvoiceListSize(listSize){XT.doAjaxAction('changeInvoiceListSize',null,{'listSize':listSize});}
function hideDownloadFormTypes(){$$("#frm_downloads form").each(function(elmt){elmt.hide();});}
function requestDiscountList(formId){Cursor.wait();XT.doAjaxAction('requestPriceList',null,$(formId).serialize(true));}
function requestNordicPriceList(formId){Cursor.wait();XT.doAjaxAction('requestPriceList',null,$(formId).serialize(true));}
function requestFullPriceList(formId,theUserName){Cursor.wait();var selectedPriceListFileType=document.downloadFullPriceListForm.elements["fileFormat"].value;if(selectedPriceListFileType!=null&&selectedPriceListFileType.length>0){PriceListFileTypeCookie.set(theUserName,selectedPriceListFileType);}
XT.doAjaxAction('requestPriceList',null,$(formId).serialize(true));}
function showAlert(options){alert(options.message);}
function priceListRequestAjaxCallback(options){Cursor.standard();alert(options.message);if(options.popupWindow=='1'){window.close();}}
function changeFileType(fileType){var upperFileType=fileType.toUpperCase();var lowerFileType=fileType.toLowerCase();if(lowerFileType!='xml'){var fileFormatInputField=$('downloadFullPriceListForm')['fileFormat'];Form.Element.setValue(fileFormatInputField,upperFileType);var attribute=$('downloadFullPriceListFileType').readAttribute('src');attribute=attribute.replace(/.{3}(\.gif)/,lowerFileType+'$1')
$('downloadFullPriceListFileType').setAttribute('src',attribute);}}
function initFileType(theUserName){var cookieValue=PriceListFileTypeCookie.get(theUserName);if(cookieValue!=null&&cookieValue.length>0){changeFileType(cookieValue);}}
