"use strict";var calc_from_expenses=new function(){this.initialized=false;this.user_can_edit=null;this.FORMCONTAINERNAME="calc_from_expenses";this.FORMNAME=this.FORMCONTAINERNAME+"_form"};calc_from_expenses.init=function(){if(calc_from_expenses.initialized===true){return}calc_from_expenses.initialized=true};calc_from_expenses.open=function(item){dialogMessage.viewBasic(calc_from_expenses.FORMCONTAINERNAME,'<div id="'+calc_from_expenses.FORMCONTAINERNAME+'"><span class="ui-dialog-load ui-corner-all"></span><div>',lang_projectadmin.is_calc_from_expenses,700,500,"calc_from_expenses.save();",true);if(calc_from_expenses.user_can_edit===false){$("#msgdialog"+calc_from_expenses.FORMCONTAINERNAME+" .ui-dialog-left-menu-big p span.ok").remove()}usComm.loadShowWait();openx("projectadmin_calc_from_expenses","get_values",item,calc_from_expenses.FORMCONTAINERNAME)};calc_from_expenses.init_popup=function(){if(calc_from_expenses.user_can_edit===false){$("#"+calc_from_expenses.FORMNAME).popdisable(true)}basicForm.initAll();var valSettingsList={errorClass:"errorsmall",ignoreTitle:true};$("#"+calc_from_expenses.FORMNAME).validate(valSettingsList);$("#calc_from_expenses_is_calc_from_expenses").bind("change",function(){$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_add_fees_to_offer").prop("checked",false);if($(this).prop("checked")===true){$("#"+calc_from_expenses.FORMNAME+" .is_calc_from_expenses_select").parent("p").show();$("#"+calc_from_expenses.FORMNAME+" .is_calc_from_expenses_info").show();$("#"+calc_from_expenses.FORMNAME+" .is_calc_for_staff_info").hide();var shall_add_fees_to_offer=$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_shall_add_fees_to_offer").val();if(shall_add_fees_to_offer==1){$("#"+calc_from_expenses.FORMNAME+" .is_add_fees_to_offer").show();$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_add_fees_to_offer").prop("checked",true)}else{$("#"+calc_from_expenses.FORMNAME+" .is_add_fees_to_offer").hide();$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_add_fees_to_offer").prop("checked",false)}}else{$("#"+calc_from_expenses.FORMNAME+" .is_calc_from_expenses_select").parent("p").hide();$("#"+calc_from_expenses.FORMNAME+" .is_calc_from_expenses_info").hide();$("#"+calc_from_expenses.FORMNAME+" .is_calc_for_staff_info").show();$("#"+calc_from_expenses.FORMNAME+" .is_add_fees_to_offer").hide()}}).trigger("change");if($("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_times").val()==""){$("#calc_from_expenses_is_calc_from_expenses").prop("checked",true).change()}};calc_from_expenses.save=function(){if($("#calc_from_expenses_is_calc_from_expenses").prop("checked")){if($("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_times").val()==""&&$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_area").val()==""&&$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_travel").val()==""&&$("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_extra").val()==""&&$.parseFloati18n($("#"+calc_from_expenses.FORMNAME+" #calc_from_expenses_threshold").val())==0){dialogMessage.dialogs["calc_from_expenses"].dialog("close");return}}if($("#"+calc_from_expenses.FORMNAME).valid()){var formname=calc_from_expenses.FORMNAME;var post_values=xajax.getFormValues(formname);usComm.loadShowWait();openx("projectadmin_calc_from_expenses","save_values",post_values)}};