Removed yui-compressor on javascript files.

Fri, 18 Oct 2019 16:21:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 18 Oct 2019 16:21:54 +0200
changeset 522
35675eadc655
parent 519
c6021dd94afb
child 523
3cccf4392a25

Removed yui-compressor on javascript files.

www/Makefile file | annotate | diff | comparison | revisions
www/includes/global.inc.php file | annotate | diff | comparison | revisions
www/js/global-min.js file | annotate | diff | comparison | revisions
www/js/import_ingredients-min.js file | annotate | diff | comparison | revisions
www/js/inv_equipments-min.js file | annotate | diff | comparison | revisions
www/js/inv_fermentables-min.js file | annotate | diff | comparison | revisions
www/js/inv_hops-min.js file | annotate | diff | comparison | revisions
www/js/inv_miscs-min.js file | annotate | diff | comparison | revisions
www/js/inv_suppliers-min.js file | annotate | diff | comparison | revisions
www/js/inv_waters-min.js file | annotate | diff | comparison | revisions
www/js/inv_yeasts-min.js file | annotate | diff | comparison | revisions
www/js/jquery-1.11.1-min.js file | annotate | diff | comparison | revisions
www/js/log_brew-min.js file | annotate | diff | comparison | revisions
www/js/log_co2pressure-min.js file | annotate | diff | comparison | revisions
www/js/log_fermentation-min.js file | annotate | diff | comparison | revisions
www/js/mon_co2meter-min.js file | annotate | diff | comparison | revisions
www/js/mon_fermenter-min.js file | annotate | diff | comparison | revisions
www/js/mon_node-min.js file | annotate | diff | comparison | revisions
www/js/prod_archive_code-min.js file | annotate | diff | comparison | revisions
www/js/prod_archive_date-min.js file | annotate | diff | comparison | revisions
www/js/prod_archive_name-min.js file | annotate | diff | comparison | revisions
www/js/prod_divide-min.js file | annotate | diff | comparison | revisions
www/js/prod_edit-min.js file | annotate | diff | comparison | revisions
www/js/prod_export-min.js file | annotate | diff | comparison | revisions
www/js/prod_impbrew-min.js file | annotate | diff | comparison | revisions
www/js/prod_inprod-min.js file | annotate | diff | comparison | revisions
www/js/prod_new-min.js file | annotate | diff | comparison | revisions
www/js/profile_fermentation-min.js file | annotate | diff | comparison | revisions
www/js/profile_mash-min.js file | annotate | diff | comparison | revisions
www/js/profile_setup-min.js file | annotate | diff | comparison | revisions
www/js/profile_styles-min.js file | annotate | diff | comparison | revisions
www/js/profile_styles.js file | annotate | diff | comparison | revisions
www/js/profile_water-min.js file | annotate | diff | comparison | revisions
www/js/profile_water.js file | annotate | diff | comparison | revisions
www/js/rec_edit-min.js file | annotate | diff | comparison | revisions
www/js/rec_export-min.js file | annotate | diff | comparison | revisions
www/js/rec_import-min.js file | annotate | diff | comparison | revisions
www/js/rec_main-min.js file | annotate | diff | comparison | revisions
www/js/rec_new-min.js file | annotate | diff | comparison | revisions
--- a/www/Makefile	Fri Oct 18 13:09:37 2019 +0200
+++ b/www/Makefile	Fri Oct 18 16:21:54 2019 +0200
@@ -27,12 +27,10 @@
 		  includes/* fpdf/* import/*
 OTHER		= Makefile
 CSS_FILES	= $(filter-out %-min.css,$(wildcard css/*.css css/**/*.css ))
-JS_FILES	= $(filter-out %-min.js,$(wildcard js/*.js js/**/*.js ))
 YUI_COMPRESSOR	= yui-compressor
 YUI_COMPRESSOR_FLAGS	= --charset utf-8 --verbose
 
 CSS_MINIFIED = $(CSS_FILES:.css=-min.css)
-JS_MINIFIED = $(JS_FILES:.js=-min.js)
 
 
 
@@ -41,25 +39,18 @@
 .c.o:
 		${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<
 
-all:		minify-css minify-js
+all:		minify-css
 
 clean:
-		rm -f version.php ${CSS_MINIFIED} ${JS_MINIFIED}
+		rm -f version.php ${CSS_MINIFIED}
 
 minify-css:	$(CSS_FILES) $(CSS_MINIFIED)
-minify-js:	$(JS_FILES) $(JS_MINIFIED)
 
 %-min.css:	%.css
 		@echo '==> Minifying $<'
 		$(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type css $< >$@
 		@echo
 
-%-min.js:	%.js
-		@echo '==> Minifying $<'
-		$(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type js $< >$@
-		@echo
-
-
 install:
 		${INSTALL} -d -g 314 -o 314 ${PREFIX} ${WWWDIR} ${WWWDIR}/css ${WWWDIR}/fpdf \
 			${WWWDIR}/fpdf/font \
--- a/www/includes/global.inc.php	Fri Oct 18 13:09:37 2019 +0200
+++ b/www/includes/global.inc.php	Fri Oct 18 16:21:54 2019 +0200
@@ -142,7 +142,7 @@
 	my_color_method = "<?php echo $my_color_method; ?>", my_brix_correction = "<?php echo $my_brix_correction; ?>",
 	my_grain_absorbtion = "<?php echo $my_grain_absorbtion; ?>", my_default_water = "<?php echo $my_default_water; ?>";
   </script>
-  <script src="js/jquery-1.11.1-min.js"></script>
+  <script src="js/jquery-1.11.1.js"></script>
   <script src="jqwidgets/jqxcore.js"></script>
   <script src="jqwidgets/jqxwindow.js"></script>
   <script src="jqwidgets/jqxmenu.js"></script>
@@ -179,7 +179,7 @@
   <script src="jqwidgets/jqxfileupload.js"></script>
   <script src="jqwidgets/jqxpanel.js"></script>
   <script src="jqwidgets/globalization/globalize.js"></script>
-  <script src="js/global-min.js"></script>
+  <script src="js/global.js"></script>
 <?php
 if (strlen($loadjs))
     echo  '  <script src="js/'.$loadjs.'.js"></script>'.PHP_EOL;
--- a/www/js/global-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-var StageData=[{id:0,en:"Plan",nl:"Plan"},{id:1,en:"Wait",nl:"Wacht"},{id:2,en:"Brew",nl:"Brouwen"},{id:3,en:"Primary",nl:"Hoofdgisting"},{id:4,en:"Secondary",nl:"Nagisting"},{id:5,en:"Tertiary",nl:"Lagering"},{id:6,en:"Package",nl:"Afvullen"},{id:7,en:"Carbonation",nl:"Hergisten"},{id:8,en:"Mature",nl:"Rijpen"},{id:9,en:"Taste",nl:"Proeven"},{id:10,en:"Ready",nl:"Gereed"},{id:11,en:"Closed",nl:"Afgesloten"}],StageSource={localdata:StageData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StageAdapter=new $.jqx.dataAdapter(StageSource),SplitData=[{id:0,en:"Not divided",nl:"Niet gesplitst",ok:100},{id:1,en:"After mash",nl:"Na maischen",ok:2},{id:2,en:"After boil",nl:"Na koken",ok:2},{id:3,en:"After cooling",nl:"Na koelen",ok:2},{id:4,en:"After primary",nl:"Na hoofdgisting",ok:3},{id:5,en:"After secondary",nl:"Na nagisting",ok:4},{id:6,en:"After tertiary",nl:"Na lageren",ok:5}],SplitSource={localdata:SplitData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"ok"}]},SplitAdapter=new $.jqx.dataAdapter(SplitSource),MaterialData=[{id:0,en:"Stainless Steel",nl:"RVS",sh:0.11},{id:1,en:"Aluminium",nl:"Aluminium",sh:0.22},{id:2,en:"Plastics",nl:"Kunststof",sh:0.46},{id:3,en:"Copper",nl:"Koper",sh:0.092}],MaterialSource={localdata:MaterialData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"sh"}]},MaterialAdapter=new $.jqx.dataAdapter(MaterialSource),FermentableTypeData=[{id:0,en:"Grain",nl:"Mout"},{id:1,en:"Sugar",nl:"Suiker"},{id:2,en:"Extract",nl:"Vloeibaar extract"},{id:3,en:"Dry extract",nl:"Droog extract"},{id:4,en:"Adjunct",nl:"Ongemout graan"}],FermentableTypeSource={localdata:FermentableTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FermentableTypeAdapter=new $.jqx.dataAdapter(FermentableTypeSource),GrainTypeData=[{id:0,en:"Base",nl:"Basismout"},{id:1,en:"Roast",nl:"Geroosterde mout"},{id:2,en:"Crystal",nl:"Cara- of crystalmout"},{id:3,en:"Kilned",nl:"Geëeste mout"},{id:4,en:"Sour malt",nl:"Zuurmout"},{id:5,en:"Special",nl:"Speciale mout"},{id:6,en:"No malt",nl:"Geen mout"}],GrainTypeSource={localdata:GrainTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},GrainTypeAdapter=new $.jqx.dataAdapter(GrainTypeSource),AddedData=[{id:0,en:"Mash",nl:"Maischen"},{id:1,en:"Boil",nl:"Koken"},{id:2,en:"Fermentation",nl:"Vergisten"},{id:3,en:"Lagering",nl:"Nagisten/lageren"},{id:4,en:"Bottle",nl:"Bottelen"},{id:5,en:"Kegs",nl:"Fust"}],AddedSource={localdata:AddedData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AddedAdapter=new $.jqx.dataAdapter(AddedSource),HopTypeData=[{id:0,en:"Bittering",nl:"Bitterhop"},{id:1,en:"Aroma",nl:"Aromahop"},{id:2,en:"Both",nl:"Beide"}],HopTypeSource={localdata:HopTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopTypeAdapter=new $.jqx.dataAdapter(HopTypeSource),HopFormData=[{id:0,en:"Pellet",nl:"Pellets"},{id:1,en:"Plug",nl:"Plugs"},{id:2,en:"Leaf",nl:"Bloemen"},{id:3,en:"Leaf wet",nl:"Hop nat"},{id:4,en:"Cryo",nl:"Cryo"}],HopFormSource={localdata:HopFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopFormAdapter=new $.jqx.dataAdapter(HopFormSource),HopUseData=[{id:0,en:"Mash",nl:"Maischhop"},{id:1,en:"First wort",nl:"First wort"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Aroma",nl:"Vlamuit"},{id:4,en:"Whirlpool",nl:"Whirlpool"},{id:5,en:"Dry hop",nl:"Koudhop"}],HopUseSource={localdata:HopUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},HopUseAdapter=new $.jqx.dataAdapter(HopUseSource),YeastTypeData=[{id:0,en:"Lager",nl:"Ondergist"},{id:1,en:"Ale",nl:"Bovengist"},{id:2,en:"Wheat",nl:"Tarwegist"},{id:3,en:"Wine",nl:"Wijngist"},{id:4,en:"Champagne",nl:"Champagnegist"},{id:5,en:"Brett",nl:"Brett"},{id:6,en:"Kveik",nl:"Kveik"},{id:7,en:"Hybrid",nl:"Hybride"}],YeastTypeSource={localdata:YeastTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},YeastTypeAdapter=new $.jqx.dataAdapter(YeastTypeSource),YeastFormData=[{id:0,en:"Liquid",nl:"Vloeibaar",cells:100000000000},{id:1,en:"Dry",nl:"Droog",cells:15000000000},{id:2,en:"Slant",nl:"Schuine buis",cells:1700000000},{id:3,en:"Culture",nl:"Slurry",cells:1700000000},{id:4,en:"Frozen",nl:"Ingevroren",cells:1700000000},{id:5,en:"Bottle",nl:"Depot",cells:1700000000},{id:6,en:"Dried",nl:"Gedroogd",cells:9000000000}],YeastFormSource={localdata:YeastFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastFormAdapter=new $.jqx.dataAdapter(YeastFormSource),YeastUseData=[{id:0,en:"Primary",nl:"Hoofdgisting"},{id:1,en:"Secondary",nl:"Nagisting"},{id:2,en:"Tertiary",nl:"Lagering"},{id:3,en:"Bottle",nl:"Bottelen"}],YeastUseSource={localdata:YeastUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]},YeastUseAdapter=new $.jqx.dataAdapter(YeastUseSource),FlocculationData=[{id:0,en:"Low",nl:"Laag"},{id:1,en:"Medium",nl:"Medium"},{id:2,en:"High",nl:"Hoog"},{id:3,en:"Very high",nl:"Zeer hoog"}],FlocculationSource={localdata:FlocculationData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},FlocculationAdapter=new $.jqx.dataAdapter(FlocculationSource),ZymocideData=[{id:0,en:"None",nl:"Niet"},{id:1,en:"K1",nl:"K1"},{id:2,en:"K2",nl:"K2"},{id:3,en:"K28",nl:"K28"},{id:4,en:"Klus",nl:"Klus"}],ZymocideSource={localdata:ZymocideData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ZymocideAdapter=new $.jqx.dataAdapter(ZymocideSource),StarterTypeData=[{id:0,en:"Stirred",nl:"Geroerd"},{id:1,en:"Shaken",nl:"Geschud"},{id:2,en:"Simple",nl:"Simpel"}],StarterTypeSource={localdata:StarterTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StarterTypeAdapter=new $.jqx.dataAdapter(StarterTypeSource),MiscTypeData=[{id:0,en:"Spice",nl:"Specerij"},{id:1,en:"Herb",nl:"Kruid"},{id:2,en:"Flavor",nl:"Smaakstof"},{id:3,en:"Fining",nl:"Klaringsmiddel"},{id:4,en:"Water agent",nl:"Brouwzout"},{id:5,en:"Yeast nutrient",nl:"Gistvoeding"},{id:6,en:"Other",nl:"Anders"}],MiscTypeSource={localdata:MiscTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscTypeAdapter=new $.jqx.dataAdapter(MiscTypeSource),MiscUseData=[{id:0,en:"Starter",nl:"Starter"},{id:1,en:"Mash",nl:"Maischen"},{id:2,en:"Boil",nl:"Koken"},{id:3,en:"Primary",nl:"Hoofdvergisting"},{id:4,en:"Secondary",nl:"Nagisting/lagering"},{id:5,en:"Bottling",nl:"Bottelen"}],MiscUseSource={localdata:MiscUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MiscUseAdapter=new $.jqx.dataAdapter(MiscUseSource),StyleTypeData=[{id:0,en:"Lager",nl:"Ondergistend bier"},{id:1,en:"Ale",nl:"Bovengistend bier"},{id:2,en:"Mead",nl:"Mede"},{id:3,en:"Wheat",nl:"Tarwebier"},{id:4,en:"Mixed",nl:"Gemengd"},{id:5,en:"Cider",nl:"Cider"}],StyleTypeSource={localdata:StyleTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},StyleTypeAdapter=new $.jqx.dataAdapter(StyleTypeSource),MashStepTypeData=[{id:0,en:"Infusion",nl:"Infusie"},{id:1,en:"Temperature",nl:"Verwarming"},{id:2,en:"Decoction",nl:"Decoctie"}],MashStepTypeSource={localdata:MashStepTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},MashStepTypeAdapter=new $.jqx.dataAdapter(MashStepTypeSource),RecipeTypeData=[{id:0,en:"Extract",nl:"Extract"},{id:1,en:"Partial Mash",nl:"Deelmaisch"},{id:2,en:"All Grain",nl:"Mout"}],RecipeTypeSource={localdata:RecipeTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},RecipeTypeAdapter=new $.jqx.dataAdapter(RecipeTypeSource),IBUmethodData=[{id:0,en:"Tinseth",nl:"Tinseth"},{id:1,en:"Rager",nl:"Rager"},{id:2,en:"Daniels",nl:"Daniels"}],IBUmethodSource={localdata:IBUmethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},IBUmethodAdapter=new $.jqx.dataAdapter(IBUmethodSource),ColorMethodData=[{id:0,en:"Morey",nl:"Morey"},{id:1,en:"Mosher",nl:"Mosher"},{id:2,en:"Daniels",nl:"Daniels"},{id:3,en:"Halberstadt",nl:"Halberstadt"},{id:4,en:"Naudts",nl:"Naudts"}],ColorMethodSource={localdata:ColorMethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},ColorMethodAdapter=new $.jqx.dataAdapter(ColorMethodSource),CoolingTypeData=[{id:0,en:"-",nl:"-"},{id:1,en:"Emersion chiller",nl:"Dompelkoeler"},{id:2,en:"Counterflow chiller",nl:"Tegenstroomkoeler"},{id:3,en:"Au bain marie",nl:"Au bain marie"},{id:4,en:"Natural",nl:"Laten afkoelen"}],CoolingTypeSource={localdata:CoolingTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},CoolingTypeAdapter=new $.jqx.dataAdapter(CoolingTypeSource),AerationTypeData=[{id:0,en:"None",nl:"Geen"},{id:1,en:"Air",nl:"Lucht"},{id:2,en:"Oxygen",nl:"Zuurstof"}],AerationTypeSource={localdata:AerationTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AerationTypeAdapter=new $.jqx.dataAdapter(AerationTypeSource),AcidTypeData=[{id:0,en:"Lactic",nl:"Melkzuur"},{id:1,en:"Hydrochloric",nl:"Zoutzuur"},{id:2,en:"Phosphoric",nl:"Fosforzuur"},{id:3,en:"Sulfuric",nl:"Zwavelzuur"}],AcidTypeSource={localdata:AcidTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},AcidTypeAdapter=new $.jqx.dataAdapter(AcidTypeSource),BaseTypeData=[{id:0,en:"Sodiumbicarbonate",nl:"NaHCO3"},{id:1,en:"Sodiumcarbonate",nl:"Na2CO3"},{id:2,en:"Calciumcarbonate",nl:"CaCO3"},{id:3,en:"Calciumhydroxide",nl:"Ca(OH)2"}],BaseTypeSource={localdata:BaseTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},BaseTypeAdapter=new $.jqx.dataAdapter(BaseTypeSource),SpargeSourceData=[{id:0,en:"Source 1",nl:"Bron 1"},{id:1,en:"Source 2",nl:"Bron 2"},{id:2,en:"Mixed",nl:"Gemengd"}],SpargeSourceSource={localdata:SpargeSourceData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]},SpargeSourceAdapter=new $.jqx.dataAdapter(SpargeSourceSource),Show1wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:1,readOnly:true},Show2wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:2,readOnly:true},Show3wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:3,readOnly:true},Smal0dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true},Smal1dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true},Show0dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:0},Show1dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:1},Show2dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:2},Show3dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:3},SGopts={inputMode:"simple",theme:theme,width:110,height:23,min:0.99,max:1.199,decimalDigits:3,spinButtons:true},Spin1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:1,spinButtons:true},Spin2dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:2,spinButtons:true},Spin3dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:3,spinButtons:true},SpinpH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:1,spinButtons:true},Spin2pH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:2,spinButtons:true},YeastT={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:50,decimalDigits:1,spinButtons:true},PosInt={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:0,spinButtons:true},Perc1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:1,spinButtons:true},Perc0={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:0,spinButtons:true},Dateopts={theme:theme,width:150,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd",enableBrowserBoundsDetection:true},DateTimeopts={theme:theme,width:230,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd HH:mm:ss",enableBrowserBoundsDetection:true,showTimeButton:true},sugardensity=1.611,stylesSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"category",type:"string"},{name:"category_number",type:"number"},{name:"style_letter",type:"string"},{name:"style_guide",type:"string"},{name:"type",type:"int"},{name:"og_min",type:"float"},{name:"og_max",type:"float"},{name:"fg_min",type:"float"},{name:"fg_max",type:"float"},{name:"ibu_min",type:"float"},{name:"ibu_max",type:"float"},{name:"color_min",type:"float"},{name:"color_max",type:"float"},{name:"carb_min",type:"float"},{name:"carb_max",type:"float"},{name:"abv_min",type:"float"},{name:"abv_max",type:"float"},{name:"notes",type:"string"},{name:"profile",type:"string"},{name:"ingredients",type:"string"},{name:"examples",type:"string"}],url:"includes/db_profile_styles.php"},styleslist=new $.jqx.dataAdapter(stylesSource),equipmentSource={datatype:"json",datafields:[{name:"name",type:"string"},{name:"boil_size",type:"float"},{name:"batch_size",type:"float"},{name:"tun_volume",type:"float"},{name:"tun_weight",type:"float"},{name:"tun_specific_heat",type:"float"},{name:"tun_material",type:"int"},{name:"tun_height",type:"float"},{name:"top_up_water",type:"float"},{name:"trub_chiller_loss",type:"float"},{name:"evap_rate",type:"float"},{name:"boil_time",type:"float"},{name:"calc_boil_volume",type:"int"},{name:"top_up_kettle",type:"float"},{name:"hop_utilization",type:"float"},{name:"notes",type:"string"},{name:"lauter_volume",type:"float"},{name:"lauter_height",type:"float"},{name:"lauter_deadspace",type:"float"},{name:"kettle_volume",type:"float"},{name:"kettle_height",type:"float"},{name:"mash_volume",type:"float"},{name:"mash_max",type:"float"},{name:"efficiency",type:"float"}],url:"includes/db_inventory_equipments.php"},equipmentlist=new $.jqx.dataAdapter(equipmentSource),fermentableInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"graintype",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],url:"getfermentablesources.php"},fermentableinstock=false,fermentablelist=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.inventory||!fermentableinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),fermentablesugars=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.type==1||d.type==3){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),hopInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"origin",type:"string"},{name:"type",type:"int"},{name:"alpha",type:"float"},{name:"beta",type:"float"},{name:"humulene",type:"float"},{name:"caryophyllene",type:"float"},{name:"cohumulone",type:"float"},{name:"myrcene",type:"float"},{name:"hsi",type:"float"},{name:"useat",type:"int"},{name:"form",type:"int"},{name:"total_oil",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],url:"gethopsources.php"},hopinstock=false,hoplist=new $.jqx.dataAdapter(hopInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.inventory||!hopinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),miscInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"use_use",type:"int"},{name:"amount_is_weight",type:"int"},{name:"time",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],url:"getmiscsources.php"},miscinstock=false,misclist=new $.jqx.dataAdapter(miscInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.inventory||!miscinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),yeastInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"form",type:"int"},{name:"laboratory",type:"string"},{name:"product_id",type:"string"},{name:"min_temperature",type:"float"},{name:"max_temperature",type:"float"},{name:"flocculation",type:"int"},{name:"attenuation",type:"float"},{name:"cells",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"tolerance",type:"float"}],url:"getyeastsources.php"},yeastinstock=false,yeastlist=new $.jqx.dataAdapter(yeastInvSource,{beforeLoadComplete:function(a){var d,b,c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.inventory||!yeastinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),waterInvSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"unlimited_stock",type:"int"},{name:"calcium",type:"float"},{name:"sulfate",type:"float"},{name:"chloride",type:"float"},{name:"sodium",type:"float"},{name:"magnesium",type:"float"},{name:"ph",type:"float"},{name:"total_alkalinity",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"},],url:"getwatersources.php"},waterinstock=false,waterlist=new $.jqx.dataAdapter(waterInvSource,{beforeLoadComplete:function(a){var c,b,d;c=new Array();for(b=0;b<a.length;b++){d=a[b];if(d.inventory||d.unlimited_stock||!waterinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},}),waterProfileSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"calcium",type:"float"},{name:"bicarbonate",type:"float"},{name:"sulfate",type:"float"},{name:"chloride",type:"float"},{name:"sodium",type:"float"},{name:"magnesium",type:"float"},{name:"ph",type:"float"},{name:"total_alkalinity",type:"float"},],url:"includes/db_profile_water.php"},waterprofiles=new $.jqx.dataAdapter(waterProfileSource),mashProfileSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"steps",type:"array"}],url:"includes/db_profile_mash.php"},mashlist=new $.jqx.dataAdapter(mashProfileSource),K1s=0.384,K1a=-0.177,K1e=0.241,K1g=0.247,Ks=0.1415,Ka1=0.058,Ka2=0.078,Ke=0.174,Kg=0.109;function A(e,d,b,g,f){var c,a;c=d*1000;a=e/c+(b/c)*Ka1/Ks+(b/c)*(b/c)*Ka2/Ks+g/c*Ke/Ks+f/c*Kg/Ks;console.log("A("+e+","+d+","+b+","+g+","+f+"):"+a);return a}function B(d,c,a,f,e){var b,g;b=c*1000;g=d/b+(a/b)*K1a/K1s+f/b*K1e/K1s+e/b*K1g/K1s;console.log("B("+d+","+c+","+a+","+f+","+e+"):"+g);return g}$(document).ready(function(){$("#jqxMenu").jqxMenu({width:1280,height:"30px",autoOpen:false,clickToOpen:true,theme:theme});$("#jqxWidget").css("visibility","visible")});function Round(e,c){for(var b=0,a=1;b<c;b++,a*=10){}return Math.round(e*a)/a}function ebc_to_srm(a){var b=-1.32303e-12*Math.pow(a,4)-2.91515e-9*Math.pow(a,3)+0.00000818515*Math.pow(a,2)+0.372038*a+0.596351;if(b<0){b=0}return b}function srm_to_ebc(b){var a=Math.round(1.76506e-10*Math.pow(b,4)+1.54529e-7*Math.pow(b,3)-0.000159428*Math.pow(b,2)+2.68837*b-1.6004);if(a<0){a=0}return a}function get_kt(a){var b=1;if(a<3){b=3.5}else{if(a<6){b=3}else{if(a<8){b=2.75}else{if(a<10){b=2.5}else{if(a<20){b=1.8}else{if(a<30){b=1.6}else{if(a<60){b=1.3}else{if(a<100){b=1.2}else{if(a<300){b=1.1}}}}}}}}}return b}function abvol(c,a){if(((c-a)<0)||(a<0.9)){return 0}var b=c*3157*Math.pow(10,-5)+9.716*Math.pow(10,-2);return(c*1000-a*1000)*b}function kw_to_srm(a,b){if(a==0){return 1.4922*Math.pow(b,0.6859)}if(a==1){return 0.3*b+4.7}if(a==2){return 0.2*b+8.4}return 0}function kw_to_ebc(a,b){return srm_to_ebc(kw_to_srm(a,b))}function toIBU(a,h,r,q,s,e,m,c){var g,n,f,o,i,j=1,k=1,v=0,b,u,l,d,t,p;g=parseFloat(r);n=parseFloat(q);f=parseFloat(m)/100;o=parseFloat(s)*1000;i=parseFloat(e);if((a==3)||(a==4)||(a==5)){j=0}else{if(a==0){j+=my_factor_mashhop/100}else{if(a==1){j+=my_factor_fwh/100}}}if(h==0){k+=my_factor_pellet/100}else{if(h==1){k+=my_factor_plug/100}else{if(h==3){k+=my_factor_wethop/100}else{if(h==4){k+=my_factor_cryohop/100}}}}if(c==0){l=(f*o*1000)/n;d=1.65*Math.pow(0.000125,g-1);t=((1-Math.exp(-0.04*i))/4.15);p=d*t;v=Round(p*l*j*k,1)}if(c==2){if(h==2){b=-(0.0041*i*i)+(0.6162*i)+1.5779}else{b=-(0.0051*i*i)+(0.7835*i)+1.9348}if(g<1050){u=0}else{u=(g-1050)/200}v=Round(j*((o*(f*100)*b*0.1)/(n*(1+u))),1)}if(c==1){b=j*18.11+13.86*Math.tanh((i*31.32)/18.27);if(g<1050){u=0}else{u=(g-1050)/200}v=Round((o*(f*100)*b*0.1)/(n*(1+u)),1)}return v}function ebc_to_color(a){return srm_to_color(ebc_to_srm(a))}function srm_to_color(g){var c,e,d,f,b,a;c=Math.round(g*10);if(c<0){c=0}if(c>299){c=299}e=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,200,199,199,198,198,197,197,196,196,195,195,194,194,193,193,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8];d=[250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,249,248,247,246,245,244,242,240,238,236,234,232,230,228,226,224,222,220,218,216,214,212,210,208,206,204,202,200,198,196,194,192,190,188,186,184,182,180,178,176,174,172,170,168,166,164,162,160,158,156,154,152,150,148,146,144,142,141,140,139,139,138,137,136,136,135,134,133,133,132,131,130,130,129,128,127,127,126,125,124,124,123,122,121,121,120,119,118,118,117,116,115,115,114,113,112,112,111,110,109,109,108,107,106,106,105,104,103,103,102,101,100,100,99,98,97,97,96,95,94,94,93,92,91,91,90,89,88,88,87,86,85,85,84,83,82,82,81,80,79,78,77,76,75,75,74,73,72,72,71,70,69,69,68,67,66,66,65,64,63,63,62,61,60,60,59,58,57,57,56,55,54,54,53,52,51,51,50,49,48,48,47,46,45,45,44,43,42,42,41,40,39,39,38,37,36,36,35,34,33,33,32,31,30,30,29,28,27,27,26,25,24,24,23,22,22,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,16,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3];f=[210,204,199,193,188,182,177,171,166,160,155,149,144,138,133,127,122,116,111,105,100,94,89,83,78,72,67,61,56,50,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,55,55,55,55,54,54,54,54,53,53,53,53,52,52,52,52,51,51,51,51,50,50,50,50,49,49,48,47,47,46,45,45,44,43,43,42,41,41,40,39,39,38,37,37,36,35,34,33,32,31,29,28,27,26,25,24,23,21,20,19,18,17,16,15,13,12,11,10,9,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,21,21,21,20,20,20,19,19,19,18,18,18,17,17,17,17,16,16,15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,10,10,9,9,9,8,8,8,7,7,7,6,6,6,5,5,5,4,4,4,3,3,3,2,2,2];b=e[c]*65536+d[c]*256+f[c];a=b.toString(16).toUpperCase();if(a.length<6){a="0"+a}return"#"+a}function sg_to_plato(a){return((135.997*a-630.272)*a+1111.14)*a-616.868}function plato_to_sg(a){return 1+(a/(258.6-((a/258.2)*227.1)))}function brix_to_sg(a){if(my_brix_correction>0){return plato_to_sg(a/my_brix_correction)}else{return plato_to_sg(a)}}function sg_to_brix(a){return sg_to_plato(a)*my_brix_correction}function estimate_sg(c,e){var a,d,b;a=100*c/e;d=plato_to_sg(a);for(b=0;b<20;b++){if(d>0){a=100*c/(e*d)}d=plato_to_sg(a)}return Round(d,4)}function estimate_fg(f,i,e,h,c,g,j){var b,d,a;if(f>40){f=0}if(i>50){i=0}if((e>0)&&(h>0)){b=e;if(b<2){b=2}if(b>5.5){b=5.5}if(c<60){c=60}if(c>72){c=72}}else{b=3.5;c=67;h=75}if(g<30){g=77}d=0.00825*g+0.00817*b-0.00684*c+0.00026*h-0.00356*i+0.00553*f+0.547;a=Round(1+(1-d)*(j-1),4);return a}function CalcFrac(f,e,d,b){var g,a,i,k,h,c,j;g=Math.pow(10,f-e);a=Math.pow(10,f-d);i=Math.pow(10,f-b);k=1/(1+g+g*a+g*a*i);h=g*k;c=g*a*k;j=g*a*i*k;return h+2*c+3*j}function lintner_to_kolbach(a){return(3.5*a)-16}function kolbach_to_lintner(a){return(a+16)/3.5};
\ No newline at end of file
--- a/www/js/import_ingredients-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a="";if(my_select=="fermentables"){a="upl_fermentables.php"}else{if(my_select=="hops"){a="upl_hops.php"}else{if(my_select=="miscs"){a="upl_miscs.php"}else{if(my_select=="yeasts"){a="upl_yeasts.php"}else{if(my_select=="styles"){a="upl_styles.php"}}}}}$("#jqxFileUpload").jqxFileUpload({width:300,browseTemplate:"success",cancelTemplate:"inverse",uploadTemplate:"primary",theme:theme,multipleFilesUpload:false,accept:"application/xml",uploadUrl:a,fileInputName:"fileToUpload"});$("#eventsPanel").jqxPanel({width:800,height:200,theme:theme});$("#jqxFileUpload").on("select",function(d){var c=d.args,e=c.file,b=c.size;$("#eventsPanel").jqxPanel("clearcontent");$("#eventsPanel").jqxPanel("append","<strong>"+d.type+":</strong> "+e+"  size: "+b+"<br />")});$("#jqxFileUpload").on("uploadEnd",function(d){var c=d.args,e=c.file,b=c.response;$("#eventsPanel").jqxPanel("append","<strong>"+d.type+":</strong> ontvangen "+e+"<br />"+b+"<br />")})});
\ No newline at end of file
--- a/www/js/inv_equipments-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function c(){var j=$("#calc_boil_volume").val(),k=parseFloat($("#boil_size").jqxNumberInput("decimal")),l=parseFloat($("#evap_rate").jqxNumberInput("decimal")),g=parseFloat($("#boil_time").jqxNumberInput("decimal")),h=parseFloat($("#top_up_kettle").jqxNumberInput("decimal")),i;if(j){i=k-(l*g/60)+h;$("#batch_size").val(i)}}$("#name").jqxTooltip({content:"The unique name of this brew equipment."});$("#notes").jqxTooltip({content:"Some notes about the equipment."});$("#tun_volume").jqxTooltip({content:"Mash TUN volume."});$("#tun_height").jqxTooltip({content:"Mash TUN height in cm."});$("#tun_weight").jqxTooltip({content:"Mash TUN weight in Kg."});$("#tun_material").jqxTooltip({content:"Mash TUN material. Needed to calculate the right strike temperature."});$("#mash_volume").jqxTooltip({content:"Liters maisch water voor de eerste maisch stap."});$("#mash_max").jqxTooltip({content:"Maximale moutstort voor deze installatie in Kg."});$("#lauter_volume").jqxTooltip({content:"Total lauter volume."});$("#lauter_height").jqxTooltip({content:"Height of the lauter TUN in cm."});$("#lauter_deadspace").jqxTooltip({content:"Volume loss in the lauter TUN."});$("#efficiency").jqxTooltip({content:"Average efficiency."});$("#kettle_volume").jqxTooltip({content:"Boil kettle volume in liters."});$("#kettle_height").jqxTooltip({content:"Boil kettle height in cm."});$("#boil_size").jqxTooltip({content:"Normal boil volume in liters"});$("#evap_rate").jqxTooltip({content:"Evaporation in liters per hour."});$("#boil_time").jqxTooltip({content:"Normal boil time in minutes."});$("#top_up_kettle").jqxTooltip({content:"Extra water added to the boil."});$("#hop_utilization").jqxTooltip({content:"100% for smaller installations, higher for large breweries."});$("#batch_size").jqxTooltip({content:"Calculated batch size, liters at end of the boil."});$("#trub_chiller_loss").jqxTooltip({content:"Standard loss in liters during transfer to the fermenter."});var b={},a="includes/db_inventory_equipments.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"boil_size",type:"float"},{name:"batch_size",type:"float"},{name:"tun_volume",type:"float"},{name:"tun_weight",type:"float"},{name:"tun_specific_heat",type:"float"},{name:"tun_material",type:"int"},{name:"tun_height",type:"float"},{name:"top_up_water",type:"float"},{name:"trub_chiller_loss",type:"float"},{name:"evap_rate",type:"float"},{name:"boil_time",type:"float"},{name:"calc_boil_volume",type:"int"},{name:"top_up_kettle",type:"float"},{name:"hop_utilization",type:"float"},{name:"notes",type:"string"},{name:"lauter_volume",type:"float"},{name:"lauter_height",type:"float"},{name:"lauter_deadspace",type:"float"},{name:"kettle_volume",type:"float"},{name:"kettle_height",type:"float"},{name:"mash_volume",type:"float"},{name:"mash_max",type:"float"},{name:"efficiency",type:"float"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),d=-1;$("#name").jqxInput({theme:theme,width:250,height:23});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#boil_size").jqxNumberInput(Spin1dec);$("#batch_size").jqxNumberInput(Spin2dec);$("#batch_size").jqxNumberInput({spinButtonsStep:0.5});$("#tun_volume").jqxNumberInput(Spin1dec);$("#tun_weight").jqxNumberInput(Spin2dec);$("#tun_specific_heat").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:70,height:23,decimalDigits:3});$("#tun_material").jqxDropDownList({theme:theme,source:MaterialAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#tun_height").jqxNumberInput(Spin1dec);$("#top_up_water").jqxNumberInput(Spin1dec);$("#trub_chiller_loss").jqxNumberInput(Spin1dec);$("#evap_rate").jqxNumberInput(Spin2dec);$("#boil_time").jqxNumberInput(PosInt);$("#boil_time").jqxNumberInput({max:1440});$("#calc_boil_volume").jqxCheckBox({theme:theme,width:120,height:23});$("#calc_boil_volume").on("checked",function(g){$("#batch_size").jqxNumberInput({readOnly:true,width:90,spinButtons:false})});$("#calc_boil_volume").on("unchecked",function(g){$("#batch_size").jqxNumberInput({readOnly:false,width:110,spinButtons:true})});$("#top_up_kettle").jqxNumberInput(Spin1dec);$("#hop_utilization").jqxNumberInput(Perc0);$("#hop_utilization").jqxNumberInput({Max:200});$("#lauter_volume").jqxNumberInput(Spin1dec);$("#lauter_height").jqxNumberInput(Spin1dec);$("#lauter_deadspace").jqxNumberInput(Spin1dec);$("#kettle_volume").jqxNumberInput(Spin1dec);$("#kettle_height").jqxNumberInput(Spin1dec);$("#mash_volume").jqxNumberInput(Spin1dec);$("#mash_max").jqxNumberInput(Spin1dec);$("#efficiency").jqxNumberInput(Perc1dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var h,g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");h=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");g.append(h);i.append(g);h.jqxButton({theme:theme,width:90,height:20});h.click(function(j){d=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuwe brouwset");$("#boil_size").val(18);$("#batch_size").val(15.3);$("#tun_volume").val(20);$("#tun_weight").val(2);$("#tun_specific_heat").val(0.11);$("#tun_material").val(0);$("#tun_height").val(20);$("#top_up_water").val(0);$("#trub_chiller_loss").val(0.5);$("#evap_rate").val(1.8);$("#boil_time").val(90);$("#calc_boil_volume").val(1);$("#top_up_kettle").val(0);$("#hop_utilization").val(100);$("#notes").val("");$("#lauter_volume").val(20);$("#lauter_height").val(20);$("#lauter_deadspace").val(0.5);$("#kettle_volume").val(20);$("#kettle_height").val(20);$("#mash_volume").val(18);$("#mash_max").val(6);$("#efficiency").val(75);$("#popupWindow").jqxWindow("open")})},filterable:false,ready:function(){$("#boil_size").on("change",function(g){c()});$("#evap_rate").on("change",function(g){c()});$("#boil_time").on("change",function(g){c()});$("#top_up_kettle").on("change",function(g){c()});$("#calc_boil_volume").on("change",function(g){c()});$("#tun_material").on("change",function(g){b.tun_specific_heat=MaterialData[g.args.index].sh;$("#tun_specific_heat").val(b.tun_specific_heat)})},columns:[{text:"Installatie naam",datafield:"name",width:200},{text:"Kook volume",datafield:"boil_size",width:110,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Batch volume",datafield:"batch_size",width:110,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Opmerkingen",datafield:"notes"},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){d=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",d);$("#name").val(b.name);$("#boil_size").val(b.boil_size);$("#batch_size").val(b.batch_size);$("#tun_volume").val(b.tun_volume);$("#tun_weight").val(b.tun_weight);$("#tun_specific_heat").val(b.tun_specific_heat);$("#tun_material").val(b.tun_material);$("#tun_height").val(b.tun_height);$("#top_up_water").val(b.top_up_water);$("#trub_chiller_loss").val(b.trub_chiller_loss);$("#evap_rate").val(b.evap_rate);$("#boil_time").val(b.boil_time);$("#calc_boil_volume").val(b.calc_boil_volume);$("#top_up_kettle").val(b.top_up_kettle);$("#hop_utilization").val(b.hop_utilization);$("#notes").val(b.notes);$("#lauter_volume").val(b.lauter_volume);$("#lauter_height").val(b.lauter_height);$("#lauter_deadspace").val(b.lauter_deadspace);$("#kettle_volume").val(b.kettle_volume);$("#kettle_height").val(b.kettle_height);$("#mash_volume").val(b.mash_volume);$("#mash_max").val(b.mash_max);$("#efficiency").val(b.efficiency);$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").jqxWindow({width:1050,height:600,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(d>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",d);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h,g=-1;if(d>=0){g=$("#jqxgrid").jqxGrid("getrowid",d)}h={record:g,name:$("#name").val(),boil_size:parseFloat($("#boil_size").jqxNumberInput("decimal")),batch_size:parseFloat($("#batch_size").jqxNumberInput("decimal")),tun_volume:parseFloat($("#tun_volume").jqxNumberInput("decimal")),tun_weight:parseFloat($("#tun_weight").jqxNumberInput("decimal")),tun_specific_heat:parseFloat($("#tun_specific_heat").jqxNumberInput("decimal")),tun_material:$("#tun_material").val(),tun_height:parseFloat($("#tun_height").jqxNumberInput("decimal")),top_up_water:parseFloat($("#top_up_water").jqxNumberInput("decimal")),trub_chiller_loss:parseFloat($("#trub_chiller_loss").jqxNumberInput("decimal")),evap_rate:parseFloat($("#evap_rate").jqxNumberInput("decimal")),boil_time:parseFloat($("#boil_time").jqxNumberInput("decimal")),calc_boil_volume:$("#calc_boil_volume").val(),top_up_kettle:parseFloat($("#top_up_kettle").jqxNumberInput("decimal")),hop_utilization:parseFloat($("#hop_utilization").jqxNumberInput("decimal")),notes:$("#notes").val(),lauter_volume:parseFloat($("#lauter_volume").jqxNumberInput("decimal")),lauter_height:parseFloat($("#lauter_height").jqxNumberInput("decimal")),lauter_deadspace:parseFloat($("#lauter_deadspace").jqxNumberInput("decimal")),kettle_volume:parseFloat($("#kettle_volume").jqxNumberInput("decimal")),kettle_height:parseFloat($("#kettle_height").jqxNumberInput("decimal")),mash_volume:parseFloat($("#mash_volume").jqxNumberInput("decimal")),mash_max:parseFloat($("#mash_max").jqxNumberInput("decimal")),efficiency:parseFloat($("#efficiency").jqxNumberInput("decimal"))};if(d>=0){$("#jqxgrid").jqxGrid("updaterow",g,h)}else{$("#jqxgrid").jqxGrid("addrow",null,h)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_fermentables-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(h,g){$("#totval").val(h*g)}var b={},a="includes/db_inventory_fermentables.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"string"},{name:"yield",type:"float"},{name:"color",type:"float"},{name:"add_after_boil",type:"int"},{name:"origin",type:"string"},{name:"supplier",type:"string"},{name:"notes",type:"string"},{name:"coarse_fine_diff",type:"float"},{name:"moisture",type:"float"},{name:"diastatic_power",type:"float"},{name:"protein",type:"float"},{name:"dissolved_protein",type:"float"},{name:"max_in_batch",type:"float"},{name:"recommend_mash",type:"int"},{name:"added",type:"string"},{name:"always_on_stock",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"graintype",type:"string"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#type").jqxDropDownList({theme:theme,source:FermentableTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#yield").jqxNumberInput(Spin1dec);$("#color").jqxNumberInput(Spin1dec);$("#add_after_boil").jqxCheckBox({theme:theme,width:120,height:23});$("#origin").jqxInput({theme:theme,width:250,height:23});$("#supplier").jqxInput({theme:theme,width:250,height:23});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#coarse_fine_diff").jqxNumberInput(Spin1dec);$("#moisture").jqxNumberInput(Spin1dec);$("#diastatic_power").jqxNumberInput(PosInt);$("#protein").jqxNumberInput(Spin1dec);$("#dissolved_protein").jqxNumberInput(Spin1dec);$("#max_in_batch").jqxNumberInput(Perc1dec);$("#recommend_mash").jqxCheckBox({theme:theme,width:120,height:23});$("#added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#always_on_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#di_ph").jqxNumberInput(Spin2pH);$("#acid_to_ph_57").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-1000,max:1000,decimalDigits:4,spinButtons:true});$("#graintype").jqxDropDownList({theme:theme,source:GrainTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#inventory").jqxNumberInput(Spin3dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");h=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");j=$("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuw product");$("#type").val("Mout");$("#origin").val("");$("#supplier").val("");$("#notes").val("");$("#yield").val(80);$("#color").val(3);$("#coarse_fine_diff").val(3);$("#moisture").val(4);$("#diastatic_power").val(0);$("#protein").val(0);$("#dissolved_protein").val(0);$("#max_in_batch").val(100);$("#recommend_mash").val(1);$("#always_on_stock").val(0);$("#di_ph").val(0);$("#acid_to_ph_57").val(0);$("#graintype").val("Basismout");$("#add_after_boil").val(0);$("#added").val("Maischen");$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=fermentables"})},filterable:true,filtermode:"excel",columns:[{text:"Herkomst",datafield:"origin",width:150},{text:"Producent",datafield:"supplier",width:140},{text:"Vergistbaar product",datafield:"name",menu:false},{text:"Soort",width:135,filtertype:"list",datafield:"type"},{text:"Graan type",datafield:"graintype",align:"center",cellsalign:"center",width:125},{text:"EBC",datafield:"color",width:60,align:"right",menu:false,cellsalign:"right"},{text:"Opbrengst",datafield:"yield",width:70,align:"right",menu:false,cellsalign:"right",cellsformat:"p1"},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if(l<1){i=f.formatNumber(l*1000,"f0")+" gr"}else{i=f.formatNumber(l,"f1")+" kg"}}return"<span style='margin: 3px; margin-top: 6px; float: right;'>"+i+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",menu:false,columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#type").val(b.type);$("#yield").val(b.yield);$("#color").val(b.color);$("#add_after_boil").val(b.add_after_boil);$("#origin").val(b.origin);$("#supplier").val(b.supplier);$("#notes").val(b.notes);$("#coarse_fine_diff").val(b.coarse_fine_diff);$("#moisture").val(b.moisture);$("#diastatic_power").val(lintner_to_kolbach(b.diastatic_power));$("#protein").val(b.protein);$("#dissolved_protein").val(b.dissolved_protein);$("#max_in_batch").val(b.max_in_batch);$("#recommend_mash").val(b.recommend_mash);$("#added").val(b.added);$("#always_on_stock").val(b.always_on_stock);$("#di_ph").val(b.di_ph);$("#acid_to_ph_57").val(b.acid_to_ph_57);$("#graintype").val(b.graintype);$("#inventory").val(b.inventory);$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);d(b.cost,b.inventory);$("#popupWindow").jqxWindow("open")}}]});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#inventory").on("change",function(g){b.inventory=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:""};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h,g=-1;if(c>=0){g=$("#jqxgrid").jqxGrid("getrowid",c)}h={record:g,name:$("#name").val(),type:$("#type").val(),yield:parseFloat($("#yield").jqxNumberInput("decimal")),color:parseFloat($("#color").jqxNumberInput("decimal")),add_after_boil:$("#add_after_boil").val(),origin:$("#origin").val(),supplier:$("#supplier").val(),notes:$("#notes").val(),coarse_fine_diff:parseFloat($("#coarse_fine_diff").jqxNumberInput("decimal")),moisture:parseFloat($("#moisture").jqxNumberInput("decimal")),diastatic_power:kolbach_to_lintner(parseFloat($("#diastatic_power").jqxNumberInput("decimal"))),protein:parseFloat($("#protein").jqxNumberInput("decimal")),dissolved_protein:parseFloat($("#dissolved_protein").jqxNumberInput("decimal")),max_in_batch:parseFloat($("#max_in_batch").jqxNumberInput("decimal")),recommend_mash:$("#recommend_mash").val(),added:$("#added").val(),always_on_stock:$("#always_on_stock").val(),di_ph:parseFloat($("#di_ph").jqxNumberInput("decimal")),acid_to_ph_57:parseFloat($("#acid_to_ph_57").jqxNumberInput("decimal")),graintype:$("#graintype").val(),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",g,h)}else{$("#jqxgrid").jqxGrid("addrow",null,h)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_hops-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(h,g){$("#totval").val(h*(g/1000))}var b={},a="includes/db_inventory_hops.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"alpha",type:"float"},{name:"beta",type:"float"},{name:"humulene",type:"float"},{name:"caryophyllene",type:"float"},{name:"cohumulone",type:"float"},{name:"myrcene",type:"float"},{name:"hsi",type:"float"},{name:"type",type:"string"},{name:"form",type:"string"},{name:"notes",type:"string"},{name:"origin",type:"string"},{name:"substitutes",type:"string"},{name:"always_on_stock",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"},{name:"total_oil",type:"float"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#alpha").jqxNumberInput(Perc1dec);$("#beta").jqxNumberInput(Perc1dec);$("#humulene").jqxNumberInput(Perc1dec);$("#caryophyllene").jqxNumberInput(Perc1dec);$("#cohumulone").jqxNumberInput(Perc1dec);$("#myrcene").jqxNumberInput(Perc1dec);$("#hsi").jqxNumberInput(Perc1dec);$("#type").jqxDropDownList({theme:theme,source:HopTypeAdapter,valueMember:"nl",displayMember:"nl",width:150,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:HopFormAdapter,valueMember:"nl",displayMember:"nl",width:150,height:23,autoDropDownHeight:true});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#origin").jqxInput({theme:theme,width:320,height:23});$("#substitutes").jqxInput({theme:theme,width:320,height:23});$("#always_on_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#inventory").jqxNumberInput(Spin1dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#total_oil").jqxNumberInput(Perc1dec);$("#totval").jqxNumberInput(Show2dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");h=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");j=$("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuwe hop");$("#alpha").val(0);$("#beta").val(0);$("#humulene").val(0);$("#caryophyllene").val(0);$("#cohumulone").val(0);$("#myrcene").val(0);$("#hsi").val(0);$("#type").val("Bitterhop");$("#form").val("Pellets");$("#notes").val("");$("#origin").val("");$("#substitutes").val("");$("#always_on_stock").val(0);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#total_oil").val(0);$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=hops"})},filterable:true,filtermode:"excel",columns:[{text:"Herkomst",datafield:"origin",width:150},{text:"Hop Naam",datafield:"name",menu:false},{text:"Soort",datafield:"type",align:"left",width:90},{text:"Vorm",datafield:"form",align:"left",width:90},{text:"Alpha %",datafield:"alpha",width:80,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"Beta %",datafield:"beta",width:80,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"Cohumuloon %%",datafield:"cohumulone",width:80,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"HSI",datafield:"hsi",width:60,align:"right",cellsalign:"right",menu:false,cellsformat:"f1"},{text:"Oogst datum",datafield:"production_date",align:"center",cellsalign:"center",menu:false,width:110},{text:"Voorraad",datafield:"inventory",width:100,align:"right",cellsalign:"right",menu:false,cellsformat:"f1",cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if(l<1000){i=f.formatNumber(l,"f1")+" gr"}else{i=f.formatNumber(l/1000,"f1")+" kg"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+i+"</span>"}},{text:"",datafield:"Wijzig",columntype:"button",width:100,align:"center",menu:false,cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#alpha").val(b.alpha);$("#beta").val(b.beta);$("#humulene").val(b.humulene);$("#caryophyllene").val(b.caryophyllene);$("#cohumulone").val(b.cohumulone);$("#myrcene").val(b.myrcene);$("#hsi").val(b.hsi);$("#type").val(b.type);$("#form").val(b.form);$("#notes").val(b.notes);$("#origin").val(b.origin);$("#substitutes").val(b.substitutes);$("#always_on_stock").val(b.always_on_stock);$("#inventory").val(b.inventory);$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);$("#total_oil").val(b.total_oil);d(b.cost,b.inventory);$("#popupWindow").jqxWindow("open")}}]});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#inventory").on("change",function(g){b.inventory=parseFloat(g.args.value);d(b.cost,b.inventory)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",alpha:parseFloat($("#alpha").jqxNumberInput("decimal")),beta:parseFloat($("#beta").jqxNumberInput("decimal")),humulene:parseFloat($("#humulene").jqxNumberInput("decimal")),caryophyllene:parseFloat($("#caryophyllene").jqxNumberInput("decimal")),cohumulone:parseFloat($("#cohumulone").jqxNumberInput("decimal")),myrcene:parseFloat($("#myrcene").jqxNumberInput("decimal")),hsi:parseFloat($("#hsi").jqxNumberInput("decimal")),type:$("#type").val(),form:$("#form").val(),notes:$("#notes").val(),origin:$("#origin").val(),substitutes:$("#substitutes").val(),always_on_stock:$("#always_on_stock").val(),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:"",total_oil:parseFloat($("#total_oil").jqxNumberInput("decimal"))};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h,g=-1;if(c>=0){g=$("#jqxgrid").jqxGrid("getrowid",c)}h={record:g,name:$("#name").val(),alpha:parseFloat($("#alpha").jqxNumberInput("decimal")),beta:parseFloat($("#beta").jqxNumberInput("decimal")),humulene:parseFloat($("#humulene").jqxNumberInput("decimal")),caryophyllene:parseFloat($("#caryophyllene").jqxNumberInput("decimal")),cohumulone:parseFloat($("#cohumulone").jqxNumberInput("decimal")),myrcene:parseFloat($("#myrcene").jqxNumberInput("decimal")),hsi:parseFloat($("#hsi").jqxNumberInput("decimal")),type:$("#type").val(),form:$("#form").val(),notes:$("#notes").val(),origin:$("#origin").val(),substitutes:$("#substitutes").val(),always_on_stock:$("#always_on_stock").val(),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),total_oil:parseFloat($("#total_oil").jqxNumberInput("decimal"))};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",g,h)}else{$("#jqxgrid").jqxGrid("addrow",null,h)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_miscs-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function e(i,h){$("#totval").val(i*(h/1000))}function a(h){if(h){$("#pmpt_cost").html("Prijs per kg:");$("#pmpt_inventory").html("Voorraad gram:")}else{$("#pmpt_cost").html("Prijs per liter:");$("#pmpt_inventory").html("Voorraad ml:")}}var c={},b="includes/db_inventory_miscs.php",f={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"string"},{name:"use_use",type:"string"},{name:"time",type:"int"},{name:"amount",type:"float"},{name:"amount_is_weight",type:"int"},{name:"use_for",type:"string"},{name:"notes",type:"string"},{name:"always_on_stock",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"}],id:"record",url:b,deleterow:function(h,j){var i="delete=true&"+$.param({record:h});$.ajax({dataType:"json",url:b,cache:false,data:i,type:"POST",success:function(l,k,m){j(true);location.reload(true)},error:function(k,m,l){j(false)}})},addrow:function(i,l,h,k){var j="insert=true&"+$.param(l);$.ajax({dataType:"json",url:b,cache:false,data:j,type:"POST",success:function(n,m,o){k(true);location.reload(true)},error:function(m,o,n){k(false)}})},updaterow:function(h,k,j){var i="update=true&"+$.param(k);$.ajax({dataType:"json",url:b,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})}},g=new $.jqx.dataAdapter(f),d=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#type").jqxDropDownList({theme:theme,source:MiscTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#use_use").jqxDropDownList({theme:theme,source:MiscUseAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#time").jqxNumberInput(PosInt);$("#amount_is_weight").jqxCheckBox({theme:theme,width:120,height:23});$("#use_for").jqxInput({theme:theme,width:640,height:48});$("#always_on_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#inventory").jqxNumberInput(Spin1dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:g,theme:theme,showstatusbar:true,renderstatusbar:function(j){var h,i,k;h=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");i=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");k=$("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");h.append(i);h.append(k);j.append(h);i.jqxButton({theme:theme,width:90,height:20});k.jqxButton({theme:theme,width:90,height:20});i.click(function(l){d=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("");$("#type").val("Specerij");$("#use_use").val("Starter");$("#time").val(0);$("#amount_is_weight").val(1);$("#use_for").val("");$("#notes").val("");$("#always_on_stock").val(0);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#popupWindow").jqxWindow("open")});k.click(function(l){window.location.href="import_ingredients.php?select=miscs"})},filterable:true,filtermode:"excel",columns:[{text:"Ingredient naam",datafield:"name",menu:false},{text:"Type",datafield:"type",align:"left",width:120},{text:"Gebruik",datafield:"use_use",align:"left",width:120},{text:"Tijd",datafield:"time",width:90,align:"left",menu:false,cellsrenderer:function(i,h,l,k,j,n){var m="";if(l>0){if(l==1){m="1 minuut"}else{if(l<60){m=g.formatNumber(l,"f0")+" minuten"}else{if(l==60){m="1 uur"}else{if(l<1440){m=g.formatNumber(l/60,"f0")+" uren"}else{if(l==1440){m="1 dag"}else{m=g.formatNumber(l/1440,"f0")+" dagen"}}}}}}return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+m+"</span>"}},{text:"Voorraad",datafield:"inventory",width:110,menu:false,align:"right",cellsrenderer:function(i,h,m,l,k,n){var j="";if(m>0){if(n.amount_is_weight){j=g.formatNumber(m,"f1")+" gr"}else{j=g.formatNumber(m,"f1")+" ml"}}return"<span style='margin: 3px; margin-top: 6px; float: right;'>"+j+"</span>"}},{text:"THT datum",datafield:"tht_date",width:100,menu:false,align:"center",cellsalign:"center"},{text:"",datafield:"Edit",columntype:"button",width:100,menu:false,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(h){d=h;$("#popupWindow").jqxWindow({position:{x:110,y:30}});c=$("#jqxgrid").jqxGrid("getrowdata",d);$("#name").val(c.name);$("#type").val(c.type);$("#use_use").val(c.use_use);$("#time").val(c.time);$("#amount_is_weight").val(c.amount_is_weight);$("#use_for").val(c.use_for);$("#notes").val(c.notes);$("#always_on_stock").val(c.always_on_stock);$("#inventory").val(c.inventory);$("#cost").val(c.cost);$("#production_date").val(c.production_date);$("#tht_date").val(c.tht_date);e(c.cost,c.inventory);a(c.amount_is_weight);$("#popupWindow").jqxWindow("open")}}]});$("#cost").on("change",function(h){c.cost=parseFloat(h.args.value);e(c.cost,c.inventory)});$("#inventory").on("change",function(h){c.inventory=parseFloat(h.args.value);e(c.cost,c.inventory)});$("#amount_is_weight").on("checked",function(h){c.amount_is_weight=true;a(true)});$("#amount_is_weight").on("unchecked",function(h){c.amount_is_weight=false;a(false)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(d>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var h=$("#jqxgrid").jqxGrid("getrowid",d);$("#jqxgrid").jqxGrid("deleterow",h)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var i,h=-1;if(d>=0){h=$("#jqxgrid").jqxGrid("getrowid",d)}i={record:h,name:$("#name").val(),type:$("#type").val(),use_use:$("#use_use").val(),time:parseFloat($("#time").jqxNumberInput("decimal")),amount_is_weight:$("#amount_is_weight").val(),use_for:$("#use_for").val(),notes:$("#notes").val(),always_on_stock:$("#always_on_stock").val(),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val()};if(d>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_suppliers-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){$("#name").jqxTooltip({content:"De naam van de leverancier."});$("#address").jqxTooltip({content:"Het adres en huisnummer."});$("#city").jqxTooltip({content:"De woonplaats of gemeente."});$("#zip").jqxTooltip({content:"De postcode."});$("#country").jqxTooltip({content:"Het land."});$("#website").jqxTooltip({content:"Het website adres."});$("#email").jqxTooltip({content:"Het email adres."});$("#phone").jqxTooltip({content:"Het telefoon nummer."});$("#notes").jqxTooltip({content:"Opmerkingen over deze leverancier."});var a="includes/db_inventory_suppliers.php",c={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"address",type:"string"},{name:"city",type:"string"},{name:"zip",type:"string"},{name:"country",type:"string"},{name:"website",type:"string"},{name:"email",type:"string"},{name:"phone",type:"string"},{name:"notes",type:"string"}],id:"record",url:a,deleterow:function(e,g){var f="delete=true&"+$.param({record:e});$.ajax({dataType:"json",url:a,cache:false,data:f,type:"POST",success:function(i,h,j){g(true);location.reload(true)},error:function(h,j,i){g(false)}})},addrow:function(f,i,e,h){var g="insert=true&"+$.param(i);$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(k,j,l){h(true);location.reload(true)},error:function(j,l,k){h(false)}})},updaterow:function(e,h,g){var f="update=true&"+$.param(h);$.ajax({dataType:"json",url:a,cache:false,data:f,type:"POST",success:function(j,i,k){g(true);location.reload(true)},error:function(i,k,j){g(false)}})}},d=new $.jqx.dataAdapter(c),b=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#address").jqxInput({theme:theme,width:350,height:23});$("#zip").jqxInput({theme:theme,width:120,height:23});$("#city").jqxInput({theme:theme,width:350,height:23});$("#country").jqxInput({theme:theme,width:250,height:23});$("#website").jqxInput({theme:theme,width:640,height:23});$("#email").jqxInput({theme:theme,width:640,height:23});$("#phone").jqxInput({theme:theme,width:175,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#jqxgrid").jqxGrid({width:1280,height:630,source:d,theme:theme,showstatusbar:true,renderstatusbar:function(g){var f,e=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");f=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");e.append(f);g.append(e);f.jqxButton({theme:theme,width:90,height:20});f.click(function(h){b=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuwe leverancier");$("#address").val("");$("#city").val("");$("#zip").val("");$("#country").val("Nederland");$("#website").val("");$("#email").val("");$("#phone").val("");$("#notes").val("");$("#popupWindow").jqxWindow("open")})},filterable:false,columns:[{text:"Leverancier naam",datafield:"name"},{text:"Adres",datafield:"address",width:300},{text:"Plaats",datafield:"city",width:250},{text:"Land",datafield:"country",width:200},{text:"Telefoon",datafield:"phone",width:175},{text:"Wijzig",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(f){b=f;$("#popupWindow").jqxWindow({position:{x:110,y:30}});var e=$("#jqxgrid").jqxGrid("getrowdata",b);$("#name").val(e.name);$("#address").val(e.address);$("#city").val(e.city);$("#zip").val(e.zip);$("#country").val(e.country);$("#website").val(e.website);$("#email").val(e.email);$("#phone").val(e.phone);$("#notes").val(e.notes);$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(b>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var e=$("#jqxgrid").jqxGrid("getrowid",b);$("#jqxgrid").jqxGrid("deleterow",e)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var f,e=-1;if(b>=0){e=$("#jqxgrid").jqxGrid("getrowid",b)}f={record:e,name:$("#name").val(),address:$("#address").val(),city:$("#city").val(),zip:$("#zip").val(),country:$("#country").val(),website:$("#website").val(),email:$("#email").val(),phone:$("#phone").val(),notes:$("#notes").val()};if(b>=0){$("#jqxgrid").jqxGrid("updaterow",e,f)}else{$("#jqxgrid").jqxGrid("addrow",null,f)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_waters-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){$("#name").jqxTooltip({content:"De unieke naam van dit brouwwater."});$("#notes").jqxTooltip({content:"Extra opmerkingen over dit water."});$("#unlimited_stock").jqxTooltip({content:"Onbeperkte voorraad zoals kraanwater en bronnen."});$("#calcium").jqxTooltip({content:"Calcium (Ca)."});$("#bicarbonate").jqxTooltip({content:"Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit."});$("#sulfate").jqxTooltip({content:"Calcium Sulfaat (CaSO4)."});$("#chloride").jqxTooltip({content:"Chloride (Cl)."});$("#sodium").jqxTooltip({content:"Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium."});$("#magnesium").jqxTooltip({content:"Magnesium (Mg)."});$("#ph").jqxTooltip({content:"De zuurgraad (pH)."});$("#total_alkalinity").jqxTooltip({content:"Totale alkaliniteit. Berekend meteen de Bicarbonaat."});$("#inventory").jqxTooltip({content:"Voorraad in liters."});$("#cost").jqxTooltip({content:"Kostprijs per liter. 5 cijfers achter de comma zodat het kraanwater er ook in kan."});var b={},a="includes/db_inventory_water.php",d={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"unlimited_stock",type:"int"},{name:"calcium",type:"float"},{name:"bicarbonate",type:"float"},{name:"sulfate",type:"float"},{name:"chloride",type:"float"},{name:"sodium",type:"float"},{name:"magnesium",type:"float"},{name:"ph",type:"float"},{name:"notes",type:"string"},{name:"total_alkalinity",type:"float"},{name:"inventory",type:"float"},{name:"cost",type:"float"}],id:"record",url:a,deleterow:function(f,h){var g="delete=true&"+$.param({record:f});$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(j,i,k){h(true);location.reload(true)},error:function(i,k,j){h(false)}})},addrow:function(g,j,f,i){var h="insert=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})},updaterow:function(f,i,h){var g="update=true&"+$.param(i);$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(k,j,l){h(true);location.reload(true)},error:function(j,l,k){h(false)}})}},e=new $.jqx.dataAdapter(d),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#notes").jqxInput({theme:theme,width:640,height:100});$("#unlimited_stock").jqxCheckBox({theme:theme,width:120,height:23});$("#calcium").jqxNumberInput(Spin1dec);$("#bicarbonate").jqxNumberInput(Spin1dec);$("#sulfate").jqxNumberInput(Spin1dec);$("#chloride").jqxNumberInput(Spin1dec);$("#sodium").jqxNumberInput(Spin1dec);$("#magnesium").jqxNumberInput(Spin1dec);$("#ph").jqxNumberInput(Spin2pH);$("#total_alkalinity").jqxNumberInput(Spin1dec);$("#inventory").jqxNumberInput(Spin1dec);$("#cost").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:5,spinButtons:true});$("#jqxgrid").jqxGrid({width:1280,height:630,source:e,theme:theme,showstatusbar:true,renderstatusbar:function(h){var g,f=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");g=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");f.append(g);h.append(f);g.jqxButton({theme:theme,width:90,height:20});g.click(function(i){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("Nieuw brouwwater");$("#unlimited_stock").val(0);$("#calcium").val(0);$("#bicarbonate").val(0);$("#sulfate").val(0);$("#chloride").val(0);$("#sodium").val(0);$("#magnesium").val(0);$("#ph").val(7);$("#notes").val("");$("#total_alkalinity").val(0);$("#inventory").val(0);$("#cost").val(0);$("#popupWindow").jqxWindow("open")})},filterable:false,columns:[{text:"Water leverancier",datafield:"name",width:225},{text:"Opmerkingen",datafield:"notes"},{text:"Onbeperkt",datafield:"unlimited_stock",columntype:"checkbox",width:80},{text:"Voorraad",datafield:"inventory",width:100,align:"right",cellsalign:"right",cellsformat:"f1",cellsrenderer:function(g,f,k,j,i,l){var h="";if(k>0&&l.unlimited_stock==0){h=e.formatNumber(k,"f1")+" L"}return"<span style='margin: 3px; margin-top: 6px; float: right;'>"+h+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(f){c=f;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#unlimited_stock").val(b.unlimited_stock);$("#calcium").val(b.calcium);$("#bicarbonate").val(b.bicarbonate);$("#sulfate").val(b.sulfate);$("#chloride").val(b.chloride);$("#sodium").val(b.sodium);$("#magnesium").val(b.magnesium);$("#ph").val(b.ph);$("#notes").val(b.notes);$("#total_alkalinity").val(b.total_alkalinity);$("#inventory").val(b.inventory);$("#cost").val(b.cost);$("#popupWindow").jqxWindow("open")}}]});$("#total_alkalinity").on("change",function(f){b.bicarbonate=parseFloat(f.args.value)*1.22;$("#bicarbonate").val(b.bicarbonate)});$("#bicarbonate").on("change",function(f){b.total_alkalinity=parseFloat(f.args.value)*50/61;$("#total_alkalinity").val(b.total_alkalinity)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var f=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",f)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,f=-1;if(c>=0){f=$("#jqxgrid").jqxGrid("getrowid",c)}g={record:f,name:$("#name").val(),unlimited_stock:$("#unlimited_stock").val(),calcium:parseFloat($("#calcium").jqxNumberInput("decimal")),bicarbonate:parseFloat($("#bicarbonate").jqxNumberInput("decimal")),sulfate:parseFloat($("#sulfate").jqxNumberInput("decimal")),chloride:parseFloat($("#chloride").jqxNumberInput("decimal")),sodium:parseFloat($("#sodium").jqxNumberInput("decimal")),magnesium:parseFloat($("#magnesium").jqxNumberInput("decimal")),ph:parseFloat($("#ph").jqxNumberInput("decimal")),notes:$("#notes").val(),total_alkalinity:parseFloat($("#total_alkalinity").jqxNumberInput("decimal")),inventory:parseFloat($("#inventory").jqxNumberInput("decimal")),cost:parseFloat($("#cost").jqxNumberInput("decimal"))};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",f,g)}else{$("#jqxgrid").jqxGrid("addrow",null,g)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/inv_yeasts-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){function d(){$("#totval").val(b.cost*b.inventory);if(b.form=="Vloeibaar"){$("#pmpt_cost").html("Prijs per pak:");$("#pmpt_inventory").html("Voorraad pak(ken):");$("#pmpt_cells").html("Miljard cellen per pak:");$("#inventory").jqxNumberInput({decimalDigits:0})}else{if(b.form=="Droog"||b.form=="Gedroogd"){$("#pmpt_cost").html("Prijs per kg:");$("#pmpt_inventory").html("Voorraad gram:");$("#pmpt_cells").html("Miljard cellen per gram:");$("#inventory").jqxNumberInput({decimalDigits:1})}else{$("#pmpt_cost").html("Prijs per liter:");$("#pmpt_inventory").html("Voorraad ml:");$("#pmpt_cells").html("Miljard cellen per ml:");$("#inventory").jqxNumberInput({decimalDigits:1})}}}var b={},a="includes/db_inventory_yeasts.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"string"},{name:"form",type:"string"},{name:"laboratory",type:"string"},{name:"product_id",type:"string"},{name:"min_temperature",type:"float"},{name:"max_temperature",type:"float"},{name:"flocculation",type:"int"},{name:"attenuation",type:"float"},{name:"notes",type:"string"},{name:"best_for",type:"string"},{name:"max_reuse",type:"int"},{name:"inventory",type:"float"},{name:"cost",type:"float"},{name:"production_date",type:"string"},{name:"tht_date",type:"string"},{name:"cells",type:"float"},{name:"tolerance",type:"float"},{name:"sta1",type:"int"},{name:"bacteria",type:"int"},{name:"harvest_top",type:"int"},{name:"harvest_time",type:"int"},{name:"pitch_temperature",type:"float"},{name:"pofpos",type:"int"},{name:"zymocide",type:"int"}],id:"record",url:a,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:a,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#laboratory").jqxInput({theme:theme,width:320,height:23});$("#product_id").jqxInput({theme:theme,width:320,height:23});$("#type").jqxDropDownList({theme:theme,source:YeastTypeAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:YeastFormAdapter,valueMember:"nl",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#notes").jqxInput({theme:theme,width:800,height:120});$("#best_for").jqxInput({theme:theme,width:320,height:100});$("#inventory").jqxNumberInput(Spin1dec);$("#production_date").jqxDateTimeInput(Dateopts);$("#min_temperature").jqxNumberInput(YeastT);$("#max_temperature").jqxNumberInput(YeastT);$("#flocculation").jqxDropDownList({theme:theme,source:FlocculationAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#attenuation").jqxNumberInput(Perc1dec);$("#max_reuse").jqxNumberInput(PosInt);$("#max_reuse").jqxNumberInput({max:10});$("#cost").jqxNumberInput(Spin2dec);$("#tht_date").jqxDateTimeInput(Dateopts);$("#totval").jqxNumberInput(Show2dec);$("#cells").jqxNumberInput(Spin1dec);$("#tolerance").jqxNumberInput(Perc1dec);$("#tolerance").jqxNumberInput({max:25});$("#sta1").jqxCheckBox({theme:theme,width:120,height:23});$("#sta1").on("checked",function(g){b.sta1=1});$("#sta1").on("unchecked",function(g){b.sta1=0});$("#bacteria").jqxCheckBox({theme:theme,width:120,height:23});$("#bacteria").on("checked",function(g){b.bacteria=1});$("#bacteria").on("unchecked",function(g){b.bacteria=0});$("#harvest_top").jqxCheckBox({theme:theme,width:120,height:23});$("#harvest_top").on("checked",function(g){b.harvest_top=1});$("#harvest_top").on("unchecked",function(g){b.harvest_top=0});$("#harvest_time").jqxNumberInput(PosInt);$("#pitch_temperature").jqxNumberInput(YeastT);$("#pofpos").jqxCheckBox({theme:theme,width:120,height:23});$("#pofpos").on("checked",function(g){b.pofpos=1});$("#pofpos").on("unchecked",function(g){b.pofpos=0});$("#zymocide").jqxDropDownList({theme:theme,source:ZymocideAdapter,valueMember:"id",displayMember:"nl",width:80,height:23,autoDropDownHeight:true});$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g,h,j;g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");h=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");j=$("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");g.append(h);g.append(j);i.append(g);h.jqxButton({theme:theme,width:90,height:20});j.jqxButton({theme:theme,width:90,height:20});h.click(function(k){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("");$("#laboratory").val("");$("#product_id").val("");$("#type").val("Bovengist");$("#form").val("Vloeibaar");$("#min_temperature").val(18);$("#max_temperature").val(22);$("#flocculation").val(0);$("#attenuation").val(77);$("#notes").val("");$("#best_for").val("");$("#max_reuse").val(10);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#cells").val(1);$("#tolerance").val(0);$("#sta1").val(0);$("#bacteria").val(0);$("#harvest_top").val(0);$("#harvest_time").val(0);$("#pitch_temperature").val(0);$("#pofpos").val(0);$("#zymocide").val(0);$("#popupWindow").jqxWindow("open")});j.click(function(k){window.location.href="import_ingredients.php?select=yeasts"})},filterable:true,filtermode:"excel",columns:[{text:"Laboratorium",datafield:"laboratory",width:150},{text:"Product ID",datafield:"product_id",width:120,menu:false},{text:"Gist naam",datafield:"name",menu:false},{text:"Type",datafield:"type",align:"center",cellsalign:"center",width:110},{text:"Vorm",datafield:"form",align:"center",cellsalign:"center",width:110},{text:"SVG",datafield:"attenuation",width:70,align:"right",cellsalign:"right",menu:false,cellsformat:"p1"},{text:"Tol%",datafield:"tolerance",width:60,align:"right",cellsalign:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){i=f.formatNumber(l,"p0")}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+i+"</span>"}},{text:"Voorraad",datafield:"inventory",width:100,align:"right",menu:false,cellsrenderer:function(h,g,l,k,j,m){var i="";if(l>0){if((m.form=="Vloeibaar")&&(l>1)){i=f.formatNumber(l,"f0")+" pakken"}else{if(m.form=="Vloeibaar"){i=f.formatNumber(l,"f0")+" pak"}else{if(m.form=="Droog"||m.form=="Gedroogd"){i=f.formatNumber(l*1000,"f1")+" gram"}else{i=f.formatNumber(l*1000,"f1")+" ml"}}}}return"<span style='margin: 3px; margin-top: 6px; float: right;'>"+i+"</span>"}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",menu:false,cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:15}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#laboratory").val(b.laboratory);$("#product_id").val(b.product_id);$("#type").val(b.type);$("#form").val(b.form);$("#min_temperature").val(parseFloat(b.min_temperature));$("#max_temperature").val(parseFloat(b.max_temperature));$("#flocculation").val(b.flocculation);$("#attenuation").val(b.attenuation);$("#notes").val(b.notes);$("#best_for").val(b.best_for);$("#max_reuse").val(b.max_reuse);if(b.form=="Vloeibaar"){$("#inventory").val(b.inventory)}else{$("#inventory").val(b.inventory*1000)}$("#cost").val(b.cost);$("#production_date").val(b.production_date);$("#tht_date").val(b.tht_date);$("#cells").val(b.cells);$("#tolerance").val(b.tolerance);$("#sta1").val(b.sta1);$("#bacteria").val(b.bacteria);$("#harvest_top").val(b.harvest_top);$("#harvest_time").val(b.harvest_time);$("#pitch_temperature").val(parseFloat(b.pitch_temperature));$("#pofpos").val(b.pofpos);$("#zymocide").val(b.zymocide);d();$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").on("open",function(g){d()});$("#cost").on("change",function(g){b.cost=parseFloat(g.args.value);d()});$("#inventory").on("change",function(g){if(b.form=="Vloeibaar"){b.inventory=parseFloat(g.args.value)}else{b.inventory=parseFloat(g.args.value)/1000}d()});$("#form").on("select",function(g){b.form=$("#form").val();d()});$("#popupWindow").jqxWindow({width:1050,height:625,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Clone").jqxButton({template:"warning",width:"90px",theme:theme});$("#Clone").click(function(){var g={record:-1,name:$("#name").val()+" kopie",type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:0,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:"",tht_date:"",cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide")});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,i,h=-1;if(c>=0){h=$("#jqxgrid").jqxGrid("getrowid",c)}if(b.form=="Vloeibaar"){g=parseFloat($("#inventory").jqxNumberInput("decimal"))}else{g=parseFloat($("#inventory").jqxNumberInput("decimal"))/1000}i={record:h,name:$("#name").val(),type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseFloat($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseFloat($("#max_temperature").jqxNumberInput("decimal")),flocculation:$("#flocculation").val(),attenuation:parseFloat($("#attenuation").jqxNumberInput("decimal")),notes:$("#notes").val(),best_for:$("#best_for").val(),max_reuse:parseInt($("#max_reuse").jqxNumberInput("decimal")),inventory:g,cost:parseFloat($("#cost").jqxNumberInput("decimal")),production_date:$("#production_date").val(),tht_date:$("#tht_date").val(),cells:parseFloat($("#cells").jqxNumberInput("decimal")),tolerance:parseFloat($("#tolerance").jqxNumberInput("decimal")),sta1:$("#sta1").val(),bacteria:$("#bacteria").val(),harvest_top:$("#harvest_top").val(),harvest_time:$("#harvest_time").val(),pitch_temperature:parseFloat($("#pitch_temperature").jqxNumberInput("decimal")),pofpos:$("#pofpos").val(),zymocide:$("#zymocide").val()};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/jquery-1.11.1-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-/* jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(d,c){"object"==typeof module&&"object"==typeof module.exports?module.exports=d.document?c(d,!0):function(b){if(!b.document){throw new Error("jQuery requires a window with a document")}return c(b)}:c(d)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++){if(null!=(e=arguments[h])){for(d in e){a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c))}}}return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return !m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a){return !1}return !0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a)){return !1}try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}if(k.ownLast){for(b in a){return j.call(a,b)}}for(b in a){}return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++){if(d=b.apply(a[e],c),d===!1){break}}}else{for(e in a){if(d=b.apply(a[e],c),d===!1){break}}}}else{if(g){for(;f>e;e++){if(d=b.call(a[e],e,a[e]),d===!1){break}}}else{for(e in a){if(d=b.call(a[e],e,a[e]),d===!1){break}}}}return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g){return g.call(b,a,c)}for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++){if(c in b&&b[c]===a){return c}}}return -1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d){a[e++]=b[d++]}if(c!==c){while(void 0!==b[d]){a[e++]=b[d++]}}return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++){d=!b(a[f],f),d!==h&&e.push(a[f])}return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h){for(;g>f;f++){d=b(a[f],f,c),null!=d&&i.push(d)}}else{for(f in a){d=b(a[f],f,c),null!=d&&i.push(d)}}return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return +new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++){if(this[b]===a){return b}}return -1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]){}a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a){return d}if(1!==(k=b.nodeType)&&9!==k){return[]}if(p&&!e){if(f=_.exec(a)){if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode){return d}if(h.id===j){return d.push(h),d}}else{if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j){return d.push(h),d}}}else{if(f[2]){return I.apply(d,b.getElementsByTagName(a)),d}if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName){return I.apply(d,b.getElementsByClassName(j)),d}}}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--){o[l]=s+qb(o[l])}w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x){try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return !!a(b)}catch(c){return !1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--){d.attrHandle[c[e]]=b}}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d){return d}if(c){while(c=c.nextSibling){if(c===b){return -1}}}return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--){c[e=f[g]]&&(c[e]=!(d[e]=c[e]))}})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++]){1===c.nodeType&&d.push(c)}return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return !0}}}return !1},B=b?function(a,b){if(a===b){return l=!0,0}var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b){return l=!0,0}var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g){return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0}if(f===g){return kb(a,b)}c=a;while(c=c.parentNode){h.unshift(c)}c=b;while(c=c.parentNode){i.unshift(c)}while(h[d]===i[d]){d++}return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b))){try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType){return d}}catch(e){}}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++]){b===a[f]&&(e=d.push(f))}while(e--){a.splice(d[e],1)}}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent){return a.textContent}for(a=a.firstChild;a;a=a.nextSibling){c+=e(a)}}else{if(3===f||4===f){return a.nodeValue}}}else{while(b=a[d++]){c+=e(b)}}return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return !0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return !!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p]){if(h?l.nodeName.toLowerCase()===r:1===l.nodeType){return !1}}o=p="only"===a&&!o&&"nextSibling"}return !0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}}else{if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w){m=j[1]}else{while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b)){break}}}}return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--){d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--){(f=g[h])&&(a[h]=!(b[h]=f))}}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang")){return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-")}}while((b=b.parentNode)&&1===b.nodeType);return !1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling){if(a.nodeType<6){return !1}}return !0},parent:function(a){return !d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2){a.push(c)}return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2){a.push(c)}return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;){a.push(d)}return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;){a.push(d)}return a})}},d.pseudos.nth=d.pseudos.eq;for(b in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0}){d.pseudos[b]=lb(b)}for(b in {submit:!0,reset:!0}){d.pseudos[b]=mb(b)}function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k){return b?0:k.slice(0)}h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter){!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length))}if(!c){break}}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++){d+=a[b].value}return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d]){if(1===b.nodeType||e){return a(b,c,f)}}}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d]){if((1===b.nodeType||e)&&a(b,c,g)){return !0}}}else{while(b=b[d]){if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f){return j[2]=h[2]}if(i[d]=j,j[2]=a(b,c,g)){return !0}}}}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--){if(!a[e](b,c,d)){return !1}}return !0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++){fb(a,b[d],c)}return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++){(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h))}return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--){(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}}if(f){if(e||a){if(e){j=[],k=r.length;while(k--){(l=r[k])&&j.push(q[k]=l)}e(null,r=[],j,i)}k=r.length;while(k--){(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}}else{r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)}})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return !g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++){if(c=d.relative[a[i].type]){m=[rb(sb(m),c)]}else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++){if(d.relative[a[e].type]){break}}return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||0.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++]){if(o(l,g,h)){i.push(l);break}}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++]){o(r,s,g,h)}if(f){if(p>0){while(q--){r[q]||s[q]||(s[q]=G.call(i))}}s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--){f=wb(b[c]),f[u]?d.push(f):e.push(f)}f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b){return e}n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type]){break}if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a){return I.apply(e,f),e}break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b)){return m.grep(a,function(a,d){return !!b.call(a,d,a)!==c})}if(b.nodeType){return m.grep(a,function(a){return a===b!==c})}if("string"==typeof b){if(v.test(b)){return m.filter(b,a,c)}b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a){return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++){if(m.contains(d[b],this)){return !0}}}))}for(b=0;e>b;b++){m.find(a,d[b],c)}return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return !!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a){return this}if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b){return !b||b.jquery?(b||x).find(a):this.constructor(b).find(a)}if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b)){for(c in b){m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c])}}return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2]){return x.find(a)}this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c))){1===e.nodeType&&d.push(e),e=e[b]}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling){1===a.nodeType&&a!==b&&c.push(a)}return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++){if(m.contains(this,c[b])){return !0}}})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++){for(c=this[d];c&&c!==b;c=c.parentNode){if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}}}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do{a=a[b]}while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++){if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1){h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return !h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return !i},fireWith:function(a,c){return !h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return !!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1){for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++){c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f}}return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body){return setTimeout(m.ready)}m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H){if(H=m.Deferred(),"complete"===y.readyState){setTimeout(m.ready)}else{if(y.addEventListener){y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1)}else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}}}return H.promise(b)};var K="undefined",L;for(L in m(k)){break}k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else{c=void 0}}return c}function P(a){var b;for(b in a){if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b){return !1}}return !0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b){return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--){delete d[b[e]]}if(c?!P(d):!m.isEmptyObject(d)){return}}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--){g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])))}m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--){c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h))}return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c){m.access(a,b,h,c[h],!0,f,g)}}else{if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b)){for(;i>h;h++){b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)))}}}return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in {submit:!0,change:!0,focusin:!0}){c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1)}d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return !0}function bb(){return !1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--){f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0)}a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--){if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--){g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g))}i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else{for(o in k){m.event.remove(a,o+b[j],c,d,!0)}}}m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode){o.push(h),l=h}l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped()){b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault())}if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped()){(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type)){for(;i!=this;i=i.parentNode||this){if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++){d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d)}e.length&&g.push({elem:i,handlers:e})}}}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando]){return a}var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--){c=d[b],a[c]=f[c]}return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus){try{return this.focus(),!1}catch(a){}}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void (this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a){this.on(f,b,c,a[f],e)}return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1){d=bb}else{if(!d){return this}}return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj){return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this}if("object"==typeof a){for(e in a){this.off(e,b,a[e])}return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement){while(b.length){c.createElement(b.pop())}}return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f){for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++){!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b))}}return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++){m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h){for(d=0,e=h[c].length;e>d;d++){m.event.add(b,c,h[c][d])}}}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events){m.removeEvent(b,d,e.handle)}b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a))){for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g){d[g]&&Bb(e,d[g])}}if(b){if(c){for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++){Ab(e,d[g])}}else{Ab(a,f)}}return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++){if(f=a[q],f||0===f){if("object"===m.type(f)){m.merge(p,f.nodeType?[f]:f)}else{if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--){h=h.lastChild}if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--){m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild){h.removeChild(h.firstChild)}h=o.lastChild}else{p.push(b.createTextNode(f))}}}}h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++]){if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++]){ob.test(f.type||"")&&c.push(f)}}}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++){if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events){for(e in g.events){n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle)}}j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++){b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c))}return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild){a.removeChild(a.firstChild)}a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a){return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0}if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++){b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a)}b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p)){return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)})}if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++){d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j)}if(f){for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++){d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")))}}i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++){c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get())}return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a){return a}a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c){return c?void delete this.get:(this.get=b).apply(this,arguments)}}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b){g[f]=a.style[f],a.style[f]=b[f]}e=c.apply(a,d||[]);for(f in b){a.style[f]=g[f]}return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a){return b}var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--){if(b=Tb[e]+c,b in a){return b}}return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++){d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))))}for(g=0;h>g;g++){d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"))}return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2){"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)))}return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e)){return e}d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c){return g&&"get" in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]}if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set" in g&&void 0===(c=g.set(a,c,d))))){try{i[b]=c}catch(j){}}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get" in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?0.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++){e[a+T[d]+b]=f[d]||f[d-2]||f[0]}return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++){f[b[g]]=m.css(a,b[g],!1,d)}return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return 0.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do{h=h||".5",g/=h,m.style(c.elem,a,g+f)}while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b){c=T[e],d["margin"+c]=d["padding"+c]=a}return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++){if(d=e[f].call(c,b,a)){return d}}}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height" in b||"width" in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b){if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d]){continue}q=!0}o[d]=r&&r[d]||m.style(a,d)}else{j=void 0}}if(m.isEmptyObject(o)){"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j)}else{r?"hidden" in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o){m.style(a,b,o[b])}});for(d in o){g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}}function jc(a,b){var c,d,e,f,g;for(c in a){if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand" in g){f=g.expand(f),delete a[d];for(c in f){c in a||(a[c]=f[c],b[c]=e)}}else{b[d]=e}}}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e){return !1}for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++){j.tweens[g].run(f)}return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e){return this}for(e=!0;d>c;c++){j.tweens[c].run(1)}return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++){if(d=dc[f].call(j,a,k,j.opts)){return d}}return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++){c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)}},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e){g[e]&&g[e].stop&&d(g[e])}else{for(e in g){g[e]&&g[e].stop&&cc.test(e)&&d(g[e])}}for(e=f.length;e--;){f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1))}(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;){f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1))}for(b=0;g>b;b++){d[b]&&d[b].finish&&d[b].finish.call(this)}delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++){a=b[c],a()||b[c]!==a||b.splice(c--,1)}b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];if(arguments.length){return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set" in b&&void 0!==b.set(this,e,"value")||(this.value=e))})}if(e){return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get" in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++){if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f){return b}g.push(b)}}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--){if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0){try{d.selected=c=!0}catch(h){d.scrollHeight}}else{d.selected=!1}}return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f){return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get" in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set" in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType){while(c=f[e++]){d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)}}},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void (a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g){return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set" in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get" in e&&null!==(d=e.get(a,b))?d:a[b]}},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a)){return this.each(function(b){m(this).addClass(a.call(this,b,this.className))})}if(j){for(b=(a||"").match(E)||[];i>h;h++){if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++]){d.indexOf(" "+e+" ")<0&&(d+=e+" ")}g=m.trim(d),c.className!==g&&(c.className=g)}}}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a)){return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))})}if(j){for(b=(a||"").match(E)||[];i>h;h++){if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++]){while(d.indexOf(" "+e+" ")>=0){d=d.replace(" "+e+" "," ")}}g=a?m.trim(d):"",c.className!==g&&(c.className=g)}}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++]){e.hasClass(b)?e.removeClass(b):e.addClass(b)}}else{(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")}})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++){if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0){return !0}}return !1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse){return a.JSON.parse(b+"")}var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b){return null}try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c)){while(d=f[e++]){"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b){void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d])}return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0]){i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"))}if(e){for(g in h){if(h[g]&&h[g].test(e)){i.unshift(g);break}}}if(i[0] in c){f=i[0]}else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1]){for(g in a.converters){j[g.toLowerCase()]=a.converters[g]}}f=k.shift();while(f){if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift()){if("*"===f){f=i}else{if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g){for(e in j){if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}}}if(g!==!0){if(g&&a["throws"]){b=g(b)}else{try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}}}}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f)){j[b[1].toLowerCase()]=b[2]}}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a){if(2>t){for(b in a){q[b]=[q[b],a[b]]}}else{v.always(a[v.status])}}return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t){return v}h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers){v.setRequestHeader(d,k.headers[d])}if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t)){return v.abort()}u="abort";for(d in {success:1,error:1,complete:1}){v[d](k[d])}if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t)){throw w}x(-1,w)}}else{x(-1,"No Transport")}function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a)){return this.each(function(b){m(this).wrapAll(a.call(this,b))})}if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return !m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b)){m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)})}else{if(c||"object"!==m.type(b)){d(a,b)}else{for(e in b){Vc(a+"["+e+"]",b[e],c,d)}}}}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a)){m.each(a,function(){e(this.name,this.value)})}else{for(c in a){Vc(c,a[c],b,e)}}return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return !this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc){Xc[a](void 0,!0)}}),k.cors=!!Yc&&"withCredentials" in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields){for(e in a.xhrFields){f[e]=a.xhrFields[e]}}a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c){void 0!==c[e]&&f.setRequestHeader(e,c[e]+"")}f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState)){if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e){4!==f.readyState&&f.abort()}else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a){return null}"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd){return bd.apply(this,arguments)}var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using" in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length){return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)})}var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f){return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d}},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position")){a=a.offsetParent}return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void (f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
\ No newline at end of file
--- a/www/js/log_brew-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#jqxMenu").jqxMenu("destroy");$("#jqxLoader").jqxLoader({width:250,height:150,isModal:true,text:"Opmaken grafiek ...",theme:theme});$("#jqxLoader").jqxLoader("open");function a(){return"https://www.jqwidgets.com/export_server/export.php"}var d={datatype:"json",datafields:[{name:"date",type:"date",format:"yyyy-MM-dd HH:mm"},{name:"version",type:"int"},{name:"code",type:"string"},{name:"name",type:"string"},{name:"pv_mlt",type:"float"},{name:"pv_hlt",type:"float"},{name:"pv_room",type:"float"},{name:"sp_mlt",type:"float"},{name:"sp_hlt",type:"float"},{name:"pwm_mlt",type:"int"},{name:"pwm_hlt",type:"int"},{name:"event",type:"string"}],url:"getbrewlog.php?code="+my_code},c=new $.jqx.dataAdapter(d,{autoBind:true,async:false,loadComplete:function(){$("#jqxLoader").jqxLoader("close")},loadError:function(g,e,f){}}),b={title:my_code+' "'+my_name+'"',description:"",source:c,xAxis:{dataField:"date",type:"date",formatFunction:function(e){return e.getHours()+":"+e.getMinutes()},toolTipFormatFunction:function(g){var f=g.getHours(),e=g.getMinutes();return g.getDate()+"-"+(g.getMonth()+1)+"-"+g.getFullYear()+" "+(f<10?"0"+f:f)+":"+(e<10?"0"+e:e)},textRotationAngle:300,},colorScheme:"scheme01",seriesGroups:[{type:"spline",valueAxis:{minValue:0,description:"Graden C"},series:[{dataField:"pv_mlt",lineWidth:2,displayText:"MLT"},{dataField:"sp_mlt",lineWidth:1,displayText:"mlt",opacity:0.7},{dataField:"pv_hlt",lineWidth:1,displayText:"HLT"},{dataField:"sp_hlt",lineWidth:1,displayText:"hlt",opacity:0.7},{dataField:"pv_room",lineWidth:1,displayText:"Room",opacity:0.5}]}]};$("#brew_chart").jqxChart(b);$("#print").click(function(){var g=$("#brew_chart")[0].outerHTML,h=window.open("","","width=865, height=425"),e=h.document.open(),f='<!DOCTYPE html><html><head><link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" /><meta charset="utf-8" /><title>'+my_code+" "+my_name+" brouwdag</title></head><body>"+g+"</body></html>";e.write(f);e.close();h.print()});$("#print").jqxButton({template:"primary",width:125,theme:theme});$("#pdfButton").click(function(){$("#brew_chart").jqxChart("saveAsPDF","brouw_"+my_code+".pdf",a())});$("#pdfButton").jqxButton({template:"primary",width:125,theme:theme});$("#pngButton").click(function(){$("#brew_chart").jqxChart("saveAsPNG","brouw_"+my_code+".png",a())});$("#pngButton").jqxButton({template:"primary",width:125,theme:theme});$("#Close").jqxButton({template:"success",width:125,theme:theme});$("#Close").click(function(){window.close()})});
\ No newline at end of file
--- a/www/js/log_co2pressure-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#jqxMenu").jqxMenu("destroy");$("#jqxLoader").jqxLoader({width:250,height:150,isModal:true,text:"Opmaken grafiek ...",theme:theme});$("#jqxLoader").jqxLoader("open");function a(){return"https://www.jqwidgets.com/export_server/export.php"}var d={datatype:"json",datafields:[{name:"date",type:"date",format:"yyyy-MM-dd HH:mm"},{name:"temperature",type:"float"},{name:"pressure",type:"float"},{name:"uuid",type:"string"}],url:"getco2pressurelog.php?code="+my_code+"&name="+my_name},c=new $.jqx.dataAdapter(d,{autoBind:true,async:false,loadComplete:function(){$("#jqxLoader").jqxLoader("close")},loadError:function(g,e,f){}}),b={title:my_code+' "'+my_name+'"',description:"",source:c,xAxis:{dataField:"date",type:"date",formatFunction:function(e){return e.getDate()+"-"+(e.getMonth()+1)+"-"+e.getFullYear()},toolTipFormatFunction:function(g){var f=g.getHours(),e=g.getMinutes();return g.getDate()+"-"+(g.getMonth()+1)+"-"+g.getFullYear()+" "+(f<10?"0"+f:f)+":"+(e<10?"0"+e:e)},textRotationAngle:45,howGridLines:false},colorScheme:"scheme01",seriesGroups:[{type:"area",valueAxis:{minValue:0,displayValueAxis:false,description:"Druk in bar"},series:[{dataField:"pressure",lineWidth:1,displayText:"Druk",opacity:0.4}]},{type:"spline",valueAxis:{minValue:0,description:"Graden C"},series:[{dataField:"temperature",lineWidth:1,displayText:"Temperatuur"}]}]};$("#pressure_chart").jqxChart(b);$("#print").click(function(){var g=$("#pressure_chart")[0].outerHTML,h=window.open("","","width=865, height=425"),e=h.document.open(),f='<!DOCTYPE html><html><head><link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" /><meta charset="utf-8" /><title>'+my_code+" "+my_name+" hergisting</title></head><body>"+g+"</body></html>";e.write(f);e.close();h.print()});$("#print").jqxButton({template:"primary",width:125,theme:theme});$("#pdfButton").click(function(){$("#pressure_chart").jqxChart("saveAsPDF","hergisting_"+my_code+".pdf",a())});$("#pdfButton").jqxButton({template:"primary",width:125,theme:theme});$("#pngButton").click(function(){$("#pressure_chart").jqxChart("saveAsPNG","hergisting_"+my_code+".png",a())});$("#pngButton").jqxButton({template:"primary",width:125,theme:theme});$("#Close").jqxButton({template:"success",width:125,theme:theme});$("#Close").click(function(){window.close()})});
\ No newline at end of file
--- a/www/js/log_fermentation-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#jqxMenu").jqxMenu("destroy");$("#jqxLoader").jqxLoader({width:250,height:150,isModal:true,text:"Opmaken grafiek ...",theme:theme});$("#jqxLoader").jqxLoader("open");function a(){return"https://www.jqwidgets.com/export_server/export.php"}var d={datatype:"json",datafields:[{name:"date",type:"date",format:"yyyy-MM-dd HH:mm"},{name:"air",type:"float"},{name:"beer",type:"float"},{name:"chiller",type:"float"},{name:"room",type:"float"},{name:"tlo",type:"float"},{name:"thi",type:"float"},{name:"heater",type:"int"},{name:"cooler",type:"int"},{name:"event",type:"string"}],url:"getfermentlog.php?code="+my_code+"&name="+my_name},c=new $.jqx.dataAdapter(d,{autoBind:true,async:false,loadComplete:function(){$("#jqxLoader").jqxLoader("close")},loadError:function(g,e,f){}}),b={title:my_code+' "'+my_name+'"',description:"",source:c,xAxis:{dataField:"date",type:"date",formatFunction:function(e){return e.getDate()+"-"+(e.getMonth()+1)+"-"+e.getFullYear()},toolTipFormatFunction:function(g){var f=g.getHours(),e=g.getMinutes();return g.getDate()+"-"+(g.getMonth()+1)+"-"+g.getFullYear()+" "+(f<10?"0"+f:f)+":"+(e<10?"0"+e:e)},textRotationAngle:45,howGridLines:false,rangeSelector:{size:90,dataField:"beer",serieType:"line",gridLines:{visible:false},}},colorScheme:"scheme01",seriesGroups:[{type:"area",valueAxis:{minValue:0,maxValue:100,displayValueAxis:false,description:"Heat/Cool %"},series:[{dataField:"cooler",lineWidth:1,displayText:"Cool %",opacity:0.4},{dataField:"heater",lineWidth:1,displayText:"Heat %",opacity:0.3}]},{type:"spline",valueAxis:{minValue:0,description:"Graden C"},series:[{dataField:"air",lineWidth:1,displayText:"Air"},{dataField:"beer",lineWidth:2,displayText:"Beer"},{dataField:"tlo",lineWidth:1,displayText:"Target Lo",opacity:0.7},{dataField:"thi",lineWidth:1,displayText:"Target Hi",opacity:0.7},{dataField:"room",lineWidth:1,displayText:"Room",opacity:0.5},{dataField:"chiller",lineWidth:1,displayText:"Chiller",color:"#0000bb"}]}]};$("#fermenter_chart").jqxChart(b);$("#print").click(function(){var g=$("#fermenter_chart")[0].outerHTML,h=window.open("","","width=865, height=425"),e=h.document.open(),f='<!DOCTYPE html><html><head><link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" /><meta charset="utf-8" /><title>'+my_code+" "+my_name+" vergisting</title></head><body>"+g+"</body></html>";e.write(f);e.close();h.print()});$("#print").jqxButton({template:"primary",width:125,theme:theme});$("#pdfButton").click(function(){$("#fermenter_chart").jqxChart("saveAsPDF","vergisting_"+my_code+".pdf",a())});$("#pdfButton").jqxButton({template:"primary",width:125,theme:theme});$("#pngButton").click(function(){$("#fermenter_chart").jqxChart("saveAsPNG","vergisting_"+my_code+".png",a())});$("#pngButton").jqxButton({template:"primary",width:125,theme:theme});$("#Close").jqxButton({template:"success",width:125,theme:theme});$("#Close").click(function(){window.close()})});
\ No newline at end of file
--- a/www/js/mon_co2meter-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var g={},f={},d=false,h=0,i={datatype:"json",cache:false,datafields:[{name:"code",type:"string"},{name:"name",type:"string"},{name:"uuid",type:"string"}],id:"code",url:"includes/db_product.php?select=ferment"},l=new $.jqx.dataAdapter(i,{beforeLoadComplete:function(m){var p,n,o=new Array();f.code="Free";f.name="Dummy";f.uuid="66ecccbf-e942-4a35-af49-8b02314561a5";o.push(f);for(n=0;n<m.length;n++){p=m[n];o.push(p)}return o},loadError:function(o,m,n){$("#err").text(m+" "+n)},}),c={min:10,max:40,width:375,height:375,ranges:[{startValue:10,endValue:20,style:{fill:"#3399FF",stroke:"#3399FF"},endWidth:10,startWidth:10},{startValue:20,endValue:28,style:{fill:"#00CC33",stroke:"#00CC33"},endWidth:10,startWidth:10},{startValue:28,endValue:40,style:{fill:"#FC6A6A",stroke:"#FC6A6A"},endWidth:10,startWidth:10}],ticksMinor:{interval:1,size:"5%"},ticksMajor:{interval:5,size:"9%"},labels:{interval:5},style:{fill:"#eeeeee",stroke:"#666666"},value:0,colorScheme:"scheme05"},e={min:0,max:6,width:375,height:375,ranges:[{startValue:0,endValue:3,style:{fill:"#00CC33",stroke:"#00CC33"},endWidth:10,startWidth:10},{startValue:3,endValue:6,style:{fill:"#FC6A6A",stroke:"#FC6A6A"},endWidth:10,startWidth:10}],ticksMinor:{interval:0.2,size:"5%"},ticksMajor:{interval:1,size:"9%"},labels:{interval:1},style:{fill:"#eeeeee",stroke:"#666666"},value:0,colorScheme:"scheme05"},b="getco2meter.php?uuid='"+my_uuid+"'",a={datatype:"json",datafields:[{name:"record",type:"int"},{name:"uuid",type:"string"},{name:"alias",type:"string"},{name:"node",type:"string"},{name:"online",type:"int"},{name:"beercode",type:"string"},{name:"beername",type:"string"},{name:"beeruuid",type:"string"},{name:"mode",type:"string"},{name:"alarm",type:"int"},{name:"temperature_state",type:"string"},{name:"temperature",type:"float"},{name:"pressure_state",type:"string"},{name:"pressure_bar",type:"float"}],id:"record",url:b},k=new $.jqx.dataAdapter(a,{loadComplete:function(m){g=k.records[0];var n=(g.online)?"On-line":"Off-line";$("#info_uuid").html(g.uuid);$("#info_system").html(g.node+"/"+g.alias);$("#info_online").html(n);$("#info_beer").html(g.beercode+" - "+g.beername);$("#info_mode").html(g.mode);f.name=g.alias;f.code=g.alias.toUpperCase();f.uuid=g.uuid;if(g.online&&(g.mode!="OFF")){$("#co2meter_powerled").html('<div class="LEDblue_on"></div>Power');$("#select_beer").jqxDropDownList({disabled:true});$("#select_beer").jqxDropDownList("clearSelection");$("#select_beer").hide()}else{$("#co2meter_powerled").html('<div class="LEDblue_off"></div>Power');$("#select_beer").show();$("#select_beer").jqxDropDownList({disabled:false})}if(g.online&&(g.alarm!="0")){$("#co2meter_alarmled").html('<div class="LEDred_on"></div>Alarm')}else{$("#co2meter_alarmled").html('<div class="LEDred_off"></div>Alarm')}$("#gaugeContainer_temperature").jqxGauge({caption:{value:"Temp: "+g.temperature.toFixed(3)}});$("#gaugeContainer_temperature").jqxGauge({value:g.temperature});if(g.temperature_state=="OK"){$("#gaugeContainer_temperature").jqxGauge({disabled:false})}else{$("#gaugeContainer_temperature").jqxGauge({disabled:true})}$("#gaugeContainer_pressure").jqxGauge({caption:{value:"Bar: "+g.pressure_bar.toFixed(2)}});$("#gaugeContainer_pressure").jqxGauge({value:g.pressure_bar});if(g.pressure_state=="OK"){$("#gaugeContainer_pressure").jqxGauge({disabled:false})}else{$("#gaugeContainer_pressure").jqxGauge({disabled:true})}}});$("#select_beer").jqxDropDownList({placeHolder:"Kies bier:",theme:theme,source:l,displayMember:"code",width:150,height:24,dropDownWidth:500,autoDropDownHeight:true,renderer:function(n,m,p){var o=l.records[n];return o.code+" - "+o.name}});$("#gaugeContainer_temperature").jqxGauge(c);$("#gaugeContainer_temperature").jqxGauge({caption:{value:"Temp: 00.000"}});$("#gaugeContainer_pressure").jqxGauge(e);$("#gaugeContainer_pressure").jqxGauge({caption:{value:"Bar: 00.000"}});function j(o,m,n){console.log("sendProduct("+o+", "+m+", "+n+")");var p="uuid="+g.uuid+"&beeruuid="+n+"&beercode="+o+"&beername="+m;$.ajax({url:"cmd_co2meter.php",data:p,type:"POST",success:function(q){},error:function(q,s,r){console.log("sendProduct() error")}})}k.dataBind();setInterval(function(){var m=false;if(d){j(g.beercode,g.beername,g.beeruuid);d=false;m=true}if(m){h=4}else{if(h>0){h--}}if(h<=0){k.dataBind();h=20}},500);$("#select_beer").on("select",function(o){if(o.args){var m=o.args.index,n=l.records[m];g.beercode=n.code;g.beername=n.name;g.beeruuid=n.uuid;d=true}});$("#FLog").jqxButton({template:"primary",width:"150px",theme:theme});$("#FLog").click(function(){window.open("log_co2pressure.php?code="+g.beercode+"&name="+g.beername)})});
\ No newline at end of file
--- a/www/js/mon_fermenter-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createAbortElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:440,y:210},width:400,height:200,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){var c={},e={},b="",l=false,k=false,w=false,n=false,o=0,t=12,y=24,v={datatype:"json",cache:false,datafields:[{name:"code",type:"string"},{name:"name",type:"string"},{name:"uuid",type:"string"},{name:"stage",type:"int"},{name:"yeast_lo",type:"float"},{name:"yeast_hi",type:"float"}],id:"code",url:"includes/db_product.php?select=ferment"},s=new $.jqx.dataAdapter(v,{beforeLoadComplete:function(z){var C,A,B=new Array();e.code="Free";e.name="Dummy";e.uuid="66ecccbf-e942-4a35-af49-8b02314561a5";e.stage=10;e.yeast_lo=12;e.yeast_hi=24;B.push(e);for(A=0;A<z.length;A++){C=z[A];B.push(C)}return B},loadError:function(B,z,A){$("#err").text(z+" "+A)},}),f={datatype:"json",cache:false,datafields:[{name:"record",type:"int"},{name:"uuid",type:"string"},{name:"name",type:"string"},{name:"inittemp_lo",type:"float"},{name:"inittemp_hi",type:"float"},{name:"fridgemode",type:"int"},{name:"totalsteps",type:"int"},{name:"duration",type:"int"},{name:"steps",type:"array"}],id:"record",url:"includes/db_profile_fermentation.php"},a=new $.jqx.dataAdapter(f,{beforeLoadComplete:function(z){var C=new Array(),B={},A,D;B.record=-1;B.uuid="";B.name="Wis profiel";B.inittemp_lo=20;B.inittemp_hi=20;B.fridgemode=0;B.totalsteps=0;B.duration=0;B.steps="[]";C.push(B);for(A=0;A<z.length;A++){D=z[A];C.push(D)}return C},loadError:function(B,z,A){$("#err").text(z+" "+A)},}),g={min:0,max:40,width:375,height:375,ranges:[{startValue:0,endValue:t,style:{fill:"#3399FF",stroke:"#3399FF"},endWidth:10,startWidth:10},{startValue:t,endValue:y,style:{fill:"#00CC33",stroke:"#00CC33"},endWidth:10,startWidth:10},{startValue:y,endValue:40,style:{fill:"#FC6A6A",stroke:"#FC6A6A"},endWidth:10,startWidth:10}],ticksMinor:{interval:1,size:"5%"},ticksMajor:{interval:5,size:"9%"},labels:{interval:5},style:{fill:"#eeeeee",stroke:"#666666"},value:0,colorScheme:"scheme05"},h={min:-15,max:25,width:190,height:190,ranges:[{startValue:-15,endValue:0,startWidth:5,endWidth:5,style:{fill:"#3399FF",stroke:"#3399FF"}},{startValue:0,endValue:10,startWidth:5,endWidth:5,style:{fill:"#00CC33",stroke:"#00CC33"}},{startValue:10,endValue:25,startWidth:5,endWidth:5,style:{fill:"#FC6A6A",stroke:"#FC6A6A"}}],ticksMinor:{interval:1,size:"5%"},ticksMajor:{interval:5,size:"9%"},labels:{interval:5},style:{fill:"#eeeeee",stroke:"#666666"},value:0,colorScheme:"scheme05",caption:{value:"Chiller",position:"bottom",offset:[0,10]}},m={height:68,width:35,onLabel:"AAN",offLabel:"UIT",theme:theme,thumbSize:"50%",orientation:"vertical"},x={inputMode:"simple",theme:theme,width:70,min:0,max:40,decimalDigits:1,spinButtons:true},d="getfermenter.php?uuid='"+my_uuid+"'",j={datatype:"json",datafields:[{name:"record",type:"int"},{name:"uuid",type:"string"},{name:"alias",type:"string"},{name:"node",type:"string"},{name:"online",type:"int"},{name:"beercode",type:"string"},{name:"beername",type:"string"},{name:"air_state",type:"string"},{name:"air_temperature",type:"float"},{name:"beer_state",type:"string"},{name:"beer_temperature",type:"float"},{name:"chiller_state",type:"string"},{name:"chiller_temperature",type:"float"},{name:"heater_state",type:"int"},{name:"heater_usage",type:"int"},{name:"cooler_state",type:"int"},{name:"cooler_usage",type:"int"},{name:"fan_state",type:"int"},{name:"fan_usage",type:"int"},{name:"light_address",type:"string"},{name:"light_state",type:"int"},{name:"light_usage",type:"int"},{name:"door_address",type:"string"},{name:"door_state",type:"int"},{name:"psu_address",type:"string"},{name:"psu_state",type:"int"},{name:"mode",type:"string"},{name:"alarm",type:"int"},{name:"setpoint_high",type:"float"},{name:"setpoint_low",type:"float"},{name:"profile_uuid",type:"string"},{name:"profile_name",type:"string"},{name:"profile_state",type:"string"},{name:"profile_percent",type:"int"},{name:"profile_inittemp_high",type:"float"},{name:"profile_inittemp_low",type:"float"},{name:"profile_steps",type:"string"},{name:"stage",type:"string"},{name:"beeruuid",type:"string"},{name:"yeast_lo",type:"float"},{name:"yeast_hi",type:"float"},{name:"webcam_url",type:"string"},{name:"webcam_light",type:"int"}],id:"record",url:d},r=new $.jqx.dataAdapter(j,{loadComplete:function(A){c=r.records[0];var z,B=(c.online)?"On-line":"Off-line";$("#info_uuid").html(c.uuid);$("#info_system").html(c.node+"/"+c.alias);$("#info_online").html(B);$("#info_beer").html(c.beercode+" - "+c.beername);$("#info_mode").jqxDropDownList("selectItem",c.mode);$("#info_stage").jqxDropDownList("selectItem",c.stage);$("#info_profile").html(c.profile_name);e.name=c.alias;e.code=c.alias.toUpperCase();e.uuid=c.uuid;if(c.profile_name==""){$("#info_mode").jqxDropDownList("disableItem","PROFILE")}else{$("#info_mode").jqxDropDownList("enableItem","PROFILE")}$("#target_lo").val(c.setpoint_low);$("#target_hi").val(c.setpoint_high);if(c.online&&((c.mode=="FRIDGE")||(c.mode=="BEER"))){$("#target_lo").jqxNumberInput({readOnly:false,Width:70,spinButtons:true});$("#target_hi").jqxNumberInput({readOnly:false,Width:70,spinButtons:true})}else{$("#target_lo").jqxNumberInput({readOnly:true,Width:50,spinButtons:false});$("#target_hi").jqxNumberInput({readOnly:true,Width:50,spinButtons:false})}if(c.online&&c.door_address&&(c.door_state!="0")){$("#fermenter_doorled").html('<div class="LEDyellow_on"></div>Door')}else{$("#fermenter_doorled").html('<div class="LEDyellow_off"></div>Door')}if(c.online&&c.light_address&&(c.light_state!="0")){$("#fermenter_lightled").html('<div class="LEDyellow_on"></div>Light')}else{$("#fermenter_lightled").html('<div class="LEDyellow_off"></div>Light')}if(c.online&&(c.mode!="OFF")){$("#fermenter_powerled").html('<div class="LEDblue_on"></div>Power');$("#select_beer").jqxDropDownList({disabled:true});$("#select_beer").jqxDropDownList("clearSelection");$("#select_beer").hide()}else{$("#fermenter_powerled").html('<div class="LEDblue_off"></div>Power');$("#select_beer").show();$("#select_beer").jqxDropDownList({disabled:false})}if(c.online&&(c.alarm!="0")){$("#fermenter_alarmled").html('<div class="LEDred_on"></div>Alarm')}else{$("#fermenter_alarmled").html('<div class="LEDred_off"></div>Alarm')}if(c.online&&(c.heater_state!="0")){$("#fermenter_led1").html('<div class="LEDgreen_on"></div>Heat')}else{$("#fermenter_led1").html('<div class="LEDgreen_off"></div>Heat')}if(c.online&&(c.cooler_state!="0")){$("#fermenter_led2").html('<div class="LEDgreen_on"></div>Cool')}else{$("#fermenter_led2").html('<div class="LEDgreen_off"></div>Cool')}if(c.online&&(c.fan_state!="0")){$("#fermenter_led3").html('<div class="LEDgreen_on"></div>Fan')}else{$("#fermenter_led3").html('<div class="LEDgreen_off"></div>Fan')}if(c.online&&(c.mode=="NONE")){$("#fermenter_toggle1").jqxSwitchButton("enable");$("#fermenter_toggle2").jqxSwitchButton("enable");$("#fermenter_toggle3").jqxSwitchButton("enable")}else{$("#fermenter_toggle1").jqxSwitchButton("disable");$("#fermenter_toggle2").jqxSwitchButton("disable");$("#fermenter_toggle3").jqxSwitchButton("disable");$("#fermenter_toggle1").val((c.heater_state!="0"));$("#fermenter_toggle2").val((c.cooler_state!="0"));$("#fermenter_toggle3").val((c.fan_state!="0"))}if(c.online&&(c.mode=="PROFILE")){if(c.profile_state=="OFF"){$("#select_profile").show();$("#select_profile").jqxDropDownList({disabled:false});$("#info_mode").jqxDropDownList({disabled:false});$("#Profile1").jqxButton({template:"success",value:"Starten"});$("#Profile1").show();$("#Profile2").hide();$("#status_profile").html("")}else{if(c.profile_state=="RUN"){$("#select_profile").jqxDropDownList({disabled:true});$("#select_profile").hide();$("#info_mode").jqxDropDownList({disabled:true});$("#Profile1").jqxButton({template:"danger",value:"Afbreken"});$("#Profile2").jqxButton({template:"primary",value:"Pauze"});$("#Profile1").show();$("#Profile2").show();$("#status_profile").html("Profiel actief, "+c.profile_percent+"% gereed")}else{if(c.profile_state=="PAUSE"){$("#select_profile").jqxDropDownList({disabled:true});$("#select_profile").hide();$("#info_mode").jqxDropDownList({disabled:true});$("#Profile1").jqxButton({template:"danger",value:"Afbreken"});$("#Profile2").jqxButton({template:"success",value:"Doorgaan"});$("#Profile1").show();$("#Profile2").show();$("#status_profile").html("Profiel pauze, "+c.profile_percent+"% gereed")}else{if(c.profile_state=="DONE"){$("#select_profile").jqxDropDownList({disabled:true});$("#select_profile").hide();$("#info_mode").jqxDropDownList({disabled:true});$("#Profile1").jqxButton({template:"primary",value:"Profiel Ok"});$("#Profile1").show();$("#Profile2").hide();$("#status_profile").html("Profiel is gereed")}}}}}else{$("#select_profile").show();$("#select_profile").jqxDropDownList({disabled:false});$("#info_mode").jqxDropDownList({disabled:false});$("#Profile1").hide();$("#Profile2").hide();$("#status_profile").html("")}if(c.online&&(c.webcam_url!="")){$("#Camera").show()}else{$("#Camera").hide()}t=c.yeast_lo;y=c.yeast_hi;z={ranges:[{startValue:0,endValue:t,style:{fill:"#3399FF",stroke:"#3399FF"},endWidth:10,startWidth:10},{startValue:t,endValue:y,style:{fill:"#00CC33",stroke:"#00CC33"},endWidth:10,startWidth:10},{startValue:y,endValue:40,style:{fill:"#FC6A6A",stroke:"#FC6A6A"},endWidth:10,startWidth:10}]};$("#gaugeContainer_air").jqxGauge(z);$("#gaugeContainer_beer").jqxGauge(z);$("#gaugeContainer_air").jqxGauge({caption:{value:"Air: "+c.air_temperature.toFixed(3)}});$("#gaugeContainer_air").jqxGauge({value:c.air_temperature});if(c.air_state=="OK"){$("#gaugeContainer_air").jqxGauge({disabled:false})}else{$("#gaugeContainer_air").jqxGauge({disabled:true})}$("#gaugeContainer_beer").jqxGauge({caption:{value:"Beer: "+c.beer_temperature.toFixed(3)}});$("#gaugeContainer_beer").jqxGauge({value:c.beer_temperature});if(c.beer_state=="OK"){$("#gaugeContainer_beer").jqxGauge({disabled:false})}else{$("#gaugeContainer_beer").jqxGauge({disabled:true})}$("#gaugeContainer_chiller").jqxGauge({value:c.chiller_temperature});if(c.chiller_state=="OK"){$("#gaugeContainer_chiller").jqxGauge({disabled:false})}else{$("#gaugeContainer_chiller").jqxGauge({disabled:true})}}});$("#select_beer").jqxDropDownList({placeHolder:"Kies bier:",theme:theme,source:s,displayMember:"code",width:150,height:24,dropDownWidth:500,autoDropDownHeight:true,renderer:function(A,z,C){var B=s.records[A];return B.code+" - "+B.name}});$("#select_profile").jqxDropDownList({placeHolder:"Kies profiel:",theme:theme,source:a,displayMember:"name",width:150,height:24,dropDownWidth:500,autoDropDownHeight:true,});$("#gaugeContainer_air").jqxGauge(g);$("#gaugeContainer_air").jqxGauge({caption:{value:"Air: 00.000"}});$("#gaugeContainer_beer").jqxGauge(g);$("#gaugeContainer_beer").jqxGauge({caption:{value:"Beer: 00.000"}});$("#gaugeContainer_chiller").jqxGauge(h);$("#fermenter_toggle1").jqxSwitchButton(m);$("#fermenter_toggle2").jqxSwitchButton(m);$("#fermenter_toggle3").jqxSwitchButton(m);srcMode=["OFF","NONE","FRIDGE","BEER","PROFILE"];srcStage=["PRIMARY","SECONDARY","TERTIARY","CARBONATION"];$("#info_mode").jqxDropDownList({theme:theme,source:srcMode,width:100,height:24,dropDownHeight:156});$("#info_stage").jqxDropDownList({theme:theme,source:srcStage,width:150,height:24,dropDownHeight:125});$("#target_lo").jqxNumberInput(x);$("#target_hi").jqxNumberInput(x);$("#Profile1").jqxButton({template:"info",width:"150px",height:24,theme:theme});$("#Profile2").jqxButton({template:"info",width:"150px",height:24,theme:theme});$("#Profile1").hide();$("#Profile2").hide();function i(B,D,A,z){console.log("sendBase("+B+", "+D+", "+A+", "+z+")");var C="node="+c.node+"&alias="+c.alias+'&payload={"stage":"'+B;C+='","mode":"'+D+'","setpoint":{"low":'+A+',"high":'+z+"}}";$.ajax({url:"cmd_fermenter.php",data:C,type:"POST",success:function(E){},error:function(E,G,F){console.log("sendBase() error")}})}function q(C,B,A,z){console.log("sendSwitch("+C+", "+B+", "+A+", "+z+")");var D="node="+c.node+"&alias="+c.alias+"&payload=";D+='{"heater":{"state":'+C+'},"cooler":{"state":'+B+'},"fan":{"state":'+A+'},"light":{"state":'+z+"}}";$.ajax({url:"cmd_fermenter.php",data:D,type:"POST",success:function(E){},error:function(E,G,F){console.log("sendSwitch() error")}})}function p(D,B,C,A,z){console.log("sendProduct("+D+", "+B+", "+C+", "+A+", "+z+")");var E="node="+c.node+"&alias="+c.alias+"&payload=";E+='{"product":{"code":"'+D+'","name":"'+B+'","uuid":"'+C+'","yeast_lo":'+A+',"yeast_hi":'+z+"}}";$.ajax({url:"cmd_fermenter.php",data:E,type:"POST",success:function(F){},error:function(F,H,G){console.log("sendProduct() error")}})}function u(A){console.log("sendProfile("+A+")");var z="node="+c.node+"&alias="+c.alias+"&payload="+A;$.ajax({url:"cmd_fermenter.php",data:z,type:"POST",success:function(B){},error:function(B,D,C){console.log("sendProfile() error")}})}r.dataBind();setInterval(function(){var z=false;if(l){i(c.stage,c.mode,c.setpoint_low,c.setpoint_high);l=false;z=true}if(w){q(c.heater_state,c.cooler_state,c.fan_state,c.light_state);w=false;z=true}if(k){p(c.beercode,c.beername,c.beeruuid,c.yeast_lo,c.yeast_hi);k=false;z=true}if(n){u(b);n=false;z=true}if(z){o=4}else{if(o>0){o--}}if(o<=0){r.dataBind();o=20}},500);$("#info_mode").on("change",function(A){var z=A.args;if(z){c.mode=z.item.value;$("#fermenter_toggle1").val(0);$("#fermenter_toggle2").val(0);$("#fermenter_toggle3").val(0)}l=true});$("#info_stage").on("select",function(A){var z=A.args;if(z){c.stage=z.item.value}l=true});$("#select_beer").on("select",function(B){if(B.args){var z=B.args.index,A=s.records[z];c.beercode=A.code;c.beername=A.name;c.beeruuid=A.uuid;c.yeast_lo=A.yeast_lo;c.yeast_hi=A.yeast_hi;k=true}});$("#select_profile").on("select",function(C){if(C.args){var z=C.args.index,B=a.records[z],D,A;if(B.record==-1){b='{"profile":null}'}else{b='{"profile":{"uuid":"'+B.uuid+'","name":"'+B.name+'",';b+='"inittemp":{"low":'+B.inittemp_lo+',"high":'+B.inittemp_hi+"},";b+='"fridgemode":'+B.fridgemode+',"steps":[';for(A=0;A<B.steps.length;A++){D=B.steps[A];if(A>0){b+=","}b+='{"steptime":'+D.steptime+',"resttime":'+D.resttime;b+=',"target_lo":'+D.target_lo+',"target_hi":'+D.target_hi;b+=',"fridgemode":'+D.fridgemode+',"name":"'+D.name+'"}'}b+="]}}"}n=true}});$("#target_lo").on("change",function(z){c.setpoint_low=parseFloat(z.args.value);if(c.setpoint_low>c.setpoint_high){c.setpoint_high=c.setpoint_low;$("#target_hi").val(c.setpoint_high)}l=true});$("#target_hi").on("change",function(z){c.setpoint_high=parseFloat(z.args.value);if(c.setpoint_high<c.setpoint_low){c.setpoint_low=c.setpoint_high;$("#target_lo").val(c.setpoint_low)}l=true});$("#fermenter_toggle1").on("checked",function(z){if(c.mode=="NONE"){c.heater_state=0;w=true}});$("#fermenter_toggle1").on("unchecked",function(z){if(c.mode=="NONE"){c.heater_state=100;c.cooler_state=0;$("#fermenter_toggle2").val(0);w=true}});$("#fermenter_toggle2").on("checked",function(z){if(c.mode=="NONE"){c.cooler_state=0;w=true}});$("#fermenter_toggle2").on("unchecked",function(z){if(c.mode=="NONE"){c.cooler_state=100;c.heater_state=0;$("#fermenter_toggle1").val(0);w=true}});$("#fermenter_toggle3").on("checked",function(z){if(c.mode=="NONE"){c.fan_state=0;w=true}});$("#fermenter_toggle3").on("unchecked",function(z){if(c.mode=="NONE"){c.fan_state=100;w=true}});$("#Profile1").click(function(){if(c.mode=="PROFILE"){if(c.profile_state=="OFF"){b='{"profile":{"command":"start"}}';n=true}else{if((c.profile_state=="RUN")||(c.profile_state=="PAUSE")){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){b='{"profile":{"command":"abort"}}';n=true})}else{if(c.profile_state=="DONE"){b='{"profile":{"command":"done"}}';n=true}}}}});$("#Profile2").click(function(){if(c.mode=="PROFILE"){if((c.profile_state=="RUN")||(c.profile_state=="PAUSE")){b='{"profile":{"command":"pause"}}';n=true}}});$("#FLog").jqxButton({template:"primary",width:"150px",theme:theme});$("#FLog").click(function(){window.open("log_fermentation.php?code="+c.beercode+"&name="+c.beername)});$("#Camera").jqxButton({template:"primary",width:"150px",theme:theme});$("#Camera").click(function(){c.light_state=100;w=true;window.open(c.webcam_url)});createAbortElements()});
\ No newline at end of file
--- a/www/js/mon_node-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a="getnode.php?uuid='"+my_uuid+"'",b={datatype:"json",datafields:[{name:"record",type:"int"},{name:"uuid",type:"string"},{name:"node",type:"string"},{name:"online",type:"bool"},{name:"group_id",type:"string"},{name:"hardwaremake",type:"string"},{name:"hardwaremodel",type:"string"},{name:"os",type:"string"},{name:"os_version",type:"string"},{name:"firmware",type:"string"},{name:"firstseen",type:"string"},{name:"lastseen",type:"string"},{name:"temperature",type:"float"},{name:"humidity",type:"float"},{name:"barometer",type:"float"},{name:"gps_latitude",type:"float"},{name:"gps_longitude",type:"float"},{name:"gps_altitude",type:"float"},{name:"net_address",type:"string"},{name:"net_ifname",type:"string"},{name:"net_rssi",type:"int"}],id:"record",url:a},c=new $.jqx.dataAdapter(b,{loadComplete:function(e){var d=c.records[0],f="<div id='node_table'>";f+="<table style='width: 100%; padding: 10px;'>";f+="<tr><th colspan=2>Systeem overzicht</th></tr>";f+="<tr><td>Uuid</td><td>"+d.uuid+"</td></tr>";f+="<tr><td>Systeem</td><td>"+d.node+"</td></tr>";f+="<tr><td>Online</td><td>"+d.online+"</td></tr>";f+="<tr><td>Type</td><td>"+d.group_id+"</td></tr>";f+="<tr><td>Eerst gezien</td><td>"+d.firstseen+"</td></tr>";f+="<tr><td>Laatst gezien</td><td>"+d.lastseen+"</td></tr>";f+="<tr><td>Hardware maker</td><td>"+d.hardwaremake+"</td></tr>";f+="<tr><td>Hardware model</td><td>"+d.hardwaremodel+"</td></tr>";f+="<tr><td>OS</td><td>"+d.os+" versie: "+d.os_version+"</td></tr>";f+="<tr><td>Firmware</td><td>"+d.firmware+"</td></tr>";if(d.online){f+="<tr><td>Temperatuur</td><td>"+d.temperature.toFixed(1)+"&deg;C</td></tr>";if(d.humidity>0){f+="<tr><td>Vochtigheid</td><td>"+d.humidity.toFixed(1)+"%</td></tr>"}if(d.barometer>0){f+="<tr><td>Luchtdruk</td><td>"+d.barometer.toFixed(0)+"</td></tr>"}if((d.gps_latitude!=0)&&(d.gps_longitude!=0)){f+="<tr><td>GPS</td><td>"+d.gps_latitude+" "+d.gps_longitude+" "+d.gps_altitude+"</td></tr>"}f+="<tr><td>Netwerk</td><td>"+d.net_ifname+" "+d.net_address+"</td></tr>"}f+="</<table>";f+="</div>";$("#ContentPanel").html(f)}});c.dataBind();setInterval(function(){c.dataBind()},30000)});
\ No newline at end of file
--- a/www/js/prod_archive_code-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"date",type:"string"},{name:"style",type:"string"},{name:"og",type:"float"},{name:"fg",type:"float"},{name:"batch_size",type:"float"},],id:"record",url:"includes/db_product.php?select=archcode"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,columns:[{text:"Code",datafield:"code",width:100},{text:"Naam",datafield:"name"},{text:"Stijl",datafield:"style",width:250},{text:"OG",datafield:"og",width:80,cellsformat:"f3"},{text:"FG",datafield:"fg",width:80,cellsformat:"f3"},{text:"Datum",datafield:"date",width:120},{text:"Liters",datafield:"batch_size",width:80,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"",datafield:"Edit",width:80,align:"center",columntype:"button",cellsrenderer:function(){return"Bekijk"},buttonclick:function(d){var c=b.records[d];window.location.href="prod_edit.php?record="+c.record+"&select=archcode&return=prod_archive_code.php"}}],})});
\ No newline at end of file
--- a/www/js/prod_archive_date-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"year",type:"string"},{name:"date",type:"string"},{name:"style",type:"string"},{name:"og",type:"float"},{name:"fg",type:"float"},{name:"batch_size",type:"float"},],id:"record",url:"includes/db_product.php?select=archdate"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,groupable:true,theme:theme,columns:[{text:"Jaar",datafield:"year",width:80},{text:"Datum",datafield:"date",width:120,menu:false},{text:"Naam",datafield:"name",menu:false},{text:"Stijl",datafield:"style",width:250},{text:"OG",datafield:"og",width:80,cellsformat:"f3",menu:false},{text:"FG",datafield:"fg",width:80,cellsformat:"f3",menu:false},{text:"Code",datafield:"code",width:100,menu:false},{text:"Liters",datafield:"batch_size",width:80,align:"right",cellsalign:"right",cellsformat:"f1",menu:false},{text:"",datafield:"Edit",width:80,align:"center",columntype:"button",cellsrenderer:function(){return"Bekijk"},buttonclick:function(d){var c=b.records[d];window.location.href="prod_edit.php?record="+c.record+"&select=archdate&return=prod_archive_date.php"}}],groups:["year"]})});
\ No newline at end of file
--- a/www/js/prod_archive_name-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"date",type:"string"},{name:"style",type:"string"},{name:"og",type:"float"},{name:"fg",type:"float"},{name:"batch_size",type:"float"},],id:"record",url:"includes/db_product.php?select=archname"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,columns:[{text:"Naam",datafield:"name"},{text:"Stijl",datafield:"style",width:250},{text:"OG",datafield:"og",width:80,cellsformat:"f3"},{text:"FG",datafield:"fg",width:80,cellsformat:"f3"},{text:"Datum",datafield:"date",width:120},{text:"Code",datafield:"code",width:100},{text:"Liters",datafield:"batch_size",width:80,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"",datafield:"Edit",width:80,align:"center",columntype:"button",cellsrenderer:function(){return"Bekijk"},buttonclick:function(d){var c=b.records[d];window.location.href="prod_edit.php?record="+c.record+"&select=archname&return=prod_archive_name.php"}}],})});
\ No newline at end of file
--- a/www/js/prod_divide-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#divide_type").jqxDropDownList({theme:theme,source:SplitAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});function e(){rows=$("#splitGrid").jqxGrid("getrows");c=Round(d,1);for(f=0;f<rows.length;f++){row=rows[f];c-=row.split_size}$("#leftover").val(c)}function k(p){var q,s,o,n=0;q=$("#splitGrid").jqxGrid("getrows");for(o=0;o<q.length;o++){s=q[o];if(o!=p){n+=s.split_size}}g=Round(d-h-n,1);console.log("calcRoom("+p+"):"+n+" room:"+g)}var j={},f,d=0,c=0,h=0,g=0,b="includes/db_product.php",a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"uuid",type:"string"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"birth",type:"string"},{name:"stage",type:"int"},{name:"notes",type:"string"},{name:"log_brew",type:"int"},{name:"log_fermentation",type:"int"},{name:"inventory_reduced",type:"int"},{name:"locked",type:"int"},{name:"eq_name",type:"string"},{name:"eq_boil_size",type:"float"},{name:"eq_batch_size",type:"float"},{name:"eq_tun_volume",type:"float"},{name:"eq_tun_weight",type:"float"},{name:"eq_tun_specific_heat",type:"float"},{name:"eq_tun_material",type:"int"},{name:"eq_tun_height",type:"float"},{name:"eq_top_up_water",type:"float"},{name:"eq_trub_chiller_loss",type:"float"},{name:"eq_evap_rate",type:"float"},{name:"eq_boil_time",type:"float"},{name:"eq_calc_boil_volume",type:"int"},{name:"eq_top_up_kettle",type:"float"},{name:"eq_hop_utilization",type:"float"},{name:"eq_notes",type:"string"},{name:"eq_lauter_volume",type:"float"},{name:"eq_lauter_height",type:"float"},{name:"eq_lauter_deadspace",type:"float"},{name:"eq_kettle_volume",type:"float"},{name:"eq_kettle_height",type:"float"},{name:"eq_mash_volume",type:"float"},{name:"eq_mash_max",type:"float"},{name:"eq_efficiency",type:"float"},{name:"brew_date_start",type:"string"},{name:"brew_mash_ph",type:"float"},{name:"brew_mash_sg",type:"float"},{name:"brew_mash_efficiency",type:"float"},{name:"brew_sparge_est",type:"float"},{name:"brew_sparge_ph",type:"float"},{name:"brew_preboil_volume",type:"float"},{name:"brew_preboil_sg",type:"float"},{name:"brew_preboil_ph",type:"float"},{name:"brew_preboil_efficiency",type:"float"},{name:"brew_aboil_volume",type:"float"},{name:"brew_aboil_sg",type:"float"},{name:"brew_aboil_ph",type:"float"},{name:"brew_aboil_efficiency",type:"float"},{name:"brew_cooling_method",type:"int"},{name:"brew_cooling_time",type:"float"},{name:"brew_cooling_to",type:"float"},{name:"brew_whirlpool9",type:"float"},{name:"brew_whirlpool7",type:"float"},{name:"brew_whirlpool6",type:"float"},{name:"brew_whirlpool2",type:"float"},{name:"brew_fermenter_volume",type:"float"},{name:"brew_fermenter_extrawater",type:"float"},{name:"brew_fermenter_tcloss",type:"float"},{name:"brew_aeration_time",type:"float"},{name:"brew_aeration_speed",type:"float"},{name:"brew_aeration_type",type:"int"},{name:"brew_fermenter_sg",type:"float"},{name:"brew_fermenter_ibu",type:"float"},{name:"brew_fermenter_color",type:"float"},{name:"brew_date_end",type:"string"},{name:"og",type:"float"},{name:"fg",type:"float"},{name:"primary_start_temp",type:"float"},{name:"primary_max_temp",type:"float"},{name:"primary_end_temp",type:"float"},{name:"primary_end_sg",type:"float"},{name:"primary_end_date",type:"string"},{name:"secondary_temp",type:"float"},{name:"secondary_end_sg",type:"float"},{name:"secondary_end_date",type:"string"},{name:"tertiary_temp",type:"float"},{name:"package_date",type:"string"},{name:"package_volume",type:"float"},{name:"package_infuse_amount",type:"float"},{name:"package_infuse_abv",type:"float"},{name:"package_infuse_notes",type:"string"},{name:"package_abv",type:"float"},{name:"package_ph",type:"float"},{name:"bottle_amount",type:"float"},{name:"bottle_carbonation",type:"float"},{name:"bottle_priming_water",type:"float"},{name:"bottle_priming_amount",type:"float"},{name:"bottle_carbonation_temp",type:"float"},{name:"keg_amount",type:"float"},{name:"keg_carbonation",type:"float"},{name:"keg_priming_water",type:"float"},{name:"keg_priming_amount",type:"float"},{name:"keg_carbonation_temp",type:"float"},{name:"keg_forced_carb",type:"int"},{name:"keg_pressure",type:"float"},{name:"taste_notes",type:"string"},{name:"taste_rate",type:"float"},{name:"taste_date",type:"string"},{name:"taste_color",type:"string"},{name:"taste_transparency",type:"string"},{name:"taste_head",type:"string"},{name:"taste_aroma",type:"string"},{name:"taste_taste",type:"string"},{name:"taste_mouthfeel",type:"string"},{name:"taste_aftertaste",type:"string"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"st_category",type:"string"},{name:"st_category_number",type:"float"},{name:"st_type",type:"int"},{name:"st_og_min",type:"float"},{name:"st_og_max",type:"float"},{name:"st_fg_min",type:"float"},{name:"st_fg_max",type:"float"},{name:"st_ibu_min",type:"float"},{name:"st_ibu_max",type:"float"},{name:"st_color_min",type:"float"},{name:"st_color_max",type:"float"},{name:"st_carb_min",type:"float"},{name:"st_carb_max",type:"float"},{name:"st_abv_min",type:"float"},{name:"st_abv_max",type:"float"},{name:"type",type:"int"},{name:"batch_size",type:"float"},{name:"boil_size",type:"float"},{name:"boil_time",type:"float"},{name:"efficiency",type:"float"},{name:"est_og",type:"float"},{name:"est_fg",type:"float"},{name:"est_abv",type:"float"},{name:"est_color",type:"float"},{name:"color_method",type:"int"},{name:"est_ibu",type:"float"},{name:"ibu_method",type:"int"},{name:"est_carb",type:"float"},{name:"sparge_temp",type:"float"},{name:"sparge_ph",type:"float"},{name:"sparge_volume",type:"float"},{name:"sparge_source",type:"int"},{name:"sparge_acid_type",type:"int"},{name:"sparge_acid_perc",type:"float"},{name:"sparge_acid_amount",type:"float"},{name:"mash_ph",type:"float"},{name:"mash_name",type:"string"},{name:"calc_acid",type:"int"},{name:"w1_name",type:"string"},{name:"w1_amount",type:"float"},{name:"w1_calcium",type:"float"},{name:"w1_sulfate",type:"float"},{name:"w1_chloride",type:"float"},{name:"w1_sodium",type:"float"},{name:"w1_magnesium",type:"float"},{name:"w1_total_alkalinity",type:"float"},{name:"w1_ph",type:"float"},{name:"w1_cost",type:"float"},{name:"w2_name",type:"string"},{name:"w2_amount",type:"float"},{name:"w2_calcium",type:"float"},{name:"w2_sulfate",type:"float"},{name:"w2_chloride",type:"float"},{name:"w2_sodium",type:"float"},{name:"w2_magnesium",type:"float"},{name:"w2_total_alkalinity",type:"float"},{name:"w2_ph",type:"float"},{name:"w2_cost",type:"float"},{name:"wg_amount",type:"float"},{name:"wg_calcium",type:"float"},{name:"wg_sulfate",type:"float"},{name:"wg_chloride",type:"float"},{name:"wg_sodium",type:"float"},{name:"wg_magnesium",type:"float"},{name:"wg_total_alkalinity",type:"float"},{name:"wg_ph",type:"float"},{name:"wb_calcium",type:"float"},{name:"wb_sulfate",type:"float"},{name:"wb_chloride",type:"float"},{name:"wb_sodium",type:"float"},{name:"wb_magnesium",type:"float"},{name:"wb_total_alkalinity",type:"float"},{name:"wb_ph",type:"float"},{name:"wa_acid_name",type:"int"},{name:"wa_acid_perc",type:"int"},{name:"wa_base_name",type:"int"},{name:"starter_enable",type:"int"},{name:"starter_type",type:"int"},{name:"starter_sg",type:"float"},{name:"starter_viability",type:"int"},{name:"starter_viability",type:"int"},{name:"prop1_type",type:"int"},{name:"prop1_volume",type:"float"},{name:"prop2_type",type:"int"},{name:"prop2_volume",type:"float"},{name:"prop3_type",type:"int"},{name:"prop3_volume",type:"float"},{name:"prop4_type",type:"int"},{name:"prop4_volume",type:"float"},{name:"divide_type",type:"int"},{name:"divide_size",type:"float"},{name:"divide_parts",type:"int"},{name:"fermentables",type:"string"},{name:"hops",type:"string"},{name:"miscs",type:"string"},{name:"yeasts",type:"string"},{name:"mashs",type:"string"}],id:"record",url:b+"?record="+my_record},l=new $.jqx.dataAdapter(a,{loadComplete:function(){var i=l.records;j=i[0];$("#name").val(j.name);$("#code").val(j.code);$("#stage").val(StageData[j.stage].nl);for(f=0;f<SplitData.length;f++){console.log("i:"+f+" ok:"+SplitData[f].ok+" stage:"+j.stage);if(SplitData[f].ok<j.stage){$("#divide_type").jqxDropDownList("disableAt",f)}}},loadError:function(o,i,n){},beforeLoadComplete:function(i){$("#jqxLoader").jqxLoader("open")}});durl="includes/db_divides.php",dividerec={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"divide_from",type:"string"},{name:"divide_type",type:"int"},{name:"divide_size",type:"float"},{name:"name",type:"string"},{name:"code",type:"string"}],id:"record",url:durl+"?record="+my_record};var m=function(o){var i={datatype:"local",cache:false,async:false,datafields:[{name:"split_code",type:"string"},{name:"split_name",type:"string"},{name:"split_size",type:"float"}],addrow:function(q,s,p,r){console.log("split addrow "+q);r(true)},deleterow:function(p,q){console.log("split deleterow "+p);q(true)}},n=new $.jqx.dataAdapter(i,{});$("#splitGrid").jqxGrid({width:1240,height:375,source:n,editable:true,enabletooltips:true,selectionmode:"singlecell",editmode:"click",theme:theme,showtoolbar:true,rendertoolbar:function(q){var p=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');q.append(p);p.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe splitsing" />');p.append('<input style="float: left; margin-left: 565px;" id="sdeleterowbutton" type="button" value="Verwijder splitsing" />');$("#saddrowbutton").jqxButton({template:"primary",theme:theme,disabled:true,height:27,width:150});$("#saddrowbutton").on("click",function(){var r={},s=$("#splitGrid").jqxGrid("getdatainformation").rowscount;r.split_code=j.code+"-"+(s+1);r.split_name=j.name+" "+(s+1);r.split_size=0;$("#splitGrid").jqxGrid("addrow",null,r);$("#sdeleterowbutton").jqxButton({disabled:false});$("#divide_type").jqxDropDownList({disabled:true})});$("#sdeleterowbutton").jqxButton({template:"danger",theme:theme,disabled:true,height:27,width:150});$("#sdeleterowbutton").on("click",function(){var t,s,r;t=$("#splitGrid").jqxGrid("getdatainformation").rowscount;s=$("#splitGrid").jqxGrid("getrowid",t-1);r=$("#splitGrid").jqxGrid("getrowdata",s);c+=r.split_size;if(c>d){c=d}$("#leftover").val(c);$("#splitGrid").jqxGrid("deleterow",s);if(t==1){$("#sdeleterowbutton").jqxButton({disabled:true});$("#divide_type").jqxDropDownList({disabled:false})}})},columns:[{text:"Splits code",datafield:"split_code",width:120,editable:false},{text:"Splits naam",datafield:"split_name"},{text:"Splits volume",datafield:"split_size",width:120,align:"right",cellsalign:"right",cellsformat:"f1",columntype:"numberinput",validation:function(p,q){if(q<0||q>g){return{result:false,message:"Volume should be between 0 and "+g+" liter"}}return true},createeditor:function(r,p,q){q.jqxNumberInput({decimalDigits:1,digits:3})}}]});$("#splitGrid").on("cellbeginedit",function(q){var p=q.args;k(p.rowindex)});$("#splitGrid").on("cellvaluechanged",function(q){var p=q.args;e()})};l.dataBind();m(j);$("#name").jqxTooltip({content:"De naam voor dit product."});$("#name").jqxInput({theme:theme,width:640,height:23});$("#code").jqxTooltip({content:"Product code nummer."});$("#code").jqxInput({theme:theme,width:100,height:23});$("#stage").jqxTooltip({content:"De productie fase van dit product."});$("#stage").jqxInput({theme:theme,width:100,height:23});$("#available").jqxNumberInput(Show1dec);$("#leftover").jqxNumberInput(Show1dec);$("#divide_type").val(0);$("#divide_type").on("change",function(n){var i=n.args.index;console.log("divide_type:"+i);j.divide_type=i;switch(i){case 0:d=0;break;case 1:d=j.boil_size;break;case 2:d=j.batch_size;break;case 3:d=j.brew_fermenter_volume;break;case 4:case 5:d=Round(j.brew_fermenter_volume*0.92,1);break;case 6:d=j.package_volume;break}c=d;h=Round(0.1*d,1);$("#available").val(d);$("#leftover").val(c);if(i!=0){$("#saddrowbutton").jqxButton({disabled:false})}else{$("#saddrowbutton").jqxButton({disabled:true})}});$("#Cancel").jqxButton({template:"primary",width:"80px",theme:theme});$("#Cancel").bind("click",function(){window.location.href=my_return});$("#Save").jqxButton({template:"success",width:"80px",theme:theme});$("#Save").bind("click",function(){var p,q,n,r,o;if(c!=d){console.log("Save and there are splits");r={};r.divide_from=j.uuid;r.divide_type=j.divide_type;r.divide_size=c;r.divide_part=0;r.name=j.name;r.code=j.code;o="insert=true&"+$.param(r);$.ajax({dataType:"json",url:durl,cache:false,data:o,type:"POST",success:function(s,i,t){console.log("insert divides: 0")},error:function(i,t,s){console.log("insert divides: "+t)}});p=$("#splitGrid").jqxGrid("getrows");for(n=0;n<p.length;n++){q=p[n];console.log("split "+n);r={};r.divide_from=j.uuid;r.divide_type=j.divide_type;r.divide_size=q.split_size;r.divide_part=n+1;r.name=q.split_name;r.code=q.split_code;o="insert=true&"+$.param(r);$.ajax({dataType:"json",url:durl,cache:false,data:o,type:"POST",success:function(s,i,t){console.log("insert divides: "+n)},error:function(i,t,s){console.log("insert divides: "+t)}})}r={};r.record=j.record;r.divide_type=j.divide_type;r.divide_size=c;r.divide_parts=n;o="splitit=true&"+$.param(r);$.ajax({dataType:"json",url:b,cache:false,data:o,type:"POST",success:function(s,i,t){console.log("updated products")},error:function(i,t,s){console.log("updated products: "+t)}})}window.location.href=my_return})});
\ No newline at end of file
--- a/www/js/prod_edit-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){var ae,l=false,al=0,aZ=0,a1=0,I=0,ac=0,aD=77,ap=0,x=0.75,aa=0,p=1,ab=1,ai=1,P=1,c=1,aY=0,V=0,C=0,aU="",ag="",A=40.048,aq=24.305,ad=22.98976928,q=35.453,aI=96.0626,r=61.01684,an=172.171,T=147.015,g=100.087,aK=246.475,aF=84.007,y=105.996,b=58.443,aJ=74.06268,u=0,aL={},B=1,a=0,e={},aw=0,aH={},aE=0,f={},ak=0,D={},aA=4.445e-7,ay=4.68e-11,d={},E="includes/db_product.php",H=0.87,aR={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"uuid",type:"string"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"birth",type:"string"},{name:"stage",type:"int"},{name:"notes",type:"string"},{name:"log_brew",type:"int"},{name:"log_fermentation",type:"int"},{name:"inventory_reduced",type:"int"},{name:"locked",type:"int"},{name:"eq_name",type:"string"},{name:"eq_boil_size",type:"float"},{name:"eq_batch_size",type:"float"},{name:"eq_tun_volume",type:"float"},{name:"eq_tun_weight",type:"float"},{name:"eq_tun_specific_heat",type:"float"},{name:"eq_tun_material",type:"int"},{name:"eq_tun_height",type:"float"},{name:"eq_top_up_water",type:"float"},{name:"eq_trub_chiller_loss",type:"float"},{name:"eq_evap_rate",type:"float"},{name:"eq_boil_time",type:"float"},{name:"eq_calc_boil_volume",type:"int"},{name:"eq_top_up_kettle",type:"float"},{name:"eq_hop_utilization",type:"float"},{name:"eq_notes",type:"string"},{name:"eq_lauter_volume",type:"float"},{name:"eq_lauter_height",type:"float"},{name:"eq_lauter_deadspace",type:"float"},{name:"eq_kettle_volume",type:"float"},{name:"eq_kettle_height",type:"float"},{name:"eq_mash_volume",type:"float"},{name:"eq_mash_max",type:"float"},{name:"eq_efficiency",type:"float"},{name:"brew_date_start",type:"string"},{name:"brew_mash_ph",type:"float"},{name:"brew_mash_sg",type:"float"},{name:"brew_mash_efficiency",type:"float"},{name:"brew_sparge_est",type:"float"},{name:"brew_sparge_ph",type:"float"},{name:"brew_preboil_volume",type:"float"},{name:"brew_preboil_sg",type:"float"},{name:"brew_preboil_ph",type:"float"},{name:"brew_preboil_efficiency",type:"float"},{name:"brew_aboil_volume",type:"float"},{name:"brew_aboil_sg",type:"float"},{name:"brew_aboil_ph",type:"float"},{name:"brew_aboil_efficiency",type:"float"},{name:"brew_cooling_method",type:"int"},{name:"brew_cooling_time",type:"float"},{name:"brew_cooling_to",type:"float"},{name:"brew_whirlpool9",type:"float"},{name:"brew_whirlpool7",type:"float"},{name:"brew_whirlpool6",type:"float"},{name:"brew_whirlpool2",type:"float"},{name:"brew_fermenter_volume",type:"float"},{name:"brew_fermenter_extrawater",type:"float"},{name:"brew_fermenter_tcloss",type:"float"},{name:"brew_aeration_time",type:"float"},{name:"brew_aeration_speed",type:"float"},{name:"brew_aeration_type",type:"int"},{name:"brew_fermenter_sg",type:"float"},{name:"brew_fermenter_ibu",type:"float"},{name:"brew_fermenter_color",type:"float"},{name:"brew_date_end",type:"string"},{name:"og",type:"float"},{name:"fg",type:"float"},{name:"primary_start_temp",type:"float"},{name:"primary_max_temp",type:"float"},{name:"primary_end_temp",type:"float"},{name:"primary_end_sg",type:"float"},{name:"primary_end_date",type:"string"},{name:"secondary_temp",type:"float"},{name:"secondary_end_sg",type:"float"},{name:"secondary_end_date",type:"string"},{name:"tertiary_temp",type:"float"},{name:"package_date",type:"string"},{name:"package_volume",type:"float"},{name:"package_infuse_amount",type:"float"},{name:"package_infuse_abv",type:"float"},{name:"package_infuse_notes",type:"string"},{name:"package_abv",type:"float"},{name:"package_ph",type:"float"},{name:"bottle_amount",type:"float"},{name:"bottle_carbonation",type:"float"},{name:"bottle_priming_water",type:"float"},{name:"bottle_priming_amount",type:"float"},{name:"bottle_carbonation_temp",type:"float"},{name:"keg_amount",type:"float"},{name:"keg_carbonation",type:"float"},{name:"keg_priming_water",type:"float"},{name:"keg_priming_amount",type:"float"},{name:"keg_carbonation_temp",type:"float"},{name:"keg_forced_carb",type:"int"},{name:"keg_pressure",type:"float"},{name:"taste_notes",type:"string"},{name:"taste_rate",type:"float"},{name:"taste_date",type:"string"},{name:"taste_color",type:"string"},{name:"taste_transparency",type:"string"},{name:"taste_head",type:"string"},{name:"taste_aroma",type:"string"},{name:"taste_taste",type:"string"},{name:"taste_mouthfeel",type:"string"},{name:"taste_aftertaste",type:"string"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"st_category",type:"string"},{name:"st_category_number",type:"float"},{name:"st_type",type:"int"},{name:"st_og_min",type:"float"},{name:"st_og_max",type:"float"},{name:"st_fg_min",type:"float"},{name:"st_fg_max",type:"float"},{name:"st_ibu_min",type:"float"},{name:"st_ibu_max",type:"float"},{name:"st_color_min",type:"float"},{name:"st_color_max",type:"float"},{name:"st_carb_min",type:"float"},{name:"st_carb_max",type:"float"},{name:"st_abv_min",type:"float"},{name:"st_abv_max",type:"float"},{name:"type",type:"int"},{name:"batch_size",type:"float"},{name:"boil_size",type:"float"},{name:"boil_time",type:"float"},{name:"efficiency",type:"float"},{name:"est_og",type:"float"},{name:"est_fg",type:"float"},{name:"est_abv",type:"float"},{name:"est_color",type:"float"},{name:"color_method",type:"int"},{name:"est_ibu",type:"float"},{name:"ibu_method",type:"int"},{name:"est_carb",type:"float"},{name:"sparge_temp",type:"float"},{name:"sparge_ph",type:"float"},{name:"sparge_volume",type:"float"},{name:"sparge_source",type:"int"},{name:"sparge_acid_type",type:"int"},{name:"sparge_acid_perc",type:"float"},{name:"sparge_acid_amount",type:"float"},{name:"mash_ph",type:"float"},{name:"mash_name",type:"string"},{name:"calc_acid",type:"int"},{name:"w1_name",type:"string"},{name:"w1_amount",type:"float"},{name:"w1_calcium",type:"float"},{name:"w1_sulfate",type:"float"},{name:"w1_chloride",type:"float"},{name:"w1_sodium",type:"float"},{name:"w1_magnesium",type:"float"},{name:"w1_total_alkalinity",type:"float"},{name:"w1_ph",type:"float"},{name:"w1_cost",type:"float"},{name:"w2_name",type:"string"},{name:"w2_amount",type:"float"},{name:"w2_calcium",type:"float"},{name:"w2_sulfate",type:"float"},{name:"w2_chloride",type:"float"},{name:"w2_sodium",type:"float"},{name:"w2_magnesium",type:"float"},{name:"w2_total_alkalinity",type:"float"},{name:"w2_ph",type:"float"},{name:"w2_cost",type:"float"},{name:"wg_amount",type:"float"},{name:"wg_calcium",type:"float"},{name:"wg_sulfate",type:"float"},{name:"wg_chloride",type:"float"},{name:"wg_sodium",type:"float"},{name:"wg_magnesium",type:"float"},{name:"wg_total_alkalinity",type:"float"},{name:"wg_ph",type:"float"},{name:"wb_calcium",type:"float"},{name:"wb_sulfate",type:"float"},{name:"wb_chloride",type:"float"},{name:"wb_sodium",type:"float"},{name:"wb_magnesium",type:"float"},{name:"wb_total_alkalinity",type:"float"},{name:"wb_ph",type:"float"},{name:"wa_acid_name",type:"int"},{name:"wa_acid_perc",type:"int"},{name:"wa_base_name",type:"int"},{name:"starter_enable",type:"int"},{name:"starter_type",type:"int"},{name:"starter_sg",type:"float"},{name:"starter_viability",type:"int"},{name:"prop1_type",type:"int"},{name:"prop1_volume",type:"float"},{name:"prop2_type",type:"int"},{name:"prop2_volume",type:"float"},{name:"prop3_type",type:"int"},{name:"prop3_volume",type:"float"},{name:"prop4_type",type:"int"},{name:"prop4_volume",type:"float"},{name:"divide_type",type:"int"},{name:"divide_size",type:"float"},{name:"divide_parts",type:"int"},{name:"fermentables",type:"array"},{name:"hops",type:"array"},{name:"miscs",type:"array"},{name:"yeasts",type:"array"},{name:"mashs",type:"array"}],id:"record",url:E+"?record="+my_record},ah=new $.jqx.dataAdapter(aR,{loadComplete:function(){var i=ah.records;d=i[0];$("#name").val(d.name);$("#code").val(d.code);$("#birth").val(d.birth);$("#stage").val(StageData[d.stage].nl);$("#notes").val(d.notes);$("#locked").val(d.locked);$("#eq_name").val(d.eq_name);$("#eq_notes").val(d.eq_notes);$("#eq_boil_size").val(d.eq_boil_size);$("#eq_batch_size").val(d.eq_batch_size);$("#eq_tun_volume").val(d.eq_tun_volume);$("#eq_top_up_water").val(d.eq_top_up_water);$("#eq_trub_chiller_loss").val(d.eq_trub_chiller_loss);$("#eq_evap_rate").val(d.eq_evap_rate);$("#eq_boil_time").val(d.eq_boil_time);$("#eq_top_up_kettle").val(d.eq_top_up_kettle);$("#eq_hop_utilization").val(d.eq_hop_utilization);$("#eq_lauter_volume").val(d.eq_lauter_volume);$("#eq_lauter_deadspace").val(d.eq_lauter_deadspace);$("#eq_kettle_volume").val(d.eq_kettle_volume);$("#eq_mash_volume").val(d.eq_mash_volume);$("#eq_mash_max").val(d.eq_mash_max);$("#eq_efficiency").val(d.eq_efficiency);$("#brew_date_start").val(d.brew_date_start);$("#brew_mash_ph").val(d.brew_mash_ph);$("#brew_mash_sg").val(d.brew_mash_sg);$("#brew_mash_efficiency").val(d.brew_mash_efficiency);$("#brew_sparge_temperature").val(d.sparge_temp);$("#brew_sparge_volume").val(d.sparge_volume);$("#brew_sparge_est").val(d.brew_sparge_est);$("#brew_sparge_ph").val(d.brew_sparge_ph);$("#brew_aeration_type").val(d.brew_aeration_type);$("#brew_aeration_time").val(d.brew_aeration_time);$("#brew_aeration_speed").val(d.brew_aeration_speed);$("#brew_preboil_ph").val(d.brew_preboil_ph);$("#brew_preboil_sg").val(d.brew_preboil_sg);$("#brew_preboil_volume").val(d.brew_preboil_volume);$("#brew_preboil_efficiency").val(d.brew_preboil_efficiency);$("#brew_whirlpool9").val(d.brew_whirlpool9);$("#brew_whirlpool7").val(d.brew_whirlpool7);$("#brew_whirlpool6").val(d.brew_whirlpool6);$("#brew_whirlpool2").val(d.brew_whirlpool2);$("#brew_fermenter_volume").val(d.brew_fermenter_volume);$("#brew_fermenter_sg").val(d.brew_fermenter_sg);$("#brew_fermenter_sg2").val(d.brew_fermenter_sg);$("#brew_fermenter_ibu").val(d.brew_fermenter_ibu);$("#brew_fermenter_color").val(d.brew_fermenter_color);$("#brew_fermenter_extrawater").val(d.brew_fermenter_extrawater);$("#brew_fermenter_tcloss").val(d.brew_fermenter_tcloss);$("#brew_aboil_ph").val(d.brew_aboil_ph);$("#brew_aboil_sg").val(d.brew_aboil_sg);$("#brew_aboil_volume").val(d.brew_aboil_volume);$("#brew_aboil_efficiency").val(d.brew_aboil_efficiency);$("#brew_cooling_to").val(d.brew_cooling_to);$("#brew_cooling_method").val(d.brew_cooling_method);$("#brew_cooling_time").val(d.brew_cooling_time);$("#brew_date_end").val(d.brew_date_end);$("#og").val(d.og);$("#fg").val(d.fg);$("#primary_start_temp").val(d.primary_start_temp);$("#primary_max_temp").val(d.primary_max_temp);$("#primary_end_temp").val(d.primary_end_temp);$("#primary_end_sg").val(d.primary_end_sg);$("#primary_end_date").val(d.primary_end_date);$("#secondary_temp").val(d.secondary_temp);$("#secondary_end_sg").val(d.secondary_end_sg);$("#secondary_end_date").val(d.secondary_end_date);$("#tertiary_temp").val(d.tertiary_temp);$("#package_date").val(d.package_date);$("#package_volume").val(d.package_volume);$("#package_infuse_amount").val(d.package_infuse_amount);$("#package_infuse_abv").val(d.package_infuse_abv);$("#package_infuse_notes").val(d.package_infuse_notes);$("#package_abv").val(d.package_abv);$("#package_ph").val(d.package_ph);$("#bottle_amount").val(d.bottle_amount);$("#bottle_carbonation").val(d.bottle_carbonation);$("#bottle_priming_water").val(d.bottle_priming_water);$("#bottle_priming_amount").val(d.bottle_priming_amount);$("#bottle_carbonation_temp").val(d.bottle_carbonation_temp);$("#keg_amount").val(d.keg_amount);$("#keg_carbonation").val(d.keg_carbonation);$("#keg_priming_water").val(d.keg_priming_water);$("#keg_priming_amount").val(d.keg_priming_amount);$("#keg_carbonation_temp").val(d.keg_carbonation_temp);$("#keg_forced_carb").val(d.keg_forced_carb);$("#keg_pressure").val(d.keg_pressure);$("#taste_notes").val(d.taste_notes);$("#taste_rate").val(d.taste_rate);$("#taste_date").val(d.taste_date);$("#taste_color").val(d.taste_color);$("#taste_transparency").val(d.taste_transparency);$("#taste_head").val(d.taste_head);$("#taste_aroma").val(d.taste_aroma);$("#taste_taste").val(d.taste_taste);$("#taste_mouthfeel").val(d.taste_mouthfeel);$("#taste_aftertaste").val(d.taste_aftertaste);$("#st_name").val(d.st_name);$("#st_letter").val(d.st_letter);$("#st_guide").val(d.st_guide);$("#st_category").val(d.st_category);$("#st_category_number").val(d.st_category_number);$("#st_type").val(StyleTypeData[d.st_type].nl);$("#st_og_min").val(d.st_og_min);$("#st_og_max").val(d.st_og_max);$("#st_fg_min").val(d.st_fg_min);$("#st_fg_max").val(d.st_fg_max);$("#st_abv_min").val(d.st_abv_min);$("#st_abv_max").val(d.st_abv_max);$("#st_color_min").val(d.st_color_min);$("#st_color_max").val(d.st_color_max);$("#st_ibu_min").val(d.st_ibu_min);$("#st_ibu_max").val(d.st_ibu_max);$("#st_carb_min").val(d.st_carb_min);$("#st_carb_min2").val(d.st_carb_min);$("#st_carb_max").val(d.st_carb_max);$("#st_carb_max2").val(d.st_carb_max);$("#type").val(d.type);$("#batch_size").val(d.batch_size);$("#est_a_vol").val(d.batch_size*1.04);$("#boil_size").val(d.boil_size);$("#est_pre_vol").val(d.boil_size*1.04);$("#boil_time").val(d.boil_time);$("#efficiency").val(d.efficiency);$("#est_og").val(d.est_og);$("#est_og2").val(d.est_og);$("#est_og3").val(0);$("#est_fg").val(d.est_fg);$("#est_fg2").val(d.est_fg);$("#est_fg3").val(d.est_fg);$("#est_color").val(d.est_color);$("#est_color2").val(d.est_color);$("#est_abv").val(d.est_abv);$("#color_method").val(d.color_method);$("#est_ibu").val(d.est_ibu);$("#est_ibu2").val(d.est_ibu);$("#ibu_method").val(d.ibu_method);$("#est_carb").val(d.est_carb);$("#mash_name").val(d.mash_name);$("#mash_ph").val(d.mash_ph);$("#sparge_temp").val(d.sparge_temp);$("#sparge_ph").val(d.sparge_ph);$("#sparge_volume").val(d.sparge_volume);$("#sparge_source").val(d.sparge_source);$("#sparge_acid_type").val(d.sparge_acid_type);$("#sparge_acid_perc").val(d.sparge_acid_perc);$("#sparge_acid_amount").val(d.sparge_acid_amount*1000);$("#calc_acid").val(d.calc_acid);$("#w1_name").val(d.w1_name);$("#w1_amount").val(d.w1_amount);$("#w1_calcium").val(d.w1_calcium);$("#w1_sulfate").val(d.w1_sulfate);$("#w1_chloride").val(d.w1_chloride);$("#w1_sodium").val(d.w1_sodium);$("#w1_magnesium").val(d.w1_magnesium);$("#w1_total_alkalinity").val(d.w1_total_alkalinity);$("#w1_ph").val(d.w1_ph);$("#w1_cost").val(d.w1_cost);$("#w2_name").val(d.w2_name);$("#w2_amount").val(d.w2_amount);$("#w2_calcium").val(d.w2_calcium);$("#w2_sulfate").val(d.w2_sulfate);$("#w2_chloride").val(d.w2_chloride);$("#w2_sodium").val(d.w2_sodium);$("#w2_magnesium").val(d.w2_magnesium);$("#w2_total_alkalinity").val(d.w2_total_alkalinity);$("#w2_ph").val(d.w2_ph);$("#w2_cost").val(d.w2_cost);$("#wg_amount").val(d.wg_amount);$("#wg_calcium").val(d.wg_calcium);$("#wg_sulfate").val(d.wg_sulfate);$("#wg_chloride").val(d.wg_chloride);$("#wg_sodium").val(d.wg_sodium);$("#wg_magnesium").val(d.wg_magnesium);$("#wg_total_alkalinity").val(d.wg_total_alkalinity);$("#wg_ph").val(d.wg_ph);$("#wb_calcium").val(d.wb_calcium);$("#wb_sulfate").val(d.wb_sulfate);$("#wb_chloride").val(d.wb_chloride);$("#wb_sodium").val(d.wb_sodium);$("#wb_magnesium").val(d.wb_magnesium);$("#wb_total_alkalinity").val(d.wb_total_alkalinity);$("#wb_ph").val(d.wb_ph);$("#wa_acid_name").val(d.wa_acid_name);$("#wa_acid_perc").val(d.wa_acid_perc);$("#wa_base_name").val(d.wa_base_name);$("#starter_enable").val(d.starter_enable);$("#starter_type").val(d.starter_type);$("#starter_sg").val(d.starter_sg);$("#starter_viability").val(d.starter_viability);$("#prop1_type").val(d.prop1_type);$("#prop1_volume").val(d.prop1_volume);$("#prop2_type").val(d.prop2_type);$("#prop2_volume").val(d.prop2_volume);$("#prop3_type").val(d.prop3_type);$("#prop3_volume").val(d.prop3_volume);$("#prop4_type").val(d.prop4_type);$("#prop4_volume").val(d.prop4_volume);$("#divide_type").val(SplitData[d.divide_type].nl);$("#divide_parts").val(d.divide_parts);n(d);aT(d);X(d);aM(d);av(d);aV();$("#jqxTabs").jqxTabs("select",2)},loadError:function(a4,i,a3){},beforeLoadComplete:function(i){$("#jqxLoader").jqxLoader("open")}});var n=function(a3){var i={localdata:a3.fermentables,datatype:"local",cache:false,async:false,datafields:[{name:"f_name",type:"string"},{name:"f_origin",type:"string"},{name:"f_supplier",type:"string"},{name:"f_amount",type:"float"},{name:"f_cost",type:"float"},{name:"f_type",type:"int"},{name:"f_yield",type:"float"},{name:"f_color",type:"float"},{name:"f_coarse_fine_diff",type:"float"},{name:"f_moisture",type:"float"},{name:"f_diastatic_power",type:"float"},{name:"f_protein",type:"float"},{name:"f_max_in_batch",type:"float"},{name:"f_graintype",type:"int"},{name:"f_added",type:"int"},{name:"f_dissolved_protein",type:"float"},{name:"f_recommend_mash",type:"int"},{name:"f_add_after_boil",type:"int"},{name:"f_adjust_to_total_100",type:"int"},{name:"f_percentage",type:"float"},{name:"f_di_ph",type:"float"},{name:"f_acid_to_ph_57",type:"float"},{name:"f_inventory",type:"float"},{name:"f_avail",type:"int"}],addrow:function(a6,a8,a5,a7){a7(true)},deleterow:function(a5,a6){a6(true)},updaterow:function(a5,a7,a6){a6(true)}},a4=new $.jqx.dataAdapter(i);$("#fermentableGrid").jqxGrid({width:1240,height:470,source:a4,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a6){var a5=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a6.append(a5);a5.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>');a5.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a5.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>');a5.append('<input style="float: left; margin-left: 400px;" id="fdeleterowbutton" type="button" value="Verwijder mout" />');$("#faddrowbutton").jqxDropDownList({placeHolder:"Kies mout:",theme:theme,template:"primary",source:fermentablelist,displayMember:"name",disabled:(d.stage>3),width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(a8,a7,ba){var a9=fermentablelist.records[a8];return a9.supplier+" / "+a9.name+" ("+a9.color+" EBC)"}});$("#faddrowbutton").on("select",function(a9){if(a9.args){var a7,a8,ba={},bb=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;a7=a9.args.index;a8=fermentablelist.records[a7];ba.f_name=a8.name;ba.f_origin=a8.origin;ba.f_supplier=a8.supplier;ba.f_amount=0;ba.f_cost=a8.cost;ba.f_type=a8.type;ba.f_yield=a8.yield;ba.f_color=a8.color;ba.f_coarse_fine_diff=a8.coarse_fine_diff;ba.f_moisture=a8.moisture;ba.f_diastatic_power=a8.diastatic_power;ba.f_protein=a8.protein;ba.f_max_in_batch=a8.max_in_batch;ba.f_graintype=a8.graintype;if(a8.add_after_boil){ba.f_added=2}else{if((a8.type==1)||(a8.type==4)){ba.f_added=1}else{ba.f_added=0}}ba.f_dissolved_protein=a8.dissolved_protein;ba.f_recommend_mash=a8.recommend_mash;ba.f_add_after_boil=a8.add_after_boil;if(bb==0){ba.f_adjust_to_total_100=1;ba.f_percentage=100}else{ba.f_adjust_to_total_100=0;ba.f_percentage=0}ba.f_di_ph=a8.di_ph;ba.f_acid_to_ph_57=a8.acid_to_ph_57;ba.f_inventory=a8.inventory;$("#fermentableGrid").jqxGrid("addrow",null,ba)}});$("#finstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#finstockbutton").on("change",function(a7){fermentableinstock=a7.args.checked;fermentablelist.dataBind()});$("#fdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#fdeleterowbutton").on("click",function(){var bd,bc,ba,a9,a8,bb,a7=$("#fermentableGrid").jqxGrid("getselectedrowindex");bd=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(a7>=0&&a7<bd){bc=$("#fermentableGrid").jqxGrid("getrowid",a7);ba=$("#fermentableGrid").jqxGrid("getcellvalue",bc,"f_percentage");a9=$("#fermentableGrid").jqxGrid("getcellvalue",bc,"f_amount");$("#fermentableGrid").jqxGrid("deleterow",bc)}bd=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(bd>1){if(l){for(a8=0;a8<bd;a8++){bb=$("#fermentableGrid").jqxGrid("getrowdata",a8);if(bb.f_adjust_to_total_100){bb.f_percentage+=ba;bb.f_amount+=a9}}}else{aW()}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}U();at()})},ready:function(){U();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Vergistbaar ingredi&euml;nt",datafield:"f_name",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+ba.f_supplier+" / "+ba.f_name+" ("+ba.f_color+" EBC)</span>"}},{text:"Type",width:100,datafield:"f_type",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+FermentableTypeData[a9].nl+"</span>"}},{text:"Moment",width:110,datafield:"f_added",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+AddedData[a9].nl+"</span>"}},{text:"Maxinbatch",datafield:"f_max_in_batch",hidden:true},{text:"Opbrengst",datafield:"f_yield",width:90,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gewicht Kg",datafield:"f_amount",width:120,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"Voorraad Kg",datafield:"f_inventory",width:120,align:"right",cellsrenderer:function(a9,a7,a8,a5,bb,ba){var a6="#ffffff";if(((d.inventory_reduced<=2)&&(ba.f_added<=1))||((d.inventory_reduced<=3)&&(ba.f_added==2))||((d.inventory_reduced<=5)&&(ba.f_added==3))||((d.inventory_reduced<=6)&&(ba.f_added==4))||((d.inventory_reduced<=6)&&(ba.f_added==5))){if(a8<ba.f_amount){a6="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a6+';">'+a4.formatNumber(a8,"f3")+"</span>"}else{return"<span></span>"}}},{text:"Procent",datafield:"f_percentage",width:90,align:"right",cellsrenderer:function(a9,a7,a8,a5,bb,ba){if(ba.f_added>=4){return"<span></span>"}var a6="#ffffff";if(a8>ba.f_max_in_batch){a6="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a6+';">'+a4.formatNumber(a8,"p1")+"</span>"}},{text:"100%",datafield:"f_adjust_to_total_100",width:70,align:"center",cellsalign:"center",cellsrenderer:function(a6,a5,a9,a8,a7,ba){if(a9==0){return"<span></span>"}return'<span><img style="float:left; margin-left:25px; margin-top:4px;" src="images/dialog-ok-apply.png"></span>'}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a5){u=a5;aL=$("#fermentableGrid").jqxGrid("getrowdata",u);if(aL.f_added>=4){alert("Wijzig dit in de Verpakken tab")}else{if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{$("#wf_name").val(aL.f_name);$("#wf_amount").val(aL.f_amount);$("#wf_percentage").val(aL.f_percentage);$("#wf_max_in_batch").val(aL.f_max_in_batch);$("#wf_adjust_to_total_100").val(aL.f_adjust_to_total_100);$("#wf_added").val(aL.f_added);$("#popupFermentable").jqxWindow("open")}}}}]})},aT=function(i){var a4={localdata:i.hops,datatype:"local",cache:false,async:false,datafields:[{name:"h_name",type:"string"},{name:"h_origin",type:"string"},{name:"h_amount",type:"float"},{name:"h_cost",type:"float"},{name:"h_type",type:"int"},{name:"h_form",type:"int"},{name:"h_useat",type:"int"},{name:"h_time",type:"float"},{name:"h_alpha",type:"float"},{name:"h_beta",type:"float"},{name:"h_hsi",type:"float"},{name:"h_humulene",type:"float"},{name:"h_caryophyllene",type:"float"},{name:"h_cohumulone",type:"float"},{name:"h_myrcene",type:"float"},{name:"h_total_oil",type:"float"},{name:"h_inventory",type:"float"},{name:"h_avail",type:"int"}],addrow:function(a6,a8,a5,a7){console.log("hop addrow "+a6);a7(true)},deleterow:function(a5,a6){console.log("hop deleterow "+a5);a6(true)},updaterow:function(a5,a7,a6){console.log("hop updaterow "+a5);a6(true)}},a3=new $.jqx.dataAdapter(a4);$("#hopGrid").jqxGrid({width:1240,height:560,source:a3,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a6){var a5=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a6.append(a5);a5.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>');a5.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a5.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>');a5.append('<input style="float: left; margin-left: 400px;" id="hdeleterowbutton" type="button" value="Verwijder hop" />');$("#haddrowbutton").jqxDropDownList({placeHolder:"Kies hop:",theme:theme,template:"primary",source:hoplist,disabled:(d.stage>3),displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(a8,a7,ba){var a9=hoplist.records[a8];return a9.origin+" - "+a9.name+" / "+HopFormData[a9.form].nl+" ("+a9.alpha+"% &alpha;)"}});$("#haddrowbutton").on("select",function(a9){if(a9.args){var a8,ba={},a7=a9.args.index;a8=hoplist.records[a7];ba.h_name=a8.name;ba.h_origin=a8.origin;ba.h_amount=0;ba.h_cost=a8.cost;ba.h_type=a8.type;ba.h_form=a8.form;ba.h_useat=2;ba.h_time=0;ba.h_alpha=a8.alpha;ba.h_beta=a8.beta;ba.h_hsi=a8.hsi;ba.h_humulene=a8.humulene;ba.h_caryophyllene=a8.caryophyllene;ba.h_cohumulone=a8.cohumulone;ba.h_myrcene=a8.myrcene;ba.h_total_oil=a8.total_oil;ba.h_inventory=a8.inventory;$("#hopGrid").jqxGrid("addrow",null,ba)}$("#haddrowbutton").jqxDropDownList("clearSelection")});$("#hinstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#hinstockbutton").on("change",function(a7){hopinstock=a7.args.checked;hoplist.dataBind()});$("#hdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#hdeleterowbutton").on("click",function(){var a9,a8,a7=$("#hopGrid").jqxGrid("getselectedrowindex");a9=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(a7>=0&&a7<a9){a8=$("#hopGrid").jqxGrid("getrowid",a7);$("#hopGrid").jqxGrid("deleterow",a8)}at()})},ready:function(){at();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Hop",datafield:"h_name",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+ba.h_origin+" / "+ba.h_name+"</span>"},},{text:"Type",width:90,datafield:"h_type",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopTypeData[a9].nl+"</span>"}},{text:"Vorm",width:90,datafield:"h_form",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopFormData[a9].nl+"</span>"}},{text:"Alpha",datafield:"h_alpha",width:80,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gebruik",width:110,datafield:"h_useat",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopUseData[a9].nl+"</span>"}},{text:"Tijdsduur",datafield:"h_time",width:90,align:"right",cellsrenderer:function(a6,a5,a9,a8,a7,bb){var ba="";if((bb.h_useat==2)||(bb.h_useat==4)){ba=ah.formatNumber(a9,"f0")+" min."}else{if(bb.h_useat==5){ba=ah.formatNumber(a9/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ba+"</span>"}},{text:"IBU",datafield:"ibu",width:80,align:"right",cellsrenderer:function(a6,a5,a9,a8,a7,bb){var ba=toIBU(bb.h_useat,bb.h_form,al,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(bb.h_amount),parseFloat(bb.h_time),parseFloat(bb.h_alpha),$("#ibu_method").val());return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ah.formatNumber(ba,"f1")+"</span>"}},{text:"Gewicht",datafield:"h_amount",width:110,align:"right",cellsrenderer:function(a6,a5,ba,a9,a8,bb){var a7=ah.formatNumber(ba,"f1")+" kg";if(ba<1){a7=ah.formatNumber(ba*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+a7+"</span>"}},{text:"Voorraad",datafield:"h_inventory",width:110,align:"right",cellsrenderer:function(a7,a6,bb,ba,a9,bc){if(((d.inventory_reduced<=2)&&(bc.h_useat<=4))||((d.inventory_reduced<=6)&&(bc.h_useat==5))){var a8,a5="#ffffff";if(bb<bc.h_amount){a5="#ff4040"}a8=ah.formatNumber(bb,"f1")+" kg";if(bb<1){a8=ah.formatNumber(bb*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a5+';">'+a8+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a5){if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{console.log("edit button row "+a5);a=a5;e=$("#hopGrid").jqxGrid("getrowdata",a);$("#wh_name").val(e.h_name);$("#wh_amount").val(e.h_amount*1000);var a6=toIBU(e.h_useat,e.h_form,al,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(a6);if(e.h_useat==5){$("#wh_time").val(e.h_time/1440)}else{$("#wh_time").val(e.h_time)}$("#wh_useat").val(e.h_useat);$("#popupHop").jqxWindow("open")}}}]})},X=function(a4){var a3={localdata:a4.miscs,datatype:"local",cache:false,async:false,datafields:[{name:"m_name",type:"string"},{name:"m_amount",type:"float"},{name:"m_cost",type:"float"},{name:"m_type",type:"int"},{name:"m_use_use",type:"int"},{name:"m_time",type:"float"},{name:"m_amount_is_weight",type:"int"},{name:"m_inventory",type:"float"},{name:"m_avail",type:"int"}],addrow:function(a6,a8,a5,a7){console.log("misc addrow "+a6);a7(true)},deleterow:function(a5,a6){console.log("misc deleterow "+a5);a6(true)},updaterow:function(a5,a7,a6){console.log("misc updaterow "+a5);a6(true)}},i=new $.jqx.dataAdapter(a3,{beforeLoadComplete:function(a5){var a8,a6,a7=new Array();for(a6=0;a6<a5.length;a6++){a8=a5[a6];a7.push(a8);switch(a8.m_name){case"CaCl2":$("#wa_cacl2").val(a8.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(a8.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(a8.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(a8.m_amount*1000);break;case"Melkzuur":$("#wa_acid_name").val(0);$("#wa_acid").val(a8.m_amount*1000);$("#wa_acid_perc").val(80);ag="Melkzuur";break;case"Zoutzuur":$("#wa_acid_name").val(1);$("#wa_acid").val(a8.m_amount*1000);$("#wa_acid_perc").val(80);ag="Zoutzuur";break;case"Fosforzuur":$("#wa_acid_name").val(2);$("#wa_acid").val(a8.m_amount*1000);$("#wa_acid_perc").val(80);ag="Fosforzuur";break;case"Zwavelzuur":$("#wa_acid_name").val(3);$("#wa_acid").val(a8.m_amount*1000);$("#wa_acid_perc").val(80);ag="Zwavelzuur";break;case"NaHCO3":$("#wa_base_name").val(0);$("#wa_base").val(a8.m_amount*1000);aU="NaHCO3";break;case"Na2CO3":$("#wa_base_name").val(1);$("#wa_base").val(a8.m_amount*1000);aU="Na2CO3";break;case"CaCO3":$("#wa_base_name").val(2);$("#wa_base").val(a8.m_amount*1000);aU="CaCO3";break;case"Ca(OH)2":$("#wa_base_name").val(3);$("#wa_base").val(a8.m_amount*1000);aU="Ca(OH)2";break}}return a7},loadError:function(a7,a5,a6){$("#err").text(a5+" "+a6)},});$("#miscGrid").jqxGrid({width:1240,height:575,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a6){var a5=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a6.append(a5);a5.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>');a5.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a5.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>');a5.append('<input style="float: left; margin-left: 400px;" id="mdeleterowbutton" type="button" value="Verwijder ingredient" />');$("#maddrowbutton").jqxDropDownList({placeHolder:"Kies ingredi&euml;nt:",theme:theme,template:"primary",source:misclist,disabled:(d.stage>3),displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500});$("#maddrowbutton").on("select",function(a9){if(a9.args){var a8,ba={},a7=a9.args.index;a8=misclist.records[a7];ba.m_name=a8.name;ba.m_amount=0;ba.m_cost=a8.cost;ba.m_type=a8.type;ba.m_use_use=a8.use_use;ba.m_time=0;ba.m_amount_is_weight=a8.amount_is_weight;ba.m_inventory=a8.inventory;$("#miscGrid").jqxGrid("addrow",null,ba)}});$("#minstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#minstockbutton").on("change",function(a7){miscinstock=a7.args.checked;misclist.dataBind()});$("#mdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#mdeleterowbutton").on("click",function(){var ba,a8,a9,a7=$("#miscGrid").jqxGrid("getselectedrowindex");ba=$("#miscGrid").jqxGrid("getdatainformation").rowscount;a8=$("#miscGrid").jqxGrid("getcellvalue",a7,"m_type");if(a7>=0&&a7<ba&&a8!=4){a9=$("#miscGrid").jqxGrid("getrowid",a7);$("#miscGrid").jqxGrid("deleterow",a9)}})},ready:function(){aG();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Ingredient",datafield:"m_name"},{text:"Type",width:140,datafield:"m_type",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+MiscTypeData[a9].nl+"</span>"}},{text:"Gebruik",width:140,datafield:"m_use_use",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+MiscUseData[a9].nl+"</span>"}},{text:"Tijd",datafield:"m_time",width:90,align:"right",cellsrenderer:function(a6,a5,a9,a8,a7,bb){var ba="";if(bb.m_use_use==2){ba=ah.formatNumber(a9,"f0")+" min."}else{if((bb.m_use_use==3)||(bb.m_use_use==4)){ba=ah.formatNumber(a9/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ba+"</span>"}},{text:"Hoeveel",datafield:"m_amount",width:110,align:"right",cellsrenderer:function(a6,a5,ba,a8,a7,bb){var a9=bb.m_amount_is_weight?"gr":"ml";return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ah.formatNumber(ba*1000,"f2")+" "+a9+"</span>"}},{text:"Voorraad",datafield:"m_inventory",width:110,align:"right",cellsrenderer:function(a9,a5,ba,bc,a6,bd){var bb,a7,a8;if(((d.inventory_reduced<=2)&&(bd.m_use_use<=2))||((d.inventory_reduced<=3)&&(bd.m_use_use==3))||((d.inventory_reduced<=5)&&(bd.m_use_use==4))||((d.inventory_reduced<=6)&&(bd.m_use_use==5))){bb=bd.m_amount_is_weight?"gr":"ml";a7="#ffffff";if(ba<bd.m_amount){a7="#ff4040"}a8=ah.formatNumber(ba*1000,"f2")+" "+bb;return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a7+';">'+a8+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a5){aw=a5;aH=$("#miscGrid").jqxGrid("getrowdata",aw);if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{if(aH.m_type==4){alert("Brouwzouten wijzigen in de water tab.")}else{console.log("edit button row "+a5);if(aH.m_amount_is_weight){$("#wm_pmpt_amount").html("Gewicht gram:")}else{$("#wm_pmpt_amount").html("Volume ml:")}$("#wm_name").val(aH.m_name);$("#wm_amount").val(aH.m_amount*1000);if((aH.m_use_use==3)||(aH.m_use_use==4)){$("#wm_time").val(aH.m_time/1440)}else{$("#wm_time").val(aH.m_time)}$("#wm_use_use").val(aH.m_use_use);$("#popupMisc").jqxWindow("open")}}}}]})},aM=function(a3){var i={localdata:a3.yeasts,datatype:"local",cache:false,async:false,datafields:[{name:"y_name",type:"string"},{name:"y_laboratory",type:"string"},{name:"y_product_id",type:"string"},{name:"y_amount",type:"float"},{name:"y_cost",type:"float"},{name:"y_type",type:"int"},{name:"y_form",type:"int"},{name:"y_flocculation",type:"int"},{name:"y_min_temperature",type:"float"},{name:"y_max_temperature",type:"float"},{name:"y_attenuation",type:"float"},{name:"y_use",type:"int"},{name:"y_cells",type:"float"},{name:"y_tolerance",type:"float"},{name:"y_inventory",type:"float"},{name:"y_avail",type:"int"}],addrow:function(a6,a8,a5,a7){console.log("yeast addrow "+a6);a7(true)},deleterow:function(a5,a6){console.log("yeast deleterow "+a5);a6(true)},updaterow:function(a5,a7,a6){console.log("yeast updaterow "+a5);a6(true)}},a4=new $.jqx.dataAdapter(i);$("#yeastGrid").jqxGrid({width:1240,height:350,source:a4,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a6){var a5=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');a6.append(a5);a5.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>');a5.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a5.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>');a5.append('<input style="float: left; margin-left: 400px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />');$("#yaddrowbutton").jqxDropDownList({placeHolder:"Kies gist:",theme:theme,source:yeastlist,disabled:(d.stage>3),template:"primary",displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(a8,a7,ba){var a9=yeastlist.records[a8];return a9.laboratory+" "+a9.product_id+" "+a9.name}});$("#yaddrowbutton").on("select",function(a9){if(a9.args){var a8,ba={},a7=a9.args.index;a8=yeastlist.records[a7];ba.y_name=a8.name;ba.y_laboratory=a8.laboratory;ba.y_product_id=a8.product_id;ba.y_type=a8.type;ba.y_form=a8.form;ba.y_amount=0;ba.y_cost=a8.cost;ba.y_use=0;ba.y_min_temperature=a8.min_temperature;ba.y_max_temperature=a8.max_temperature;ba.y_attenuation=a8.attenuation;ba.y_flocculation=a8.flocculation;ba.y_cells=a8.cells;ba.y_tolerance=a8.tolerance;ba.y_inventory=a8.inventory;$("#yeastGrid").jqxGrid("addrow",null,ba)}Y();$("#yaddrowbutton").jqxDropDownList("clearSelection")});$("#yinstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#yinstockbutton").on("change",function(a7){yeastinstock=a7.args.checked;yeastlist.dataBind()});$("#ydeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#ydeleterowbutton").on("click",function(){var a9,a8,a7=$("#yeastGrid").jqxGrid("getselectedrowindex");a8=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(a7>=0&&a7<a8){a9=$("#yeastGrid").jqxGrid("getrowid",a7);$("#yeastGrid").jqxGrid("deleterow",a9);Y()}})},ready:function(){U();J();Y();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Gist",datafield:"y_name"},{text:"Laboratorium",width:150,datafield:"y_laboratory"},{text:"Code",width:90,datafield:"y_product_id"},{text:"Soort",width:100,datafield:"y_form",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastFormData[a9].nl+"</span>"}},{text:"Min. &deg;C",width:70,align:"right",cellsalign:"right",datafield:"y_min_temperature"},{text:"Max. &deg;C",width:70,align:"right",cellsalign:"right",datafield:"y_max_temperature"},{text:"Tol. %",width:60,align:"right",cellsalign:"right",datafield:"y_tolerance",cellsrenderer:function(a7,a6,bb,ba,a9,bc){var a8="",a5="#ffffff";if(bb>0){a8=ah.formatNumber(bb,"f1");if(d.est_abv>bb){a5="#ff4040"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a5+';">'+a8+"</span>"}},{text:"Attn. %",width:70,align:"right",cellsalign:"right",datafield:"y_attenuation",cellsformat:"f1"},{text:"Voor",width:120,datafield:"y_use",cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastUseData[a9].nl+"</span>"}},{text:"Hoeveel",datafield:"y_amount",width:90,align:"right",cellsrenderer:function(a6,a5,ba,a9,a8,bb){var a7=ah.formatNumber(ba*1000,"f0")+" ml";if(bb.y_form==0){a7=ah.formatNumber(ba,"f0")+" pk"}else{if(bb.y_form==1||bb.y_form==6){a7=ah.formatNumber(ba*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+a7+"</span>"}},{text:"Voorraad",datafield:"y_inventory",width:90,align:"right",cellsrenderer:function(a7,a6,bb,ba,a9,bc){var a5,a8;if(((d.inventory_reduced<=3)&&(bc.y_use==0))||((d.inventory_reduced<=4)&&(bc.y_use==1))||((d.inventory_reduced<=5)&&(bc.y_use==2))||((d.inventory_reduced<=6)&&(bc.y_use==3))){a5="#ffffff";if(bb<bc.y_amount){a5="#ff4040"}a8=ah.formatNumber(bb*1000,"f0")+" ml";if(bc.y_form==0){a8=ah.formatNumber(bb,"f0")+" pk"}else{if(bc.y_form==1||bc.y_form==6){a8=ah.formatNumber(bb*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a5+';">'+a8+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:90,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a5){if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{aE=a5;f=$("#yeastGrid").jqxGrid("getrowdata",aE);if(f.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):");$("#wy_amount").val(f.y_amount);$("#wy_amount").jqxNumberInput({decimalDigits:0})}else{if(f.y_form==1||f.y_form==6){$("#wy_pmpt_amount").html("Gewicht gram:");$("#wy_amount").val(f.y_amount*1000);$("#wy_amount").jqxNumberInput({decimalDigits:1})}else{$("#wy_pmpt_amount").html("Volume ml:");$("#wy_amount").val(f.y_amount*1000);$("#wy_amount").jqxNumberInput({decimalDigits:0})}}$("#wy_name").val(f.y_name);$("#wy_laboratory").val(f.y_laboratory);$("#wy_product_id").val(f.y_product_id);$("#wy_use").val(f.y_use);$("#popupYeast").jqxWindow("open")}}}]})},av=function(a4){var a3={localdata:a4.mashs,datatype:"local",cache:false,async:false,datafields:[{name:"step_name",type:"string"},{name:"step_type",type:"int"},{name:"step_infuse_amount",type:"float"},{name:"step_temp",type:"float"},{name:"step_time",type:"float"},{name:"step_thickness",type:"float"},{name:"ramp_time",type:"float"},{name:"end_temp",type:"float"}],addrow:function(a6,a8,a5,a7){console.log("mash addrow "+a6);a7(true)},deleterow:function(a5,a6){console.log("mash deleterow "+a5);a6(true)}},i=new $.jqx.dataAdapter(a3,{beforeLoadComplete:function(a5){C=0;var a6,a8,a7=new Array();for(a6=0;a6<a5.length;a6++){a8=a5[a6];if(a8.step_type==0){C+=parseFloat(a8.step_infuse_amount)}a8.step_thickness=0;a7.push(a8)}},});$("#mashGrid").jqxGrid({width:1240,height:400,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a6){var a5=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');a6.append(a5);a5.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');a5.append('<input style="float: left; margin-left: 565px;" id="sdeleterowbutton" type="button" value="Verwijder stap" />');$("#saddrowbutton").jqxButton({template:"primary",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#saddrowbutton").on("click",function(){var a7={},a8=$("#mashGrid").jqxGrid("getdatainformation").rowscount;a7.step_name="Stap "+(a8+1);if(a8>0){a7.step_type=1}else{a7.step_type=0;a7.step_infuse_amount=15}a7.step_temp=62;a7.step_time=20;a7.step_thickness=0;a7.ramp_time=1;a7.end_temp=62;$("#mashGrid").jqxGrid("addrow",null,a7)});$("#sdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#sdeleterowbutton").on("click",function(){var a9,a8,a7=$("#mashGrid").jqxGrid("getselectedrowindex");a9=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(a7>=0&&a7<a9){a8=$("#mashGrid").jqxGrid("getrowid",a7);$("#mashGrid").jqxGrid("deleterow",a8)}})},ready:function(){aX();aO();$("#jqxLoader").jqxLoader("close");$("#jqxTabs").jqxTabs("first")},columns:[{text:"Stap naam",datafield:"step_name"},{text:"Stap type",datafield:"step_type",width:175,cellsrenderer:function(a6,a5,a9,a8,a7,ba){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+MashStepTypeData[a9].nl+"</span>"}},{text:"Start &deg;C",datafield:"step_temp",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Eind &deg;C",datafield:"end_temp",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Rust min.",datafield:"step_time",width:90,align:"right",cellsalign:"right"},{text:"Stap min.",datafield:"ramp_time",width:90,align:"right",cellsalign:"right"},{text:"Infuse L.",datafield:"step_infuse_amount",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"L/Kg.",datafield:"step_thickness",width:90,align:"right",cellsalign:"right",cellsformat:"f2"},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a5){if(d.stage>3){alert("Het maichen is al gedaan.")}else{ak=a5;D=$("#mashGrid").jqxGrid("getrowdata",ak);$("#wstep_name").val(D.step_name);$("#wstep_type").val(D.step_type);$("#wstep_infuse_amount").val(D.step_infuse_amount);$("#wstep_temp").val(D.step_temp);$("#wend_temp").val(D.end_temp);$("#wstep_time").val(D.step_time);$("#wramp_time").val(D.ramp_time);if(D.step_type==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}$("#popupMash").jqxWindow("open")}}}]})};$("#jqxMenu").jqxMenu("destroy");console.log("record:"+my_record+"  return:"+my_return+"  theme:"+theme);$("#jqxLoader").jqxLoader({width:250,height:150,isModal:true,text:"Laden product ...",theme:theme});function G(){if(d.inventory_reduced>6){$("#ok_pmpt").hide();return}if(p&&ab&&ai&&P&&c){$("#ok_supplies").html("<img src='images/dialog-ok-apply.png'>")}else{$("#ok_supplies").html("<img src='images/dialog-error.png'>")}}function aW(){console.log("calcPercentages()");var a3=0,a5,i,a4=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(a4>1){for(ae=0;ae<a4;ae++){a5=$("#fermentableGrid").jqxGrid("getrowdata",ae);if(a5.f_added<4){a3+=Round(a5.f_amount,3)}}a3=Round(a3,3);for(ae=0;ae<a4;ae++){a5=$("#fermentableGrid").jqxGrid("getrowdata",ae);if(a5.f_added<4){i=Round(a5.f_amount/a3*100,1);$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",i)}else{$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",0)}}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}}function U(){var bB=0,bt=0,br=0,bj=0,bs=0,bC=0,bc=0,bm=0,bg=0,bk=false,bp=0,bb=0,bw=0.925,bo=0.95,ba=0,bq,a9,be,a3,bi,a4,by,bz,a7,bh=0,bx,bf,bd,a6,a8,bl,a5,bn,bu,bA;I=0;ac=0;ap=0;p=1;P=1;if((be=$("#mashGrid").jqxGrid("getrows"))){for(bq=0;bq<be.length;bq++){a9=be[bq];if(a9.step_type==0){bC+=parseFloat(a9.step_infuse_amount)}if(a9.step_temp<=75){bi=a9.step_time+a9.ramp_time;bp+=bi;bb+=bi*a9.step_temp}}if(bp>5){bp-=5}bb=Round(bb/bp,2)}if(!(be=$("#fermentableGrid").jqxGrid("getrows"))){return}for(bq=0;bq<be.length;bq++){a9=be[bq];if(a9.f_adjust_to_total_100){bk=true}if(a9.f_type==1&&a9.f_added<4){I+=a9.f_percentage}if(a9.f_graintype==2&&a9.f_added<4){ac+=a9.f_percentage}bx=a9.f_amount*(a9.f_yield/100)*(1-a9.f_moisture/100);if(a9.f_added==0){if(bC>0){bC+=a9.f_amount*a9.f_moisture/100;bh+=bx}bx=parseFloat(d.efficiency)/100*bx;bt+=bx;ap+=parseFloat(a9.f_amount)}if(a9.f_added==0||a9.f_added==1){bB+=bx}if(a9.f_added==2||a9.f_added==3){bd=(a9.f_yield/100)*(1-a9.f_moisture/100);bj+=a9.f_amount*bd;bs+=a9.f_amount;br+=(bd*sugardensity+(1-bd)*1)*a9.f_amount}if(a9.f_added<4){bc+=a9.f_amount*ebc_to_srm(a9.f_color);bm+=a9.f_amount*a9.f_color*get_kt(a9.f_color);bg+=(a9.f_percentage/100)*a9.f_color}if(B){if(a9.f_added==4){$("#bottle_priming_total").val(a9.f_amount*1000);$("#bottle_priming_sugar").jqxDropDownList("selectItem",a9.f_name)}if(a9.f_added==5){$("#keg_priming_total").val(a9.f_amount*1000);$("#keg_priming_sugar").jqxDropDownList("selectItem",a9.f_name)}}if((((d.inventory_reduced<=2)&&(a9.f_added<=1))||((d.inventory_reduced<=3)&&(a9.f_added==2))||((d.inventory_reduced<=5)&&(a9.f_added==3))||((d.inventory_reduced<=6)&&(a9.f_added==4))||((d.inventory_reduced<=6)&&(a9.f_added==5)))&&a9.f_inventory<a9.f_amount){p=0}if(a9.f_added==0&&(a9.f_type==0||a9.f_type==4)&&a9.f_color<50){ba+=a9.f_diastatic_power*a9.f_amount}}B=0;$("#ferm_lintner").val(Math.round(parseFloat(ba/ap)));$("#mash_kg").val(ap);console.log("calcFermentables() supplies:"+p+" moutsuiker:"+bt+"/"+bB);l=bk;if(l){$("#wf_amount").jqxNumberInput({width:90,readOnly:true,spinButtons:false})}else{$("#wf_amount").jqxNumberInput({width:110,readOnly:false,spinButtons:true})}if(bC>0){bf=bh/sugardensity+bC;bh=1000*bh/(bf*10);a1=Round(plato_to_sg(bh),5);$("#est_mash_sg").val(a1)}d.est_og=estimate_sg(bB+bj,parseFloat(d.batch_size));$("#est_og").val(d.est_og);$("#est_og2").val(d.est_og);a3=d.est_og;aZ=estimate_sg(bB,parseFloat(d.batch_size));$("#est_og3").val(aZ);al=estimate_sg(bt,parseFloat(d.boil_size));$("#est_pre_sg").val(al);a4=parseFloat(d.batch_size);if(d.brew_aboil_volume>0){a4=d.brew_aboil_volume/1.04}if(d.brew_fermenter_tcloss==0){d.brew_fermenter_tcloss=d.eq_trub_chiller_loss;$("#brew_fermenter_tcloss").val(d.brew_fermenter_tcloss)}d.brew_fermenter_volume=a4-d.brew_fermenter_tcloss+d.brew_fermenter_extrawater;$("#brew_fermenter_volume").val(d.brew_fermenter_volume);by=(d.boil_size-C+(ap*my_grain_absorbtion)+d.eq_lauter_deadspace)*1.03;$("#brew_sparge_est").val(by);bz=d.brew_aboil_sg;if(bz<1.002){bz=aZ}a7=d.brew_fermenter_extrawater;if(d.brew_fermenter_volume>0){a6=sg_to_plato(bz)*d.brew_fermenter_volume*bz/100;a6+=bj;if((d.brew_fermenter_volume*bz+bs)>0){bl=100*a6/(d.brew_fermenter_volume*bz+bs+a7);d.brew_fermenter_sg=Round(plato_to_sg(bl),4);$("#brew_fermenter_sg").val(d.brew_fermenter_sg);if(d.color_method==4){d.brew_fermenter_color=Math.round(((bl/8.6)*bg)+(d.boil_time/60))}else{if(d.color_method==3){d.brew_fermenter_color=Math.round((4.46*bw*bo)/(a4+a7)*bm)}else{a5=bc/(a4+a7)*8.34436;d.brew_fermenter_color=kw_to_ebc(d.color_method,a5)}}$("#brew_fermenter_color").val(d.brew_fermenter_color);bu=ebc_to_color(d.brew_fermenter_color);$("#bcolorf").show();document.getElementById("bcolorf").style.background=bu}}else{d.brew_fermenter_sg=d.brew_fermenter_color=0;$("#brew_fermenter_sg").val(0);$("#brew_fermenter_color").val(0);$("#bcolorf").hide()}if(d.color_method==4){bn=Math.round(((sg_to_plato(d.est_og)/8.6)*bg)+(d.boil_time/60))}else{if(d.color_method==3){bn=Math.round((4.46*bw*bo)/parseFloat(d.batch_size)*bm)}else{a5=bc/parseFloat(d.batch_size)*8.34436;bn=kw_to_ebc(d.color_method,a5)}}d.est_color=bn;$("#est_color").val(bn);$("#est_color2").val(bn);bu=ebc_to_color(bn);document.getElementById("bcolor").style.background=bu;document.getElementById("bcolor2").style.background=bu;pmalts=ap/d.eq_mash_max*100;$("#perc_malts").jqxProgressBar("val",pmalts);$("#perc_sugars").jqxProgressBar("val",I);$("#perc_cara").jqxProgressBar("val",ac);aV();aD=0;aa=0;be=$("#yeastGrid").jqxGrid("getrows");for(bq=0;bq<be.length;bq++){a9=be[bq];if(a9.y_use==0){if(parseFloat(a9.y_attenuation)>aD){aD=parseFloat(a9.y_attenuation)}if(a9.y_form==0){aa+=(parseFloat(a9.y_cells)/1000000000)*parseFloat(a9.y_amount)*(d.starter_viability/100)}else{aa+=(parseFloat(a9.y_cells)/1000000)*parseFloat(a9.y_amount)}}if((((d.inventory_reduced<=3)&&(a9.y_use==0))||((d.inventory_reduced<=4)&&(a9.y_use==1))||((d.inventory_reduced<=5)&&(a9.y_use==2))||((d.inventory_reduced<=6)&&(a9.y_use==3)))&&(a9.y_inventory<a9.y_amount)){P=0}}G();if(aD==0){aD=77}if((ap>0)&&(C>0)&&(bp>0)&&(bb>0)){d.est_fg=estimate_fg(I,ac,C/ap,bp,bb,aD,d.est_og)}else{d.est_fg=estimate_fg(I,ac,0,0,0,aD,d.est_og)}$("#est_fg").val(d.est_fg);$("#est_fg2").val(d.est_fg);$("#est_fg3").val(d.est_fg);bA=d.est_fg;d.est_abv=abvol(d.est_og,d.est_fg);$("#est_abv").val(d.est_abv);$("#est_abv2").val(d.est_abv);if((d.stage>=6)&&(d.fg>0.99)&&(d.fg<d.brew_fermenter_sg)){aD=100*(d.brew_fermenter_sg-d.fg)/(d.brew_fermenter_sg-1);a3=d.brew_fermenter_sg;bA=d.fg}$("#yeast_cells").val(aa);$("#need_cells").val(v());a8=1881.22*bA*(a3-bA)/(1.775-a3);a6=3550*bA*(0.1808*a3+0.8192*bA-1.0004);$("#kcal").val(Math.round((a8+a6)/(12*0.0295735296)))}function aO(){var a8,a3,a5=0,a7=0,a4=0,a6,a9;if((rows=$("#mashGrid").jqxGrid("getrows"))&&(ap>0)){for(a6=0;a6<rows.length;a6++){a9=$("#mashGrid").jqxGrid("getrowdata",a6);if(a9.step_type==0){a5+=a9.step_infuse_amount}a7+=a9.step_time+a9.ramp_time;$("#mashGrid").jqxGrid("setcellvalue",a6,"step_thickness",a5/ap)}}a4=ap*H+a5;$("#est_mashvol").val(a4);a8=Math.floor(a7/60);a3=Math.floor(a7-(a8*60));if(a8<10){a8="0"+a8}if(a3<10){a3="0"+a3}$("#est_mashtime").val(a8+":"+a3)}function af(a4){console.log("calcFermentablesFromOG("+a4+")");var a6,bc,a9,a5,bb,a8=0,a7=0,ba,a3=parseFloat($("#efficiency").jqxNumberInput("decimal"));bb=sg_to_plato(a4)*parseFloat($("#batch_size").jqxNumberInput("decimal"))*a4/100;ba=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(a5=0;a5<ba;a5++){bc=$("#fermentableGrid").jqxGrid("getrowdata",a5);if(bc.f_added<4){a9=bc.f_percentage/100*(bc.f_yield/100)*(1-bc.f_moisture/100);if(bc.f_added==0){a9=a3/100*a9}a8+=a9}}if(a8){a7=Round(bb/a8,3)}if(a7){for(a5=0;a5<ba;a5++){bc=$("#fermentableGrid").jqxGrid("getrowdata",a5);if(bc.f_added<4){a6=Math.round(bc.f_percentage*10*a7)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",a5,"f_amount",a6)}}}}function v(){var i,a4,a3=d.brew_fermenter_sg;if(a3<=1.0001&&d.fg>1){a3=d.fg}else{if(a3<=1.0001){a3=d.est_og}}i=sg_to_plato(a3);a4=d.brew_fermenter_volume;if(a4<=0){a4=d.batch_size-d.eq_trub_chiller_loss}return x*a4*i}function L(a4,a6,a3,a5){var i;if(a3==1){i=0.15}else{if(a4>50){i=0.1}else{i=15.25/(6*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((a4-21)/6,2));if(i<0.1){i=0.1}}}return(i*a5*1000)/a6}function h(a4,a6,a3,a5){var i=0;if(a3==5){i=1.33}else{if(a4>20){i=0}else{if(a4>7.5){i=10.03/(4*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((a4-7.5)/4,2))}else{if(a3==2){i=1}else{if(a3==3){i=1.2}else{if(a3==4){i=1.2}}}}}}return(i*a5*1000)/a6}function at(){var a4=0,a3=0,a6={},a5,a7;V=aY=0;if(!(a6=$("#hopGrid").jqxGrid("getrows"))){return}ab=1;for(a5=0;a5<a6.length;a5++){a7=a6[a5];a4+=toIBU(a7.h_useat,a7.h_form,al,parseFloat(d.batch_size),parseFloat(a7.h_amount),parseFloat(a7.h_time),parseFloat(a7.h_alpha),d.ibu_method);a3+=toIBU(a7.h_useat,a7.h_form,al,parseFloat(d.brew_fermenter_volume)+parseFloat(d.brew_fermenter_tcloss),parseFloat(a7.h_amount),parseFloat(a7.h_time),parseFloat(a7.h_alpha),d.ibu_method);aY+=L(parseFloat(a7.h_time),parseFloat(d.batch_size),a7.h_useat,parseFloat(a7.h_amount));V+=h(parseFloat(a7.h_time),parseFloat(d.batch_size),a7.h_useat,parseFloat(a7.h_amount));if((((d.inventory_reduced<=2)&&(a7.h_useat<=4))||((d.inventory_reduced<=6)&&(a7.h_useat==5)))&&(a7.h_inventory<a7.h_amount)){ab=0}}a4=Math.round(a4*10)/10;a3=Math.round(a3*10)/10;aY=Math.round(aY*1000/5)/10;V=Math.round(V*1000/6)/10;if(aY>100){aY=100}if(V>100){V=100}console.log("calcIBUs(): "+a4+" flavour: "+aY+" aroma: "+V+" fermenter:"+a3+" supplies:"+ab);d.est_ibu=a4;$("#est_ibu").val(a4);$("#est_ibu2").val(a4);$("#hop_flavour").jqxProgressBar("val",aY);$("#hop_aroma").jqxProgressBar("val",V);$("#brew_fermenter_ibu").val(a3);aV();G()}function O(a4,a5,a3){var i=a5/a3;if(i>3.5){return 0}if(a4==2){return 0.4}if(a4==1){return 0.62}if(i<=1.4){return 1.4}return 2.33-(0.67*i)}function aC(a4,a9,a3){var i=2.72715,ba=a3/a4*1000,a5=Round(ba,1),a6=(d.starter_sg-1)*a4*i,a7=O(a9,a3,a6),a8=Round(a6*a7,1),bb=parseFloat(a8)+a3;return{svol:a4,irate:a5,prate:Round(ba,1),ncells:a8,totcells:bb,growf:Round(a8/a3,2)}}function F(a9,a3,ba){var a8=[20,40,60,80,100,150,200,250,375,500,625,750,875,1000,1250,1500,2000,2500,3000,4000,5000],a4=a8.length,a5=0,a6=0,bb={},a7;if((parseFloat($("#prop1_volume").jqxNumberInput("decimal"))+parseFloat($("#prop2_volume").jqxNumberInput("decimal"))+parseFloat($("#prop3_volume").jqxNumberInput("decimal"))+parseFloat($("#prop4_volume").jqxNumberInput("decimal")))==0){for(a7=1;a7<5;a7++){$("#prop"+a7+"_type").hide();$("#r"+a7+"_pmpt").show();$("#prop"+a7+"_type").val(a9);$("#prop"+a7+"_volume").hide();$("#prop"+a7+"_volume").val(0);$("#prop"+a7+"_irate").hide();$("#prop"+a7+"_ncells").hide();$("#prop"+a7+"_tcells").hide();$("#prop"+a7+"_growf").hide()}if(a3>ba){return}$("#prop1_type").show();$("#r1_pmpt").hide();$("#prop1_volume").show();$("#prop1_irate").show();$("#prop1_ncells").show();$("#prop1_tcells").show();$("#prop1_growf").show();for(a7=a6;a7<=a4;a7++){a6=a7;a5=a8[a6];bb=aC(a5,a9,a3);if(bb.irate<25){a6=a7-1;a5=a8[a6];bb=aC(a5,a9,a3);break}if(bb.totcells>ba||a7==a4){break}}$("#prop1_volume").val(bb.svol/1000);$("#prop1_irate").val(bb.prate);$("#prop1_ncells").val(bb.ncells);$("#prop1_tcells").val(bb.totcells);$("#prop1_growf").val(bb.growf);if(bb.totcells>ba){return}$("#r2_pmpt").hide();$("#prop2_type").val(a9);$("#prop2_type").show();$("#prop2_volume").show();$("#prop2_irate").show();$("#prop2_ncells").show();$("#prop2_tcells").show();$("#prop2_growf").show();for(a7=a6;a7<=a4;a7++){a6=a7;a5=a8[a6];bb=aC(a5,a9,$("#prop1_tcells").val());if(bb.irate<25){a6=a7-1;a5=a8[a6];bb=aC(a5,a9,$("#prop1_tcells").val());break}if(bb.totcells>ba||a7==a4){break}}$("#prop2_volume").val(bb.svol/1000);$("#prop2_irate").val(bb.prate);$("#prop2_ncells").val(bb.ncells);$("#prop2_tcells").val(bb.totcells);$("#prop2_growf").val(bb.growf);if(bb.totcells>ba){return}$("#r3_pmpt").hide();$("#prop3_type").val(a9);$("#prop3_type").show();$("#prop3_volume").show();$("#prop3_irate").show();$("#prop3_ncells").show();$("#prop3_tcells").show();$("#prop3_growf").show();for(a7=a6;a7<=a4;a7++){a6=a7;a5=a8[a6];bb=aC(a5,a9,$("#prop2_tcells").val());if(bb.irate<25){a6=a7-1;a5=a8[a6];bb=aC(a5,a9,$("#prop2_tcells").val());break}if(bb.totcells>ba||a7==a4){break}}$("#prop3_volume").val(bb.svol/1000);$("#prop3_irate").val(bb.prate);$("#prop3_ncells").val(bb.ncells);$("#prop3_tcells").val(bb.totcells);$("#prop3_growf").val(bb.growf);if(bb.totcells>ba){return}$("#r4_pmpt").hide();$("#prop4_type").val(a9);$("#prop4_type").show();$("#prop4_volume").show();$("#prop4_irate").show();$("#prop4_ncells").show();$("#prop4_tcells").show();$("#prop4_growf").show();for(a7=a6;a7<=a4;a7++){a6=a7;a5=a8[a6];bb=aC(a5,a9,$("#prop3_tcells").val());if(bb.totcells>ba||a7==a4){$("#prop4_volume").val(bb.svol/1000);$("#prop4_irate").val(bb.prate);$("#prop4_ncells").val(bb.ncells);$("#prop4_tcells").val(bb.totcells);$("#prop4_growf").val(bb.growf);return}}}else{if(d.prop1_volume>0){$("#r1_pmpt").hide();$("#prop1_type").show();$("#prop1_volume").show();$("#prop1_irate").show();$("#prop1_ncells").show();$("#prop1_tcells").show();$("#prop1_growf").show();bb=aC($("#prop1_volume").val()*1000,d.prop1_type,a3);$("#prop1_irate").val(bb.prate);$("#prop1_ncells").val(bb.ncells);$("#prop1_tcells").val(bb.totcells);$("#prop1_growf").val(bb.growf)}if(d.prop2_volume>0){$("#r2_pmpt").hide();$("#prop2_type").show();$("#prop2_volume").show();$("#prop2_irate").show();$("#prop2_ncells").show();$("#prop2_tcells").show();$("#prop2_growf").show();bb=aC($("#prop2_volume").val()*1000,d.prop2_type,$("#prop1_tcells").val());$("#prop2_irate").val(bb.prate);$("#prop2_ncells").val(bb.ncells);$("#prop2_tcells").val(bb.totcells);$("#prop2_growf").val(bb.growf)}if(d.prop3_volume>0){$("#r3_pmpt").hide();$("#prop3_type").show();$("#prop3_volume").show();$("#prop3_irate").show();$("#prop3_ncells").show();$("#prop3_tcells").show();$("#prop3_growf").show();bb=aC($("#prop3_volume").val()*1000,d.prop3_type,$("#prop2_tcells").val());$("#prop3_irate").val(bb.prate);$("#prop3_ncells").val(bb.ncells);$("#prop3_tcells").val(bb.totcells);$("#prop3_growf").val(bb.growf)}if(d.prop4_volume>0){$("#r4_pmpt").hide();$("#prop4_type").show();$("#prop4_volume").show();$("#prop4_irate").show();$("#prop4_ncells").show();$("#prop4_tcells").show();$("#prop4_growf").show();bb=aC($("#prop4_volume").val()*1000,d.prop4_type,$("#prop3_tcells").val());$("#prop4_irate").val(bb.prate);$("#prop4_ncells").val(bb.ncells);$("#prop4_tcells").val(bb.totcells);$("#prop4_growf").val(bb.growf)}}}function Y(){var bb,a4,ba,a6,a9,a3,a8,a7,a5=d.brew_fermenter_sg;if(a5<=1.0001&&d.fg>1){a5=d.fg}else{if(a5<=1.0001){a5=d.est_og}}bb=sg_to_plato(a5);a4=d.brew_fermenter_volume;if(a4>0){if(d.brew_fermenter_extrawater>0){a4+=d.brew_fermenter_extrawater}}else{a4=d.batch_size-d.eq_trub_chiller_loss}$("#yeast_cells").val(aa);if(!(ba=$("#yeastGrid").jqxGrid("getrows"))){return}a6=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(a6==0){return}for(a3=0;a3<a6;a3++){a9=$("#yeastGrid").jqxGrid("getrowdata",a3);if(a9.y_use==0){x=0.75;if(d.est_og>1.06){x=1}if(a9.y_type==0){x*=2}if(a9.y_type==6){x=0.25}}}a8=Round(x*a4*bb,1);console.log("calcYeast() pitchrate:"+x+" start:"+aa+" needed:"+a8+" volume:"+a4);$("#need_cells").val(a8);a7=aa;if(d.starter_enable){F(d.starter_type,aa,a8);for(a3=1;a3<5;a3++){$("#r"+a3+"_irate").html("");$("#r"+a3+"_growf").html("");$("#r"+a3+"_tcells").html("");if(parseFloat($("#prop"+a3+"_volume").val())>0){if((parseFloat($("#prop"+a3+"_irate").val())<25)||(parseFloat($("#prop"+a3+"_irate").val())>100)){$("#r"+a3+"_irate").html("<img src='images/dialog-error.png'>")}else{$("#r"+a3+"_irate").html("<img src='images/dialog-ok-apply.png'>")}if(parseFloat($("#prop"+a3+"_growf").val())<1){$("#r"+a3+"_growf").html("<img src='images/dialog-error.png'>")}if(($("#prop"+a3+"_type").val()>0)&&(parseFloat($("#prop"+a3+"_growf").val())>3)){$("#r"+a3+"_growf").html("<img src='images/dialog-error.png'>")}if(parseFloat($("#prop"+a3+"_tcells").val())>a8){$("#r"+a3+"_tcells").html("<img src='images/dialog-ok-apply.png'>")}a7=parseFloat($("#prop"+a3+"_tcells").val())}else{$("#r"+a3+"_irate").html("")}}}$("#plato_cells").val(parseFloat(a7/(a4*bb)))}function aj(a5){console.log("adjustHops("+a5+")");var a6,a4,a3,a7=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(a7==0){return}for(a4=0;a4<a7;a4++){a6=$("#hopGrid").jqxGrid("getrowdata",a4);a3=a6.h_amount*a5;$("#hopGrid").jqxGrid("setcellvalue",a4,"h_amount",a3)}}function aG(){ai=1;var a4,a3,a5=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(a5==0){return}for(a3=0;a3<a5;a3++){a4=$("#miscGrid").jqxGrid("getrowdata",a3);if((((d.inventory_reduced<=2)&&(a4.m_use_use<=2))||((d.inventory_reduced<=3)&&(a4.m_use_use==3))||((d.inventory_reduced<=5)&&(a4.m_use_use==4))||((d.inventory_reduced<=6)&&(a4.m_use_use==5)))&&(a4.m_inventory<a4.m_amount)){ai=0}}G()}function a2(a5){console.log("adjustMiscs("+a5+")");var a6,a4,a3,a7=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(a7==0){return}for(a4=0;a4<a7;a4++){a6=$("#miscGrid").jqxGrid("getrowdata",a4);a3=a6.m_amount*a5;$("#miscGrid").jqxGrid("setcellvalue",a4,"m_amount",a3);switch(a6.m_name){case"CaCl2":$("#wa_cacl2").val(a6.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(a6.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(a6.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(a6.m_amount*1000);break;case"Melkzuur":case"Zoutzuur":case"Fosforzuur":case"Zwavelzuur":$("#wa_acid").val(a6.m_amount*1000);break;case"NaHCO3":case"Na2CO3":case"CaCO3":case"Ca(OH)2":$("#wa_base").val(a6.m_amount*1000);break}}}function aP(a5){console.log("adjustYeasts("+a5+")");var a6,a4,a3,a7=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(a7==0){return}for(a4=0;a4<a7;a4++){a6=$("#yeastGrid").jqxGrid("getrowdata",a4);if(!d.starter_enable){a3=a6.y_amount*a5;$("#yeastGrid").jqxGrid("setcellvalue",a4,"y_amount",a3)}}Y()}function au(a5){console.log("adjustWaters("+a5+")");var a4,a6,a3,a7=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(a7==0){return}C=0;for(a3=0;a3<a7;a3++){a6=$("#mashGrid").jqxGrid("getrowdata",a3);if(a6.step_type==0){a4=Round(a6.step_infuse_amount*a5,1);$("#mashGrid").jqxGrid("setcellvalue",a3,"step_infuse_amount",a4);C+=a4}}if(d.w2_amount==0){d.w1_amount=C;$("#w1_amount").val(C)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*C;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*C;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(C)}function a0(){var a3,i;if(parseFloat($("#brew_mash_sg").jqxNumberInput("decimal"))<1.002){return}a3=sg_to_plato(a1);i=sg_to_plato(parseFloat($("#brew_mash_sg").jqxNumberInput("decimal")));if(a3>0.5){$("#brew_mash_efficiency").val(100*i/a3)}else{$("#brew_mash_efficiency").val(0)}}function w(){var a4=0,a7={},a6,a8,a5,a3=0;if(!(a7=$("#fermentableGrid").jqxGrid("getrows"))){return}for(a6=0;a6<a7.length;a6++){a8=a7[a6];if(a8.f_added==0){a4+=a8.f_amount*(a8.f_yield/100)*(1-a8.f_moisture/100)}}a5=sg_to_plato(d.brew_preboil_sg)*(d.brew_preboil_volume/1.04)*d.brew_preboil_sg*10/1000;if(a4>0){a3=Round((a5/a4*100),1)}if(a3<0){a3=0}$("#brew_preboil_efficiency").val(a3)}function S(){var a5=0,a4=0,a8={},a7,a9,a6,a3=0;if(!(a8=$("#fermentableGrid").jqxGrid("getrows"))){return}for(a7=0;a7<a8.length;a7++){a9=a8[a7];if(a9.f_added==0){a5+=a9.f_amount*(a9.f_yield/100)*(1-a9.f_moisture/100)}else{if(a9.f_added==1){a4+=a9.f_amount*(a9.f_yield/100)*(1-a9.f_moisture/100)}}}a6=sg_to_plato(d.brew_aboil_sg)*(d.brew_aboil_volume/1.04)*d.brew_aboil_sg*10/1000;a6-=a4;if(a5>0){a3=Round((a6/a5*100),1)}if(a3<0){a3=0}d.brew_aboil_efficiency=a3;$("#brew_aboil_efficiency").val(a3)}function R(){var i=(d.est_og-1)*1000;if(i>0){return d.est_ibu/i}else{return 0.5}}function k(){var i=R();return(-1.2*i+1.4)}function aB(a3,a5){var a9,a4,ba,a8=false,a6,a7=$("#miscGrid").jqxGrid("getrows");if(a5==0){for(a4=0;a4<a7.length;a4++){a9=a7[a4];if(a9.m_name==a3){ba=$("#miscGrid").jqxGrid("getrowid",a4);$("#miscGrid").jqxGrid("deleterow",ba)}}}else{for(a4=0;a4<a7.length;a4++){a9=a7[a4];if(a9.m_name==a3){a8=true;$("#miscGrid").jqxGrid("setcellvalue",a4,"m_amount",a5/1000);break}}if(!a8){a6=new $.jqx.dataAdapter(miscInvSource,{loadComplete:function(){var bb,bd,be={},bc=a6.records;for(bd=0;bd<bc.length;bd++){bb=bc[bd];if(bb.name==a3){be.m_name=bb.name;be.m_amount=a5/1000;be.m_cost=bb.cost;be.m_type=bb.type;be.m_use_use=bb.use_use;be.m_time=0;be.m_amount_is_weight=bb.amount_is_weight;be.m_inventory=bb.inventory;be.m_avail=1;$("#miscGrid").jqxGrid("addrow",null,be)}}}});a6.dataBind();return}}}function m(a3,i){if((i=="laag")||(i=="hoog")){$("#wr_"+a3).html("<img src='images/dialog-error.png'><span style='vertical-align: top; font-size: 10px; font-style: italic;'>"+i+"</span>")}else{$("#wr_"+a3).html("<img src='images/dialog-ok-apply.png'>")}}function aQ(a5,a4,a3,i){if((a5+a4)>0){return((a5*a3)+(a4*i))/(a5+a4)}return 0}function ar(a4,a3,i){return a4-(a3/1.4+i/1.7)}function z(a3){var i=Math.pow(10,-a3);return 100*aA*ay/(i*i+i*aA+aA*ay)}function az(a3){var i=Math.pow(10,-a3);return 100*aA*i/(i*i+i*aA+aA*ay)}function ax(i){return(-2*z(i)-az(i))}function K(a3){var a6=ax(4.3),a4=ax(parseFloat($("#wg_ph").jqxNumberInput("decimal"))),i=ax(a3),a8=-a6+a4,a7=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))/50/a8,a5=-i+a4;return a7*a5}function am(a3){var a4,a5,i=parseFloat($("#wg_calcium").jqxNumberInput("decimal"))/(A/2);a4=parseFloat($("#wg_magnesium").jqxNumberInput("decimal"))/(aq/2);a5=K(a3);return a5-(i/3.5+a4/7)}function M(a5){var a8,a6,a7,a4,a3,a9=am(a5)*parseFloat($("#wg_amount").jqxNumberInput("decimal"));a8=$("#fermentableGrid").jqxGrid("getrows");for(a6=0;a6<a8.length;a6++){row=a8[a6];if(row.f_added==0&&row.f_graintype!=6){a7=0;if((row.f_di_ph!=5.7)&&((row.f_acid_to_ph_57<-0.1)||(row.f_acid_to_ph_57>0.1))){a7=row.f_acid_to_ph_57/(row.f_di_ph-5.7)}else{a4=row.f_color;switch(row.f_graintype){case 0:case 3:case 5:a7=0.014*a4-34.192;break;case 2:a7=-0.0597*a4-32.457;break;case 1:a7=0.0107*a4-54.768;break;case 4:a7=-149;break}}a3=a7*(a5-row.f_di_ph);a9+=a3*row.f_amount}}return a9}function aN(){var a6=0,a4=5.4,a3=0.001,a5=0.1,i=M(a4);while(((i<-a5)||(i>a5))&&(a6<2000)){a6++;if(i<-a5){a4-=a3}else{if(i>a5){a4+=a3}}i=M(a4)}a4=Round(a4,2);return a4}function t(i){switch(i){case 0:return{pK1:3.86,pK2:20,pK3:20,MolWt:90.08,AcidSG:1214,AcidPrc:0.88};case 1:return{pK1:-7,pK2:20,pK3:20,MolWt:36.46,AcidSG:1142,AcidPrc:0.28};case 2:return{pK1:2.12,pK2:7.2,pK3:12.44,MolWt:98,AcidSG:1170,AcidPrc:0.25};case 3:return{pK1:-1,pK2:1.92,pK3:20,MolWt:98.07,AcidSG:1700,AcidPrc:0.93}}}function Q(){var bk=0,bz=0,ba=0,bl=0,bb=0,bw=0,bc=0,bu=0,be=0,bn=0,bF=0,bD=0,bA=0,by,bo,bg,a5,a4,i,bf,a7,a6,bq,bi,a9,br,bj,bx,bp,bh,bs,bE,bt,bd,bB,bm,bC,a8,bv,a3;if(d.w1_name==""){return}if(d.w2_name!=""){bk=d.w1_amount+d.w2_amount;bz=aQ(d.w1_amount,d.w2_amount,d.w1_calcium,d.w2_calcium);ba=aQ(d.w1_amount,d.w2_amount,d.w1_magnesium,d.w2_magnesium);bl=aQ(d.w1_amount,d.w2_amount,d.w1_sodium,d.w2_sodium);bc=aQ(d.w1_amount,d.w2_amount,d.w1_chloride,d.w2_chloride);bu=aQ(d.w1_amount,d.w2_amount,d.w1_sulfate,d.w2_sulfate);bb=aQ(d.w1_amount,d.w2_amount,d.w1_total_alkalinity,d.w2_total_alkalinity);be=-Math.log10(((Math.pow(10,-d.w1_ph)*d.w1_amount)+(Math.pow(10,-d.w2_ph)*d.w2_amount))/bk)}else{bk=d.w1_amount;bz=d.w1_calcium;ba=d.w1_magnesium;bl=d.w1_sodium;bc=d.w1_chloride;bu=d.w1_sulfate;bb=d.w1_total_alkalinity;be=d.w1_ph}$("#wg_amount").val(bk);bB=bz;$("#wg_calcium").val(Math.round(bz*10)/10);$("#wg_magnesium").val(Math.round(ba*10)/10);bm=bl;$("#wg_sodium").val(Math.round(bl*10)/10);bC=bb;$("#wg_total_alkalinity").val(Math.round(bb*10)/10);a8=bc;$("#wg_chloride").val(Math.round(bc*10)/10);bv=bu;$("#wg_sulfate").val(Math.round(bu*10)/10);$("#wg_ph").val(Round(be,1));$("#wb_ph").val(Round(aN(),1));$("#est_mash_ph").val(Round(aN(),1));bw=bb*1.22;a3=bw;bn=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*A/T+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*A/an;bz+=1000*bn/bk;bn=parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*aq/aK;ba+=1000*bn/bk;bn=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ad/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ad/aF;bl+=1000*bn/bk;bn=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*aI/an+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*aI/aK;bu+=1000*bn/bk;bn=2*parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*q/T+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*q/b;bc+=1000*bn/bk;if($("#wa_acid_name").val()<0||$("#wa_acid_name").val()>3){$("#wa_acid_name").val(0);d.wa_acid_name=0}if(ag==""){ag=AcidTypeData[$("#wa_acid_name").val()].nl}if($("#wa_base_name").val()<0||$("#wa_base_name").val()>3){$("#wa_base_name").val(0);d.wa_base_name=0}if(aU==""){aU=BaseTypeData[$("#wa_base_name").val()].nl}by=d.wa_acid_name;bo=d.wa_base_name;bg=t(by);a5=bg.pK1;a4=bg.pK2;i=bg.pK3;bf=bg.MolWt;a7=bg.AcidSG;a6=bg.AcidPrc;if(d.calc_acid){bD=parseFloat(d.mash_ph);bA=M(bD);if(bA>0){$("#wa_base").val(0);aB(aU,0);bF=CalcFrac(bD,a5,a4,i);Acid=bA/bF;Acid*=bf;Acidmg=Acid;Acid=Acid/a7;if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(a6)}Acid=Round(Acid*a6/(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100),2);$("#wa_acid").val(Acid);aB(AcidTypeData[by].nl,Acid);bw=bw-bA*bF/bk;bb=bw*50/61}else{if(bA<0){$("#wa_acid").val(0);aB(ag,0);bq=Math.pow(10,(bD-6.38));bi=Math.pow(10,(bD-10.38));a9=1/(1+bq+bq*bi);br=a9*bq;bj=br*bi;switch(bo){case 0:bn=-bA/(a9-bj);bn=bn*aF/1000;$("#wa_base").val(Round(bn,2));aB("NaHCO3",Round(bn,2));if(bk>0){bn=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ad/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ad/aF;bn=1000*bn/bk;bl=bm+bn;bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/aF;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 1:bn=-bA/(2*a9+br);bn=bn*y/1000;$("#wa_base").val(Round(bn,2));aB("Na2CO3",Round(bn,2));if(bk>0){bn=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ad/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*ad/y;bn=1000*bn/bk;bl=bm+bn;bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/y;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 2:bn=-bA*(a9-bj);bn=bn*g/1000;bn=3*bn;$("#wa_base").val(Round(bn,2));aB("CaCO3",Round(bn,2));if(bk>0){bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*r/g;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*A/T+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*A/an+parseFloat($("#wa_base").jqxNumberInput("decimal"))*A/g;bn=1000*bn/bk;bz=bB+bn;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 3:bn=-bA/19.3;$("#wa_base").val(Round(bn,2));aB("Ca(OH)2",Round(bn,2));if(bk>0){bn=-bA/bk;bb=bC+bn;bw=bb*61/50;bn=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*A/T+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*A/an+parseFloat($("#wa_base").jqxNumberInput("decimal"))*A/aJ;bn=1000*bn/bk;bz=bB+bn;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium)}break}}}be=bD;$("#wb_ph").val(Round(be,1));$("#est_mash_ph").val(Round(be,1))}else{console.log("calc_acid no");if(parseFloat($("#wa_base").jqxNumberInput("decimal"))>0){if(bk>0){switch(bo){case 0:bn=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ad/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ad/aF;bn=1000*bn/bk;bl=bm+bn;bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/aF;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 1:bn=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ad/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*ad/y;bn=1000*bn/bk;bl=bm+bn;bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/y;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 2:bn=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*r/g;bn=1000*bn/bk;bw=a3+bn;bb=bw*50/61;bn=ar(wb_total_alkalinity,wb_calcium,wb_magnesium);bn=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*A/T+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*A/an+parseFloat($("#wa_base").jqxNumberInput("decimal"))*A/g;bn=1000*bn/bk;bz=bB+bn;break}}}bD=parseFloat(d.mash_ph);pHa=aN();if(parseFloat($("#wa_acid").jqxNumberInput("decimal"))>0){console.log("TpH: "+bD+" water: "+pHa);Acid=parseFloat($("#wa_acid").jqxNumberInput("decimal"));if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(a6)}Acid=Acid/a6*(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);Acid*=a7;Acid/=bf;Acidmg=Acid;bF=CalcFrac(pHa,a5,a4,i);bA=Acid*bF;bx=0.001;bp=0.1;bh=M(pHa);bs=0;while(((bh<(bA-bp))||(bh>(bA+bp)))&&(bs<2000)){bs++;if(bh<(bA-bp)){pHa-=bx}else{if(bh>(bA+bp)){pHa+=bx}}bF=CalcFrac(pHa,a5,a4,i);bA=Acid*bF;bh=M(pHa)}console.log("n: "+bs+" pd: "+bh+" protonDeficit: "+bA+" frac: "+bF+" pHa: "+pHa);bn=a3-bA*bF/bk;bw=bn;bb=bn*50/61;be=pHa;$("#wb_ph").val(Round(be,1));$("#est_mash_ph").val(Round(be,1))}}if((by==3)&&(bk>0)){bn=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*aI/an+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*aI/aK+Acidmg/1000*aI/(aI+2);bn=1000*bn/bk;bu=bv+bn}else{if((by==1)&&(bk>0)){bn=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*q/T+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*q/b+Acidmg/1000*q/(q+1);bn=1000*bn/bk;bc=a8+bn}}$("#tgt_bu").val(Round(R(),2));if(R()<0.32){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig en zoet</span>")}else{if(R()<0.43){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig, zoet</span>")}else{if(R()<0.52){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Evenwichtig</span>")}else{if(R()<0.63){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Licht hoppig, bitter</span>")}else{$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Extra hoppig, zeer bitter</span>")}}}}$("#tgt_cl_so4").val(Round(k(),1));if(bu>0){bn=bc/bu}else{bn=10}$("#got_cl_so4").val(Round(bn,1));bE=0.8*k();bt=1.2*k();bd="normaal";if(bn<bE){bd="laag"}else{if(bn>bt){bd="hoog"}}m("cl_so4",bd);$("#wb_calcium").val(Round(bz,1));$("#wb_magnesium").val(Round(ba,1));$("#wb_sodium").val(Round(bl,1));$("#wb_sulfate").val(Round(bu,1));$("#wb_chloride").val(Round(bc,1));$("#wb_total_alkalinity").val(Round(bb,1));if(bz<40){m("calcium","laag")}else{if(bz>150){m("calcium","hoog")}else{m("calcium","normaal")}}if(ba>=0&&ba<=30){m("magnesium","normaal")}else{m("magnesium","hoog")}if(bl<=150){m("sodium","normaal")}else{m("sodium","hoog")}if(bc<=50){m("chloride","laag")}else{if(bc<=100){m("chloride","normaal")}else{m("chloride","hoog")}}if(bu<=50){m("sulfate","laag")}else{if(bu<=350){m("sulfate","normaal")}else{m("sulfate","hoog")}}if(be<5.2){m("ph","laag")}else{if(be>5.6){m("ph","hoog")}else{m("ph","normaal")}}j();aG();G()}function j(){var a5,bh,bf,bn,bm,bq,bk,bj,bl,a8,bv,bt,a3,a7,ba,bg,br,bp,bs,bi,a4,a9,be,bd,bc,bb,bu,a6,i,bo;a5=d.sparge_ph;bh=d.w1_ph;bf=d.w1_total_alkalinity;if(d.sparge_source==1){if(d.w2_ph>0){bh=d.w2_ph;bf=d.w2_total_alkalinity}else{d.sparge_source=0;$("#sparge_source").val(0)}}else{if(d.sparge_source==2){if(d.w2_ph>0){bh=parseFloat($("#wg_ph").jqxNumberInput("decimal"));bf=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))}else{d.sparge_source=0;$("#sparge_source").val(0)}}}bn=Math.pow(10,bh-6.38);bm=Math.pow(10,bh-10.373);bq=1+bn+bn*bm;bk=1/bq;bj=bn*bm/bq;bl=Math.pow(10,4.3-6.38);a8=Math.pow(10,4.3-10.373);bv=1+bl+bl*a8;bt=1/bv;a3=bl*a8/bv;a7=bf/50;ba=(a7-1000*(Math.pow(10,-4.3)-Math.pow(10,-bh)))/((bt-bk)+(bj-a3));bg=Math.pow(10,a5-6.38);br=Math.pow(10,a5-10.373);bp=1+bg+bg*br;bs=1/bp;bi=bg*br/bp;a4=ba*((bs-bk)+(bj-bi))+Math.pow(10,-a5)-Math.pow(10,-bh);a4+=0.01;if(d.sparge_acid_type<0||d.sparge_acid_type>3){d.sparge_acid_type=0;$("#sparge_acid_type").val(0)}a9=d.sparge_acid_type;be=t(a9);bd=be.pK1;bc=be.pK2;bb=be.pK3;bu=be.MolWt;a6=be.AcidSG;i=be.AcidPrc;bo=CalcFrac(a5,bd,bc,bb);a4/=bo;a4*=bu;a4=a4/a6;bk=d.sparge_acid_perc;if(bk<=0.1){bk=i}a4=a4*i/(bk/100);a4*=d.sparge_volume;a4=Round(a4,2);d.sparge_acid_amount=a4/1000;$("#sparge_acid_amount").val(a4)}function N(){var a3,i,a5,a4;if(d.brew_fermenter_sg<1.02){return}if((d.primary_end_sg>0.99)&&(d.primary_end_sg<d.brew_fermenter_sg)){a3=Round(100*(d.brew_fermenter_sg-d.primary_end_sg)/(d.brew_fermenter_sg-1),1);$("#primary_svg").val(a3);if((d.secondary_end_sg>0.99)&&(d.secondary_end_sg<d.brew_fermenter_sg)){i=Round(100*(d.brew_fermenter_sg-d.secondary_end_sg)/(d.brew_fermenter_sg-1),1);$("#secondary_svg").val(i);if((d.fg>0.99)&&(d.fg<d.brew_fermenter_sg)){a5=Round(100*(d.brew_fermenter_sg-d.fg)/(d.brew_fermenter_sg-1),1);$("#final_svg").val(a5);a4=Round(abvol(d.brew_fermenter_sg,d.fg),2);$("#final_abv").val(a4)}}}}function ao(a3,i){var a4=i*1.8+32;return 3.0378-0.050062*a4+0.00026555*a4*a4}function W(a3,i,a5){var a4=a5*(a3-ao(a3,i))/0.286;if(a4<0){a4=0}return Round(a4,3)}function o(a3,a6,a5){var a4,i=a3-ao(a3,a6);if(i<0){return 0}a4=-1.09145427669121+0.00800006989646477*a5+0.000260276315484684*a5*a5+0.0215142075945119*a5*i+0.674996600795854*i+-0.00471757220150754*i*i;if(a4<0){a4=0}a4=a4*1.01325;return Round(a4,1)}function Z(a3,i){return(a3-(-0.000005594056*Math.pow(i,4)+0.000144357886*Math.pow(i,3)+0.000362999168*i*i-0.064872987645*i+1.641145175049))/(0.00000498031*Math.pow(i,4)-0.00024358267*Math.pow(i,3)+0.00385867329*i*i-0.05671206825*i+1.53801423376)}function aS(){var ba,a7,bb,a9,a5,bf,bc,a3,bh,a6,bi,be,a4,a8,bd,bg;ba=d.secondary_temp;if(ba<1){ba=d.primary_end_temp}if(ba<1){ba=18}if(d.fg==0){a7=abvol(d.brew_fermenter_sg,parseFloat($("#est_fg").jqxNumberInput("decimal")))}else{a7=abvol(d.brew_fermenter_sg,d.fg)}bb=d.package_volume-(a7*d.package_volume)/100;a9=d.package_volume-bb;bf=d.package_infuse_amount-(d.package_infuse_abv*d.package_infuse_amount)/100;bc=d.package_infuse_amount-bf;bh=a9+bc;a3=bb+bf;a7=Round(bh/(a3+bh)*100,2);d.package_abv=a7;$("#package_abv").val(a7);if(!(rows=$("#fermentableGrid").jqxGrid("getrows"))){return}d.bottle_priming_amount=0;d.bottle_priming_total=0;for(a6=0;a6<rows.length;a6++){bi=rows[a6];if(bi.f_added==4){be=1/((bi.f_yield/100)*(1-bi.f_moisture/100));d.bottle_priming_amount=W(d.bottle_carbonation,ba,be);d.bottle_priming_total=Round(d.bottle_amount*d.bottle_priming_amount,2);$("#fermentableGrid").jqxGrid("setcellvalue",a6,"f_amount",d.bottle_priming_total/1000)}}$("#bottle_priming_amount").val(Round(d.bottle_priming_amount,1));$("#bottle_priming_total").val(d.bottle_priming_total);a8=a7+d.bottle_priming_amount*0.47/7.907;a4=d.bottle_amount-(a8*d.bottle_amount)/100;bh=d.bottle_amount-a4;a3=a4+d.bottle_priming_water;a5=Round(bh/(a3+bh)*100,2);$("#bottle_abv").val(a5);$("#bottle_pressure").val(o(d.bottle_carbonation,ba,d.bottle_carbonation_temp));bd=Z(d.keg_carbonation,d.keg_carbonation_temp);if(bd<0){bd=0}d.keg_pressure=bd;$("#keg_pressure").val(Round(bd,1));d.keg_priming_amount=0;d.keg_priming_total=0;if(!d.keg_forced_carb){for(a6=0;a6<rows.length;a6++){bi=rows[a6];if(bi.f_added==5){be=1/((bi.f_yield/100)*(1-bi.f_moisture/100));d.keg_priming_amount=W(d.keg_carbonation,ba,be);d.keg_priming_total=Round(d.keg_amount*d.keg_priming_amount,2);$("#fermentableGrid").jqxGrid("setcellvalue",a6,"f_amount",d.keg_priming_total/1000)}}$("#keg_priming_amount").val(Round(d.keg_priming_amount,1));$("#keg_priming_total").val(d.keg_priming_total);a8=a7+d.keg_priming_amount*0.47/7.907;a4=d.keg_amount-(a8*d.keg_amount)/100;bh=d.keg_amount-a4;a3=a4+d.keg_priming_water;bg=Round(bh/(a3+bh)*100,2);$("#keg_abv").val(bg)}else{$("#keg_priming_amount").val(0);$("#keg_priming_total").val(0);$("#keg_abv").val(a7)}}function aV(){var a8=d.stage,a7,a5,a3,a9,a6,i,a4;if(a8==0&&d.est_og>1.005&&d.est_color>3&&d.est_ibu>3){a8=1}if(a8==1&&parseFloat($("#brew_date_start").val())>2000){a8=2}if(a8==2&&($("#brew_date_start").val()=="")){a8=1}if(a8==2&&parseFloat($("#brew_date_end").val())>2000){a8=3}if(a8==3&&parseFloat($("#primary_end_date").val())>2000){a8=4}if(a8==4&&parseFloat($("#secondary_end_date").val())>2000){a8=5}if(a8==5&&parseFloat($("#package_date").val())>2000){a8=6}if(a8>=6&&a8<9){a7=new Date();a3=$("#package_date").val();a3=a3.split("-");a5=new Date(a7.getFullYear(),a7.getMonth(),a7.getDate());a3=new Date(a3[0],a3[1]-1,a3[2]);a9=parseInt(a5.getTime()/1000);a6=parseInt(a3.getTime()/1000);i=a9-a6;a4=i/60/60/24;if(a4>0){if(a4>=42){a8=9}else{if(a4>=14){a8=8}else{a8=7}}}}if(a8==9&&parseFloat($("#taste_date").val())>2000){a8=10}if(a8!=d.stage){console.log("calcStage() old: "+d.stage+" new: "+a8);d.stage=a8}$("#stage").val(StageData[d.stage].nl);if(d.stage>=10){$("#locked").jqxCheckBox({disabled:false})}if(d.stage>1){$("#equipmentSelect").jqxDropDownList({disabled:true});$("#Delete").jqxButton({disabled:true})}if(d.stage<1){$("#jqxTabs").jqxTabs("disableAt",8)}else{$("#jqxTabs").jqxTabs("enableAt",8)}if(d.stage<3){$("#jqxTabs").jqxTabs("disableAt",9)}else{$("#jqxTabs").jqxTabs("enableAt",9);$("#name").jqxInput({disabled:true});$("#code").jqxInput({disabled:true});$("#batch_size").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#boil_size").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#boil_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#efficiency").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#est_og").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#type").jqxDropDownList({disabled:true});$("#styleSelect").jqxDropDownList({disabled:true});$("#color_method").jqxDropDownList({disabled:true});$("#ibu_method").jqxDropDownList({disabled:true});$("#mash_select").jqxDropDownList({disabled:true});$("#w1_name").jqxDropDownList({disabled:true});$("#w2_name").jqxDropDownList({disabled:true});$("#w2_amount").jqxNumberInput({readOnly:true});$("#pr_name").jqxDropDownList({disabled:true});$("#wa_cacl2").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wa_caso4").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wa_mgso4").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wa_nacl").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#mash_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#calc_acid").jqxCheckBox({disabled:true});$("#wa_base_name").jqxDropDownList({disabled:true});$("#wa_base").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wa_acid_name").jqxDropDownList({disabled:true});$("#wa_acid").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wa_acid_perc").jqxNumberInput({spinButtons:false,readOnly:true,width:70});$("#sparge_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#sparge_volume").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#sparge_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#sparge_source").jqxDropDownList({disabled:true});$("#sparge_acid_type").jqxDropDownList({disabled:true});$("#sparge_acid_perc").jqxNumberInput({spinButtons:false,readOnly:true,width:false});$("#starter_enable").jqxCheckBox({disabled:true});$("#starter_type").jqxDropDownList({disabled:true});$("#starter_try").jqxButton({disabled:true});$("#starter_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#starter_viability").jqxNumberInput({spinButtons:false,readOnly:true,width:90})}if(d.stage>3){$("#brew_date_start").jqxDateTimeInput({disabled:true});$("#brew_date_end").jqxDateTimeInput({disabled:true});$("#brew_mash_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_preboil_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aboil_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_mash_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_preboil_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aboil_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_preboil_volume").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aboil_volume").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_whirlpool9").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_cooling_to").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_whirlpool7").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_cooling_method").jqxDropDownList({disabled:true});$("#brew_whirlpool6").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_cooling_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_sparge_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_whirlpool2").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aeration_type").jqxDropDownList({disabled:true});$("#brew_fermenter_tcloss").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aeration_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_fermenter_extrawater").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#brew_aeration_speed").jqxNumberInput({spinButtons:false,readOnly:true,width:90})}if(d.stage==5){$("#package_date").jqxDateTimeInput({disabled:false})}else{$("#package_date").jqxDateTimeInput({disabled:true})}if(d.stage>=5){$("#primary_start_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#primary_max_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#primary_end_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#primary_end_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#primary_end_brix").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#primary_end_date").jqxDateTimeInput({disabled:true})}if(d.stage>=6){$("#secondary_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#secondary_end_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#secondary_end_date").jqxDateTimeInput({disabled:true});$("#tertiary_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#fg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#final_brix").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#package_date").jqxDateTimeInput({disabled:true});$("#package_volume").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#package_infuse_amount").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#package_infuse_abv").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#package_infuse_notes").jqxInput({disabled:true});$("#package_ph").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#bottle_amount").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#bottle_priming_water").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#keg_priming_water").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#keg_amount").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#bottle_carbonation").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#keg_carbonation").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#bottle_priming_sugar").jqxDropDownList({disabled:true});$("#keg_priming_sugar").jqxDropDownList({disabled:true});$("#keg_forced_carb").jqxCheckBox({disabled:true});$("#bottle_carbonation_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#keg_carbonation_temp").jqxNumberInput({spinButtons:false,readOnly:true,width:90})}if(d.stage<8){$("#jqxTabs").jqxTabs("disableAt",11)}else{$("#jqxTabs").jqxTabs("enableAt",11)}if(d.stage==11){$("#taste_date").jqxDateTimeInput({disabled:true});$("#taste_rate").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#taste_color").jqxInput({disabled:true});$("#taste_transparency").jqxInput({disabled:true});$("#taste_head").jqxInput({disabled:true});$("#taste_aroma").jqxInput({disabled:true});$("#taste_taste").jqxInput({disabled:true});$("#taste_aftertaste").jqxInput({disabled:true});$("#taste_mouthfeel").jqxInput({disabled:true});$("#taste_notes").jqxInput({disabled:true});$("#notes").jqxInput({disabled:true})}else{$("#notes").jqxInput({disabled:false})}}function J(){if(d.starter_enable){$("#propagator").show();$("#starter_type").jqxDropDownList({disabled:false});$("#starter_try").jqxButton({disabled:false});$("#starter_sg").jqxNumberInput({spinButtons:true,readOnly:false,width:110});$("#starter_viability").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}else{$("#propagator").hide();$("#starter_type").jqxDropDownList({disabled:true});$("#starter_try").jqxButton({disabled:true});$("#starter_sg").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#starter_viability").jqxNumberInput({spinButtons:false,readOnly:true,width:90})}}function aX(){console.log("calcInit()");a0();w();S();$("#starter_enable").on("checked",function(i){d.starter_enable=1;J();Y()});$("#starter_enable").on("unchecked",function(i){d.starter_enable=0;J();Y()});$("#starter_try").click(function(){$("#prop1_volume").val(0);$("#prop2_volume").val(0);$("#prop3_volume").val(0);$("#prop4_volume").val(0);Y()});$("#starter_type").on("change",function(i){if(i.args){d.starter_type=i.args.index;Y()}});$("#starter_sg").on("change",function(i){if(i.args){d.starter_sg=i.args.value;Y()}});$("#starter_viability").on("change",function(i){if(i.args){d.starter_viability=i.args.value;U();Y()}});$("#prop1_type").on("change",function(i){if(i.args){d.prop1_type=i.args.index;Y()}});$("#prop1_volume").on("change",function(i){if(i.args){d.prop1_volume=i.args.value;Y()}});$("#prop2_type").on("change",function(i){if(i.args){d.prop2_type=i.args.index;Y()}});$("#prop2_volume").on("change",function(i){if(i.args){d.prop2_volume=i.args.value;Y()}});$("#prop3_type").on("change",function(i){if(i.args){d.prop3_type=i.args.index;Y()}});$("#prop3_volume").on("change",function(i){if(i.args){d.prop3_volume=i.args.value;Y()}});$("#prop4_type").on("change",function(i){if(i.args){d.prop4_type=i.args.index;Y()}});$("#prop4_volume").on("change",function(i){if(i.args){d.prop4_volume=i.args.value;Y()}});$("#calc_acid").on("checked",function(i){d.calc_acid=1;Q()});$("#calc_acid").on("unchecked",function(i){d.calc_acid=0;Q()});$("#w1_name").jqxDropDownList("selectItem",d.w1_name);$("#w2_name").jqxDropDownList("selectItem",d.w2_name);if(parseFloat($("#w1_amount").jqxNumberInput("decimal"))==0&&C>0){$("#w1_amount").val(C);d.w1_amount=C;$("#wg_amount").val(C);$("#w2_amount").val(0);d.w2_amount=0}Q();$("#w2_amount").on("change",function(i){var a3=parseFloat(i.args.value);if(a3>C){$("#w2_amount").val(d.w2_amount);return}d.w1_amount=parseFloat($("#wg_amount").jqxNumberInput("decimal"))-a3;$("#w1_amount").val(d.w1_amount);d.w2_amount=a3;console.log("new: "+i.args.value+" w1: "+d.w1_amount+"  w2: "+d.w2_amount);Q()});$("#wa_cacl2").on("change",function(i){if(i.args){aB("CaCl2",0);aB("CaCl2",i.args.value);Q()}});$("#wa_caso4").on("change",function(i){if(i.args){aB("CaSO4",0);aB("CaSO4",i.args.value);Q()}});$("#wa_mgso4").on("change",function(i){if(i.args){aB("MgSO4",0);aB("MgSO4",i.args.value);Q()}});$("#wa_nacl").on("change",function(i){if(i.args){aB("NaCl",0);aB("NaCl",i.args.value);Q()}});$("#wa_base_name").on("change",function(a3){if(a3.args){var i=a3.args.index;console.log("wa_base_name "+i);aB(aU,0);aU=BaseTypeData[i].nl;aB(aU,parseFloat($("#wa_base").jqxNumberInput("decimal")));d.wa_base_name=i;Q()}});$("#wa_base").on("change",function(a3){var i=BaseTypeData[$("#wa_base_name").val()].nl;aB(i,parseFloat(a3.args.value));Q()});$("#wa_acid_name").on("change",function(a3){if(a3.args){var i=a3.args.index;console.log("wa_acid_name "+i);aB(ag,0);ag=AcidTypeData[i].nl;aB(ag,parseFloat($("#wa_acid").jqxNumberInput("decimal")));d.wa_acid_name=i;Q()}});$("#wa_acid").on("change",function(a3){var i=AcidTypeData[$("#wa_acid_name").val()].nl;aB(i,parseFloat(a3.args.value));Q()});$("#wa_acid_perc").on("change",function(i){Q()});$("#color_method").on("change",function(i){d.color_method=i.args.index;U()});$("#ibu_method").on("change",function(i){d.ibu_method=i.args.index;U();at()});$("#batch_size").on("change",function(a4){console.log("batch_size change:"+a4.args.value+" old:"+d.batch_size);$("#est_a_vol").val(a4.args.value*1.04);var i,a3=parseFloat(a4.args.value)+d.boil_size-d.batch_size;i=parseFloat(a4.args.value)/d.batch_size;d.boil_size=a3;$("#boil_size").val(Round(a3,2));$("#est_pre_vol").val(Round(a3*1.04,2));d.sparge_volume*=i;$("#sparge_volume").val(d.sparge_volume);$("#brew_sparge_volume").val(d.sparge_volume);d.batch_size=parseFloat(a4.args.value);af(parseFloat($("#est_og").jqxNumberInput("decimal")));au(i);U();aj(i);a2(i);aP(i);at();Q();j();aO()});$("#boil_time").on("change",function(a4){console.log("boil_time change:"+parseFloat(a4.args.value)+" old:"+d.boil_time);var a3,i,a5=parseFloat(d.boil_size)-parseFloat(d.batch_size);i=a5*(parseFloat(a4.args.value)/d.boil_time);a3=parseFloat(d.batch_size)+i;d.boil_time=parseFloat(a4.args.value);d.boil_size=a3;$("#est_pre_vol").val(Round(a3*1.04,2));$("#boil_size").val(Round(a3,2));U();at();Y()});$("#efficiency").on("change",function(a3){var i=parseFloat($("#est_og").jqxNumberInput("decimal"));d.efficiency=parseFloat(a3.args.value);console.log("efficiency change:"+d.efficiency+" est_og:"+i);af(i);U();at();Y()});$("#est_og").on("change",function(i){d.est_og=parseFloat(i.args.value);console.log("est_og change:"+d.est_og);$("#est_og2").val(d.est_og);af(d.est_og);U();at();aO();Y()});$("#mash_ph").on("change",function(i){d.mash_ph=parseFloat(i.args.value);Q()});$("#sparge_ph").on("change",function(i){d.sparge_ph=parseFloat(i.args.value);j()});$("#sparge_volume").on("change",function(i){d.sparge_volume=parseFloat(i.args.value);$("#brew_sparge_volume").val(d.sparge_volume);j()});$("#sparge_temp").on("change",function(i){d.sparge_temp=parseFloat(i.args.value);$("#brew_sparge_temperature").val(d.sparge_temp)});$("#sparge_source").on("change",function(i){if(i.args){d.sparge_source=i.args.index;j()}});$("#sparge_acid_type").on("change",function(i){if(i.args){d.sparge_acid_type=i.args.index;console.log("new sparge_acid_type: "+d.sparge_acid_type);j()}});$("#sparge_acid_perc").on("change",function(i){d.sparge_acid_perc=parseFloat(i.args.value);j()});N();aS();$("#package_volume").on("change",function(a3){var a4,a5,i=d.package_volume+d.package_infuse_amount;d.package_volume=parseFloat(a3.args.value);if(d.package_volume>d.brew_fermenter_volume){d.package_volume=d.brew_fermenter_volume;$("#package_volume").val(d.package_volume)}a5=d.package_volume+d.package_infuse_amount;a4=a5-i;if(i>0){d.bottle_amount+=(d.bottle_amount/i)*a4;d.keg_amount+=(d.keg_amount/i)*a4}else{d.bottle_amount=a5;d.keg_amount=0}console.log("diff:"+a4+" old:"+i+" bottle:"+d.bottle_amount+" keg:"+d.keg_amount);$("#bottle_amount").val(parseFloat(d.bottle_amount*1000)/1000);$("#keg_amount").val(parseFloat(d.keg_amount*1000)/1000);aS()});$("#package_infuse_amount").on("change",function(a3){var a4,a5,i=d.package_volume+d.package_infuse_amount;d.package_infuse_amount=parseFloat(a3.args.value);a5=d.package_volume+d.package_infuse_amount;a4=a5-i;if(i>0){d.bottle_amount+=(d.bottle_amount/i)*a4;d.keg_amount+=(d.keg_amount/i)*a4}else{d.bottle_amount=a5;d.keg_amount=0}console.log("diff:"+a4+" old:"+i+" bottle:"+d.bottle_amount+" keg:"+d.keg_amount);$("#bottle_amount").val(parseFloat(d.bottle_amount*1000)/1000);$("#keg_amount").val(parseFloat(d.keg_amount*1000)/1000);aS()});$("#package_infuse_abv").on("change",function(i){d.package_infuse_abv=parseFloat(i.args.value);aS()});$("#bottle_amount").on("change",function(a4){var i,a5,a3=parseFloat(a4.args.value);i=d.package_volume+d.package_infuse_amount;if(a3>i){a3=i}a5=d.bottle_amount-a3;d.bottle_amount=Math.round((d.bottle_amount-a5)*1000)/1000;d.keg_amount=Math.round((d.keg_amount+a5)*1000)/1000;$("#bottle_amount").val(parseFloat(d.bottle_amount));$("#keg_amount").val(parseFloat(d.keg_amount));aS()});$("#bottle_priming_water").on("change",function(i){d.bottle_priming_water=parseFloat(i.args.value);aS()});$("#keg_amount").on("change",function(a4){var a5,i,a3=parseFloat(a4.args.value);i=d.package_volume+d.package_infuse_amount;if(a3>i){a3=i}a5=d.keg_amount-a3;d.bottle_amount=Math.round((d.bottle_amount+a5)*1000)/1000;d.keg_amount=Math.round((d.keg_amount-a5)*1000)/1000;$("#bottle_amount").val(parseFloat(d.bottle_amount));$("#keg_amount").val(parseFloat(d.keg_amount));aS()});$("#keg_priming_water").on("change",function(i){d.keg_priming_water=parseFloat(i.args.value);aS()});$("#bottle_carbonation").on("change",function(i){d.bottle_carbonation=parseFloat(i.args.value);aS()});$("#bottle_carbonation_temp").on("change",function(i){d.bottle_carbonation_temp=parseFloat(i.args.value);aS()});$("#keg_carbonation").on("change",function(i){d.keg_carbonation=parseFloat(i.args.value);aS()});$("#keg_forced_carb").on("checked",function(i){d.keg_forced_carb=1;aS()});$("#keg_forced_carb").on("unchecked",function(i){d.keg_forced_carb=0;aS()});$("#keg_carbonation_temp").on("change",function(i){d.keg_carbonation_temp=parseFloat(i.args.value);aS()});$("#brew_fermenter_extrawater").on("change",function(i){d.brew_fermenter_extrawater=parseFloat(i.args.value);U();at();Y()});$("#brew_fermenter_tcloss").on("change",function(i){d.brew_fermenter_tcloss=parseFloat(i.args.value);U();at();Y()});$("#primary_end_sg").on("change",function(i){d.primary_end_sg=parseFloat(i.args.value);N()});$("#primary_end_brix").on("change",function(a3){var a4,a5,i;if(d.brew_fermenter_sg>=1.02){a4=sg_to_brix(d.brew_fermenter_sg);a5=parseFloat(a3.args.value);i=Round(1.0031-0.002318474*a4-0.000007775*(a4*a4)-3.4e-8*Math.pow(a4,3)+0.00574*(a5)+0.00003344*(a5*a5)+8.6e-8*Math.pow(a5,3),4);if(a5>0.05){$("#primary_end_sg").val(i);d.primary_end_sg=i}N()}});$("#secondary_end_sg").on("change",function(i){d.secondary_end_sg=parseFloat(i.args.value);N()});$("#secondary_end_brix").on("change",function(a3){var a4,a5,i;if(d.brew_fermenter_sg>=1.02){a4=sg_to_brix(d.brew_fermenter_sg);a5=parseFloat(a3.args.value);i=Round(1.0031-0.002318474*a4-0.000007775*(a4*a4)-3.4e-8*Math.pow(a4,3)+0.00574*(a5)+0.00003344*(a5*a5)+8.6e-8*Math.pow(a5,3),4);if(a5>0.05){$("#secondary_end_sg").val(i);d.secondary_end_sg=i}N()}});$("#final_brix").on("change",function(a3){var a4,a5,i;if(d.brew_fermenter_sg>=1.02){a4=sg_to_brix(d.brew_fermenter_sg);a5=parseFloat(a3.args.value);i=Round(1.0031-0.002318474*a4-0.000007775*(a4*a4)-3.4e-8*Math.pow(a4,3)+0.00574*(a5)+0.00003344*(a5*a5)+8.6e-8*Math.pow(a5,3),4);if(a5>0.05){$("#fg").val(i);d.fg=i}N()}});$("#fg").on("change",function(i){d.fg=parseFloat(i.args.value);N()});$("#BLog").jqxButton({disabled:(d.log_brew)?false:true});$("#FLog").jqxButton({disabled:(d.log_fermentation)?false:true})}$("#styleSelect").jqxDropDownList({placeHolder:"Kies bierstijl:",theme:theme,source:styleslist,displayMember:"name",width:180,height:23,dropDownVerticalAlignment:"top",dropDownWidth:500,dropDownHeight:380,renderer:function(a3,i,a5){var a4=styleslist.records[a3];return a4.style_guide+" "+a4.style_letter+" "+a4.name}});$("#styleSelect").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=styleslist.records[i];$("#st_name").val(a3.name);$("#st_category").val(a3.category);$("#st_category_number").val(a3.category_number);$("#st_letter").val(a3.style_letter);$("#st_guide").val(a3.style_guide);$("#st_type").val(StyleTypeData[a3.type].nl);$("#st_og_min").val(a3.og_min);$("#st_og_max").val(a3.og_max);$("#st_fg_min").val(a3.fg_min);$("#st_fg_max").val(a3.fg_max);$("#st_ibu_min").val(a3.ibu_min);$("#st_ibu_max").val(a3.ibu_max);$("#st_color_min").val(a3.color_min);$("#st_color_max").val(a3.color_max);$("#st_carb_min").val(a3.carb_min);$("#st_carb_min2").val(a3.carb_min);$("#st_carb_max").val(a3.carb_max);$("#st_carb_max2").val(a3.carb_max);$("#st_abv_min").val(a3.abv_min);$("#st_abv_max").val(a3.abv_max)}});$("#equipmentSelect").jqxDropDownList({placeHolder:"Kies apparatuur:",theme:theme,source:equipmentlist,displayMember:"name",width:170,height:23,dropDownWidth:300,renderer:function(a3,i,a5){var a4=equipmentlist.records[a3];return a4.batch_size+" liter "+a4.name}});$("#equipmentSelect").on("select",function(a5){if(a5.args){var a4,a3,i=a5.args.index;a4=equipmentlist.records[i];a3=a4.batch_size/d.batch_size;$("#eq_name").val(a4.name);$("#eq_boil_size").val(a4.boil_size);d.boil_size=a4.boil_size;$("#boil_size").val(a4.boil_size);$("#eq_batch_size").val(a4.batch_size);d.batch_size=a4.batch_size;$("#batch_size").val(a4.batch_size);$("#est_a_vol").val(a4.batch_size*1.04);$("#eq_tun_volume").val(a4.tun_volume);d.eq_tun_weight=a4.tun_weight;d.eq_tun_specific_heat=a4.tun_specific_heat;d.eq_tun_material=a4.tun_material;d.eq_tun_height=a4.tun_height/100;$("#eq_top_up_water").val(a4.top_up_water);d.eq_trub_chiller_loss=a4.trub_chiller_loss;$("#eq_trub_chiller_loss").val(a4.trub_chiller_loss);$("#eq_evap_rate").val(a4.evap_rate);$("#eq_boil_time").val(a4.boil_time);d.eq_calc_boil_volume=a4.calc_boil_volume;$("#eq_top_up_kettle").val(a4.top_up_kettle);$("#eq_hop_utilization").val(a4.hop_utilization);$("#eq_notes").val(a4.notes);$("#eq_lauter_volume").val(a4.lauter_volume);d.eq_lauter_height=a4.lauter_height/100;$("#eq_lauter_deadspace").val(a4.lauter_deadspace);$("#eq_kettle_volume").val(a4.kettle_volume);d.eq_kettle_height=a4.kettle_height/100;$("#eq_mash_volume").val(a4.mash_volume);$("#eq_mash_max").val(a4.mash_max);d.eq_mash_max=a4.mash_max;$("#mash_max").val(a4.mash_max);$("#eq_efficiency").val(a4.efficiency);d.efficiency=a4.efficiency;$("#efficiency").val(a4.efficiency);d.sparge_volume=Math.round(a4.boil_size*5)/10;$("#sparge_volume").val(d.sparge_volume);$("#brew_sparge_volume").val(d.sparge_volume);$("#est_pre_vol").val(a4.boil_size*1.04);af(parseFloat($("#est_og").jqxNumberInput("decimal")));au(a3);U();aj(a3);a2(a3);aP(a3);at();Q();j()}});function s(i){var a4={record:my_record,uuid:d.uuid,name:$("#name").val(),code:$("#code").val(),birth:$("#birth").val(),stage:d.stage,notes:$("#notes").val(),log_brew:d.log_brew,log_fermentation:d.log_fermentation,inventory_reduced:d.inventory_reduced,locked:d.locked,eq_name:$("#eq_name").val(),eq_boil_size:parseFloat($("#eq_boil_size").jqxNumberInput("decimal")),eq_batch_size:parseFloat($("#eq_batch_size").jqxNumberInput("decimal")),eq_tun_volume:parseFloat($("#eq_tun_volume").jqxNumberInput("decimal")),eq_tun_weight:d.eq_tun_weight,eq_tun_specific_heat:d.eq_tun_specific_heat,eq_tun_material:d.eq_tun_material,eq_tun_height:d.eq_tun_height,eq_top_up_water:parseFloat($("#eq_top_up_water").jqxNumberInput("decimal")),eq_trub_chiller_loss:parseFloat($("#eq_trub_chiller_loss").jqxNumberInput("decimal")),eq_evap_rate:parseFloat($("#eq_evap_rate").jqxNumberInput("decimal")),eq_boil_time:parseFloat($("#eq_boil_time").jqxNumberInput("decimal")),eq_calc_boil_volume:d.eq_calc_boil_volume,eq_top_up_kettle:parseFloat($("#eq_top_up_kettle").jqxNumberInput("decimal")),eq_hop_utilization:parseFloat($("#eq_hop_utilization").jqxNumberInput("decimal")),eq_notes:$("#eq_notes").val(),eq_lauter_volume:parseFloat($("#eq_lauter_volume").jqxNumberInput("decimal")),eq_lauter_height:d.eq_lauter_height,eq_lauter_deadspace:parseFloat($("#eq_lauter_deadspace").jqxNumberInput("decimal")),eq_kettle_volume:parseFloat($("#eq_kettle_volume").jqxNumberInput("decimal")),eq_kettle_height:d.eq_kettle_height,eq_mash_volume:parseFloat($("#eq_mash_volume").jqxNumberInput("decimal")),eq_mash_max:parseFloat($("#eq_mash_max").jqxNumberInput("decimal")),eq_efficiency:parseFloat($("#eq_efficiency").jqxNumberInput("decimal")),brew_date_start:$("#brew_date_start").val(),brew_mash_ph:parseFloat($("#brew_mash_ph").jqxNumberInput("decimal")),brew_mash_sg:parseFloat($("#brew_mash_sg").jqxNumberInput("decimal")),brew_mash_efficiency:parseFloat($("#brew_mash_efficiency").jqxNumberInput("decimal")),brew_sparge_est:parseFloat($("#brew_sparge_est").jqxNumberInput("decimal")),brew_sparge_ph:parseFloat($("#brew_sparge_ph").jqxNumberInput("decimal")),brew_preboil_volume:parseFloat($("#brew_preboil_volume").jqxNumberInput("decimal")),brew_preboil_sg:parseFloat($("#brew_preboil_sg").jqxNumberInput("decimal")),brew_preboil_ph:parseFloat($("#brew_preboil_ph").jqxNumberInput("decimal")),brew_preboil_efficiency:parseFloat($("#brew_preboil_efficiency").jqxNumberInput("decimal")),brew_aboil_volume:parseFloat($("#brew_aboil_volume").jqxNumberInput("decimal")),brew_aboil_sg:parseFloat($("#brew_aboil_sg").jqxNumberInput("decimal")),brew_aboil_ph:parseFloat($("#brew_aboil_ph").jqxNumberInput("decimal")),brew_aboil_efficiency:parseFloat($("#brew_aboil_efficiency").jqxNumberInput("decimal")),brew_cooling_method:$("#brew_cooling_method").val(),brew_cooling_time:parseFloat($("#brew_cooling_time").jqxNumberInput("decimal")),brew_cooling_to:parseFloat($("#brew_cooling_to").jqxNumberInput("decimal")),brew_whirlpool9:parseFloat($("#brew_whirlpool9").jqxNumberInput("decimal")),brew_whirlpool7:parseFloat($("#brew_whirlpool7").jqxNumberInput("decimal")),brew_whirlpool6:parseFloat($("#brew_whirlpool6").jqxNumberInput("decimal")),brew_whirlpool2:parseFloat($("#brew_whirlpool2").jqxNumberInput("decimal")),brew_fermenter_volume:parseFloat($("#brew_fermenter_volume").jqxNumberInput("decimal")),brew_fermenter_extrawater:parseFloat($("#brew_fermenter_extrawater").jqxNumberInput("decimal")),brew_fermenter_tcloss:parseFloat($("#brew_fermenter_tcloss").jqxNumberInput("decimal")),brew_aeration_time:parseFloat($("#brew_aeration_time").jqxNumberInput("decimal")),brew_aeration_speed:parseFloat($("#brew_aeration_speed").jqxNumberInput("decimal")),brew_aeration_type:$("#brew_aeration_type").val(),brew_fermenter_sg:parseFloat($("#brew_fermenter_sg").jqxNumberInput("decimal")),brew_fermenter_ibu:parseFloat($("#brew_fermenter_ibu").jqxNumberInput("decimal")),brew_fermenter_color:parseFloat($("#brew_fermenter_color").jqxNumberInput("decimal")),brew_date_end:$("#brew_date_end").val(),og:d.og,fg:parseFloat($("#fg").jqxNumberInput("decimal")),primary_start_temp:parseFloat($("#primary_start_temp").jqxNumberInput("decimal")),primary_max_temp:parseFloat($("#primary_max_temp").jqxNumberInput("decimal")),primary_end_temp:parseFloat($("#primary_end_temp").jqxNumberInput("decimal")),primary_end_sg:parseFloat($("#primary_end_sg").jqxNumberInput("decimal")),primary_end_date:$("#primary_end_date").val(),secondary_temp:parseFloat($("#secondary_temp").jqxNumberInput("decimal")),secondary_end_sg:parseFloat($("#secondary_end_sg").jqxNumberInput("decimal")),secondary_end_date:$("#secondary_end_date").val(),tertiary_temp:parseFloat($("#tertiary_temp").jqxNumberInput("decimal")),package_date:$("#package_date").val(),package_volume:parseFloat($("#package_volume").jqxNumberInput("decimal")),package_infuse_amount:parseFloat($("#package_infuse_amount").jqxNumberInput("decimal")),package_infuse_abv:parseFloat($("#package_infuse_abv").jqxNumberInput("decimal")),package_infuse_notes:$("#package_infuse_notes").val(),package_abv:parseFloat($("#package_abv").jqxNumberInput("decimal")),package_ph:parseFloat($("#package_ph").jqxNumberInput("decimal")),bottle_amount:parseFloat($("#bottle_amount").jqxNumberInput("decimal")),bottle_carbonation:parseFloat($("#bottle_carbonation").jqxNumberInput("decimal")),bottle_priming_water:parseFloat($("#bottle_priming_water").jqxNumberInput("decimal")),bottle_priming_amount:parseFloat($("#bottle_priming_amount").jqxNumberInput("decimal")),bottle_carbonation_temp:parseFloat($("#bottle_carbonation_temp").jqxNumberInput("decimal")),keg_amount:parseFloat($("#keg_amount").jqxNumberInput("decimal")),keg_carbonation:parseFloat($("#keg_carbonation").jqxNumberInput("decimal")),keg_priming_water:parseFloat($("#keg_priming_water").jqxNumberInput("decimal")),keg_priming_amount:parseFloat($("#keg_priming_amount").jqxNumberInput("decimal")),keg_carbonation_temp:parseFloat($("#keg_carbonation_temp").jqxNumberInput("decimal")),keg_forced_carb:d.keg_forced_carb,keg_pressure:parseFloat($("#keg_pressure").jqxNumberInput("decimal")),taste_notes:$("#taste_notes").val(),taste_rate:parseFloat($("#taste_rate").jqxNumberInput("decimal")),taste_date:$("#taste_date").val(),taste_color:$("#taste_color").val(),taste_transparency:$("#taste_transparency").val(),taste_head:$("#taste_head").val(),taste_aroma:$("#taste_aroma").val(),taste_taste:$("#taste_taste").val(),taste_mouthfeel:$("#taste_mouthfeel").val(),taste_aftertaste:$("#taste_aftertaste").val(),st_name:$("#st_name").val(),st_letter:$("#st_letter").val(),st_guide:$("#st_guide").val(),st_type:d.st_type,st_category:$("#st_category").val(),st_category_number:parseFloat($("#st_category_number").jqxNumberInput("decimal")),st_og_min:parseFloat($("#st_og_min").jqxNumberInput("decimal")),st_og_max:parseFloat($("#st_og_max").jqxNumberInput("decimal")),st_fg_min:parseFloat($("#st_fg_min").jqxNumberInput("decimal")),st_fg_max:parseFloat($("#st_fg_max").jqxNumberInput("decimal")),st_ibu_min:parseFloat($("#st_ibu_min").jqxNumberInput("decimal")),st_ibu_max:parseFloat($("#st_ibu_max").jqxNumberInput("decimal")),st_color_min:parseFloat($("#st_color_min").jqxNumberInput("decimal")),st_color_max:parseFloat($("#st_color_max").jqxNumberInput("decimal")),st_carb_min:parseFloat($("#st_carb_min").jqxNumberInput("decimal")),st_carb_max:parseFloat($("#st_carb_max").jqxNumberInput("decimal")),st_abv_min:parseFloat($("#st_abv_min").jqxNumberInput("decimal")),st_abv_max:parseFloat($("#st_abv_max").jqxNumberInput("decimal")),type:$("#type").val(),batch_size:parseFloat($("#batch_size").jqxNumberInput("decimal")),boil_size:parseFloat($("#boil_size").jqxNumberInput("decimal")),boil_time:parseFloat($("#boil_time").jqxNumberInput("decimal")),efficiency:parseFloat($("#efficiency").jqxNumberInput("decimal")),est_og:parseFloat($("#est_og").jqxNumberInput("decimal")),est_fg:parseFloat($("#est_fg").jqxNumberInput("decimal")),est_abv:parseFloat($("#est_abv").jqxNumberInput("decimal")),est_color:parseFloat($("#est_color").jqxNumberInput("decimal")),color_method:$("#color_method").val(),est_ibu:parseFloat($("#est_ibu").jqxNumberInput("decimal")),ibu_method:$("#ibu_method").val(),est_carb:parseFloat($("#est_carb").jqxNumberInput("decimal")),mash_name:$("#mash_name").val(),mash_ph:parseFloat($("#mash_ph").jqxNumberInput("decimal")),sparge_temp:parseFloat($("#sparge_temp").jqxNumberInput("decimal")),sparge_ph:parseFloat($("#sparge_ph").jqxNumberInput("decimal")),sparge_volume:parseFloat($("#sparge_volume").jqxNumberInput("decimal")),sparge_source:$("#sparge_source").val(),sparge_acid_type:$("#sparge_acid_type").val(),sparge_acid_perc:parseFloat($("#sparge_acid_perc").jqxNumberInput("decimal")),sparge_acid_amount:d.sparge_acid_amount,calc_acid:d.calc_acid,w1_name:$("#w1_name").val(),w1_amount:parseFloat($("#w1_amount").jqxNumberInput("decimal")),w1_calcium:parseFloat($("#w1_calcium").jqxNumberInput("decimal")),w1_sulfate:parseFloat($("#w1_sulfate").jqxNumberInput("decimal")),w1_chloride:parseFloat($("#w1_chloride").jqxNumberInput("decimal")),w1_sodium:parseFloat($("#w1_sodium").jqxNumberInput("decimal")),w1_magnesium:parseFloat($("#w1_magnesium").jqxNumberInput("decimal")),w1_total_alkalinity:parseFloat($("#w1_total_alkalinity").jqxNumberInput("decimal")),w1_ph:parseFloat($("#w1_ph").jqxNumberInput("decimal")),w1_cost:d.w1_cost,w2_name:$("#w2_name").val(),w2_amount:parseFloat($("#w2_amount").jqxNumberInput("decimal")),w2_calcium:parseFloat($("#w2_calcium").jqxNumberInput("decimal")),w2_sulfate:parseFloat($("#w2_sulfate").jqxNumberInput("decimal")),w2_chloride:parseFloat($("#w2_chloride").jqxNumberInput("decimal")),w2_sodium:parseFloat($("#w2_sodium").jqxNumberInput("decimal")),w2_magnesium:parseFloat($("#w2_magnesium").jqxNumberInput("decimal")),w2_total_alkalinity:parseFloat($("#w2_total_alkalinity").jqxNumberInput("decimal")),w2_ph:parseFloat($("#w2_ph").jqxNumberInput("decimal")),w2_cost:d.w2_cost,wg_amount:parseFloat($("#wg_amount").jqxNumberInput("decimal")),wg_calcium:parseFloat($("#wg_calcium").jqxNumberInput("decimal")),wg_sulfate:parseFloat($("#wg_sulfate").jqxNumberInput("decimal")),wg_chloride:parseFloat($("#wg_chloride").jqxNumberInput("decimal")),wg_sodium:parseFloat($("#wg_sodium").jqxNumberInput("decimal")),wg_magnesium:parseFloat($("#wg_magnesium").jqxNumberInput("decimal")),wg_total_alkalinity:parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal")),wg_ph:parseFloat($("#wg_ph").jqxNumberInput("decimal")),wb_calcium:parseFloat($("#wb_calcium").jqxNumberInput("decimal")),wb_sulfate:parseFloat($("#wb_sulfate").jqxNumberInput("decimal")),wb_chloride:parseFloat($("#wb_chloride").jqxNumberInput("decimal")),wb_sodium:parseFloat($("#wb_sodium").jqxNumberInput("decimal")),wb_magnesium:parseFloat($("#wb_magnesium").jqxNumberInput("decimal")),wb_total_alkalinity:parseFloat($("#wb_total_alkalinity").jqxNumberInput("decimal")),wb_ph:parseFloat($("#wb_ph").jqxNumberInput("decimal")),wa_acid_name:$("#wa_acid_name").val(),wa_acid_perc:parseFloat($("#wa_acid_perc").jqxNumberInput("decimal")),wa_base_name:$("#wa_base_name").val(),starter_enable:d.starter_enable,starter_type:$("#starter_type").val(),starter_sg:parseFloat($("#starter_sg").jqxNumberInput("decimal")),starter_viability:parseFloat($("#starter_viability").jqxNumberInput("decimal")),prop1_type:$("#prop1_type").val(),prop1_volume:parseFloat($("#prop1_volume").jqxNumberInput("decimal")),prop2_type:$("#prop2_type").val(),prop2_volume:parseFloat($("#prop2_volume").jqxNumberInput("decimal")),prop3_type:$("#prop3_type").val(),prop3_volume:parseFloat($("#prop3_volume").jqxNumberInput("decimal")),prop4_type:$("#prop4_type").val(),prop4_volume:parseFloat($("#prop4_volume").jqxNumberInput("decimal")),divide_type:d.divide_type,divide_size:d.divide_size,divide_parts:d.divide_parts,fermentables:$("#fermentableGrid").jqxGrid("getrows"),hops:$("#hopGrid").jqxGrid("getrows"),miscs:$("#miscGrid").jqxGrid("getrows"),yeasts:$("#yeastGrid").jqxGrid("getrows"),mashs:$("#mashGrid").jqxGrid("getrows")},a3="update=true&"+$.param(a4);$.ajax({dataType:"json",url:E,cache:false,data:a3,async:false,type:"POST",success:function(a6,a5,a7){console.log("saveRecord("+i+") success");if(i){window.location.href=my_return}else{window.location.href="prod_export.php?record="+my_record+"&return="+my_return+"&select="+my_select+"&code="+d.code+"&name="+d.name+"&stage="+d.stage+"&split="+d.divide_type}},error:function(a5,a7,a6){console.log("saveRecord() "+a7)}})}ah.dataBind();$("#name").jqxTooltip({content:"De naam voor dit product."});$("#name").jqxInput({theme:theme,width:640,height:23});$("#code").jqxTooltip({content:"Product code nummer."});$("#code").jqxInput({theme:theme,width:100,height:23});$("#birth").jqxTooltip({content:"De ontwerp datum van dit product."});$("#birth").jqxInput({theme:theme,width:120,height:23});$("#stage").jqxTooltip({content:"De productie fase van dit product."});$("#stage").jqxInput({theme:theme,width:100,height:23});$("#locked").jqxCheckBox({theme:theme,width:120,height:23,disabled:true});$("#locked").on("checked",function(i){if(d.stage>=10){d.locked=1;d.stage=11;aV()}});$("#locked").on("unchecked",function(i){if(d.stage>=10){d.locked=0;d.stage=10;aV()}});$("#divide_parts").jqxTooltip({content:"Het aantal gesplitste brouw producten."});$("#divide_parts").jqxNumberInput(Show0dec);$("#divide_type").jqxTooltip({content:"Het splitsing moment in het productie proces."});$("#divide_type").jqxInput({theme:theme,width:120,height:23});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit product."});$("#notes").jqxInput({theme:theme,width:960,height:100});$("#type").jqxTooltip({content:"Het brouw type van dit recept."});$("#type").jqxDropDownList({theme:theme,source:RecipeTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#efficiency").jqxTooltip({content:"Het rendement van maischen en koken."});$("#efficiency").jqxNumberInput(Perc1dec);$("#batch_size").jqxTooltip({content:"Het volume van het gekoelde wort na het koken."});$("#batch_size").jqxNumberInput(Spin1dec);$("#batch_size").jqxNumberInput({min:4});$("#boil_time").jqxTooltip({content:"De kooktijd in minuten."});$("#boil_time").jqxNumberInput(PosInt);$("#boil_time").jqxNumberInput({min:4,max:360});$("#boil_size").jqxTooltip({content:"Het volume van het wort voor het koken."});$("#boil_size").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:2,readOnly:true});$("#st_guide").jqxTooltip({content:"De bierstijl gids voor dit recept."});$("#st_guide").jqxInput({theme:theme,width:250,height:23});$("#st_name").jqxTooltip({content:"De bierstijl naam voor dit recept."});$("#st_name").jqxInput({theme:theme,width:250,height:23});$("#st_letter").jqxTooltip({content:"De bierstijl letter voor dit recept."});$("#st_letter").jqxInput({theme:theme,width:90,height:23});$("#st_type").jqxTooltip({content:"Het bierstijl type."});$("#st_type").jqxInput({theme:theme,width:250,height:23});$("#st_category").jqxTooltip({content:"De Amerikaanse bierstijl categorie."});$("#st_category").jqxInput({theme:theme,width:250,height:23});$("#st_category_number").jqxTooltip({content:"De Amerikaanse bierstijl categorie sub nummer."});$("#st_category_number").jqxNumberInput(Smal0dec);$("#est_og").jqxTooltip({content:"Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend."});$("#est_og").jqxNumberInput(SGopts);$("#st_og_min").jqxTooltip({content:"Het minimum begin SG voor deze bierstijl."});$("#st_og_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_og_max").jqxTooltip({content:"Het maximum begin SG voor deze bierstijl."});$("#st_og_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#est_fg").jqxTooltip({content:"Het verwachte eind SG. Dit wordt automatisch berekend."});$("#est_fg").jqxNumberInput(Show3dec);$("#st_fg_min").jqxTooltip({content:"Het minimum eind SG voor deze bierstijl."});$("#st_fg_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_fg_max").jqxTooltip({content:"Het maximum eind SG voor deze bierstijl."});$("#st_fg_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#est_abv").jqxTooltip({content:"Alcohol volume %. Dit wordt automatisch berekend."});$("#est_abv").jqxNumberInput(Smal1dec);$("#st_abv_min").jqxTooltip({content:"Het minimum alcohol volume % voor deze bierstijl."});$("#st_abv_min").jqxNumberInput(Smal1dec);$("#st_abv_max").jqxTooltip({content:"Het maximum alcohol volume % voor deze bierstijl."});$("#st_abv_max").jqxNumberInput(Smal1dec);$("#est_color").jqxTooltip({content:"De kleur in EBC. Dit wordt automatisch berekend."});$("#est_color").jqxNumberInput(Show0dec);$("#st_color_min").jqxTooltip({content:"De minimum kleur voor deze bierstijl."});$("#st_color_min").jqxNumberInput(Smal0dec);$("#st_color_max").jqxTooltip({content:"De maximum kleur voor deze bierstijl."});$("#st_color_max").jqxNumberInput(Smal0dec);$("#color_method").jqxDropDownList({theme:theme,source:ColorMethodAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#est_ibu").jqxTooltip({content:"De bitterheid in IBU. Dit wordt automatisch berekend."});$("#est_ibu").jqxNumberInput(Show0dec);$("#st_ibu_min").jqxTooltip({content:"De minimum bitterheid voor deze bierstijl."});$("#st_ibu_min").jqxNumberInput(Smal0dec);$("#st_ibu_max").jqxTooltip({content:"De maximum bitterheid voor deze bierstijl."});$("#st_ibu_max").jqxNumberInput(Smal0dec);$("#ibu_method").jqxDropDownList({theme:theme,source:IBUmethodAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#kcal").jqxTooltip({content:"Energie-inhoud in kcal/liter."});$("#kcal").jqxNumberInput(Smal0dec);$("#est_carb").jqxTooltip({content:"Koolzuur volume. Dit wordt automatisch berekend."});$("#est_carb").jqxNumberInput(Smal1dec);$("#st_carb_min").jqxTooltip({content:"Het minimum koolzuur volume voor deze bierstijl."});$("#st_carb_min").jqxNumberInput(Smal1dec);$("#st_carb_max").jqxTooltip({content:"Het maximum koolzuur volume voor deze bierstijl."});$("#st_carb_max").jqxNumberInput(Smal1dec);$("#eq_name").jqxTooltip({content:"De naam van deze brouw apparatuur."});$("#eq_name").jqxInput({theme:theme,width:250,height:23});$("#eq_boil_size").jqxTooltip({content:"Normaal kook volume in liters"});$("#eq_boil_size").jqxNumberInput(Show1dec);$("#eq_batch_size").jqxTooltip({content:"Berekende batch grootte in liters aan het eind van de kook."});$("#eq_batch_size").jqxNumberInput(Show1dec);$("#eq_tun_volume").jqxTooltip({content:"Maisch ketel volume."});$("#eq_tun_volume").jqxNumberInput(Show1dec);$("#eq_top_up_water").jqxTooltip({content:"Extra water in het gistvat."});$("#eq_top_up_water").jqxNumberInput(Show1dec);$("#eq_trub_chiller_loss").jqxTooltip({content:"Standaard verlies bij het overbrengen naar het gistvat."});$("#eq_trub_chiller_loss").jqxNumberInput(Show1dec);$("#eq_evap_rate").jqxTooltip({content:"Verdamping in liters per uur."});$("#eq_evap_rate").jqxNumberInput(Show2dec);$("#eq_boil_time").jqxTooltip({content:"Normale kooktijd in minuten."});$("#eq_boil_time").jqxNumberInput(Show0dec);$("#eq_top_up_kettle").jqxTooltip({content:"Extra water toevoegen tijdens de kook."});$("#eq_top_up_kettle").jqxNumberInput(Show1dec);$("#eq_hop_utilization").jqxTooltip({content:"100% voor kleine installaties, hoger voor grote brouwerijen."});$("#eq_hop_utilization").jqxNumberInput(Show0dec);$("#eq_notes").jqxTooltip({content:"Opmerkingen over deze apparatuur."});$("#eq_notes").jqxInput({theme:theme,width:960,height:200});$("#eq_lauter_volume").jqxTooltip({content:"Filterkuip volume."});$("#eq_lauter_volume").jqxNumberInput(Show1dec);$("#eq_lauter_deadspace").jqxTooltip({content:"Filterkuip verlies in liters."});$("#eq_lauter_deadspace").jqxNumberInput(Show1dec);$("#eq_kettle_volume").jqxTooltip({content:"Kook ketel volume in liters."});$("#eq_kettle_volume").jqxNumberInput(Show1dec);$("#eq_mash_volume").jqxTooltip({content:"Maisch water voor de eerste stap."});$("#eq_mash_volume").jqxNumberInput(Show1dec);$("#eq_mash_max").jqxTooltip({content:"De maximale moutstort in Kg."});$("#eq_mash_max").jqxNumberInput(Show1dec);$("#eq_efficiency").jqxTooltip({content:"Gemiddeld brouwzaal rendement."});$("#eq_efficiency").jqxNumberInput(Show1dec);$("#est_color2").jqxTooltip({content:"De kleur in EBC. Dit wordt automatisch berekend."});$("#est_color2").jqxNumberInput(Show0dec);$("#est_og2").jqxTooltip({content:"Het geschatte begin SG van dit product."});$("#est_og2").jqxNumberInput(Show3dec);$("#mash_kg").jqxTooltip({content:"Het gewicht van alle mouten in de maisch."});$("#mash_kg").jqxNumberInput(Show3dec);$("#perc_malts").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:120,animationDuration:0,colorRanges:[{stop:90,color:"#008C00"},{stop:100,color:"#EB7331"},{stop:120,color:"#FF0000"}],renderText:function(i){return(Math.round(parseInt(i)*1.2))+"%"}});$("#perc_sugars").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:50,animationDuration:0,colorRanges:[{stop:20,color:"#008C00"},{stop:50,color:"#FF0000"}],renderText:function(i){return(Math.round(parseInt(i)*5)/10)+"%"}});$("#perc_cara").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:50,animationDuration:0,colorRanges:[{stop:25,color:"#008C00"},{stop:50,color:"#FF0000"}],renderText:function(i){return(Math.round(parseInt(i)*5)/10)+"%"}});$("#ferm_lintner").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:200,animationDuration:0,colorRanges:[{stop:30,color:"#FF0000"},{stop:40,color:"#EB7331"},{stop:200,color:"#008C00"}],renderText:function(i){return(parseInt(i)*2)+" lintner"}});$("#popupFermentable").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#FermentableReady"),modalOpacity:0.4});$("#FermentableReady").jqxButton({template:"success",width:"90px",theme:theme});$("#FermentableReady").click(function(){var a3,i=$("#fermentableGrid").jqxGrid("getrowid",u);console.log("FermentableReady row:"+u+" ID:"+i);a3={f_name:aL.f_name,f_origin:aL.f_origin,f_supplier:aL.f_supplier,f_amount:aL.f_amount,f_cost:aL.f_cost,f_type:aL.f_type,f_yield:aL.f_yield,f_color:aL.f_color,f_coarse_fine_diff:aL.f_coarse_fine_diff,f_moisture:aL.f_moisture,f_diastatic_power:aL.f_diastatic_power,f_protein:aL.f_protein,f_max_in_batch:aL.f_max_in_batch,f_graintype:aL.f_graintype,f_added:aL.f_added,f_dissolved_protein:aL.f_dissolved_protein,f_recommend_mash:aL.f_recommend_mash,f_add_after_boil:aL.f_add_after_boil,f_adjust_to_total_100:aL.f_adjust_to_total_100,f_percentage:aL.f_percentage,f_di_ph:aL.f_di_ph,f_acid_to_ph_57:aL.f_acid_to_ph_57,f_inventory:aL.f_inventory,f_avail:aL.f_avail};$("#fermentableGrid").jqxGrid("updaterow",i,a3);aW();U();at();aO()});$("#wf_name").jqxInput({theme:theme,width:320,height:23});$("#wf_instock").jqxCheckBox({theme:theme,height:23});$("#wf_instock").on("change",function(i){fermentableinstock=i.args.checked;fermentablelist.dataBind()});$("#wf_select").jqxDropDownList({placeHolder:"Kies mout:",theme:theme,source:fermentablelist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(a3,i,a5){var a4=fermentablelist.records[a3];return a4.supplier+" / "+a4.name+" ("+a4.color+" EBC)"}});$("#wf_select").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=fermentablelist.records[i];$("#wf_name").val(a3.name);aL.f_name=a3.name;aL.f_origin=a3.origin;aL.f_supplier=a3.supplier;aL.f_type=a3.type;aL.f_cost=a3.cost;aL.f_yield=a3.yield;aL.f_color=a3.color;aL.f_coarse_fine_diff=a3.coarse_fine_diff;aL.f_moisture=a3.moisture;aL.f_diastatic_power=a3.diastatic_power;aL.f_protein=a3.protein;aL.f_max_in_batch=a3.max_in_batch;aL.f_graintype=a3.graintype;aL.f_dissolved_protein=a3.dissolved_protein;aL.f_recommend_mash=a3.recommend_mash;aL.f_add_after_boil=a3.add_after_boil;aL.f_di_ph=a3.di_ph;aL.f_acid_to_ph_57=a3.acid_to_ph_57;aL.f_inventory=a3.inventory}});$("#wf_amount").jqxNumberInput(Spin3dec);$("#wf_amount").on("change",function(i){console.log("amount changed: "+i.args.value);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_amount",i.args.value);aL.f_amount=i.args.value;if(!l){aW();U();at();aO()}});$("#wf_percentage").jqxNumberInput(Perc1dec);$("#wf_percentage").on("change",function(a3){var a5,a9,bb,ba,a6,a8,i,a7,bc,a4=Math.round(aL.f_percentage*10)/10;a5=a3.args.value;console.log("percentage changed: "+a5+" old: "+a4);aL.f_percent=a5;a9=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if((a4!=a5)&&(a9>1)){bb=$("#fermentableGrid").jqxGrid("getrowdata",u);if(bb.f_adjust_to_total_100){$("#wf_percentage").val(a4)}else{ba=a5-a4;a6=0;for(ae=0;ae<a9;ae++){bb=$("#fermentableGrid").jqxGrid("getrowdata",ae);if(bb.f_added<4){a6+=Math.round(bb.f_amount*1000)/1000}}a6=Math.round(a6*1000)/1000;if(l){a8=Math.round(a6*ba*10)/1000;bb=$("#fermentableGrid").jqxGrid("getrowdata",u);i=Round(bb.f_amount+a8,3);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_amount",i);$("#wf_amount").val(i);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_percentage",bb.f_percentage+ba);for(ae=0;ae<a9;ae++){bb=$("#fermentableGrid").jqxGrid("getrowdata",ae);if(bb.f_adjust_to_total_100){i=bb.f_amount-a8;$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",bb.f_percentage-ba);$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_amount",i)}}U();at();aO()}else{a7=a6*ba/100;for(ae=0;ae<a9;ae++){bb=$("#fermentableGrid").jqxGrid("getrowdata",ae);if(bb.f_added<4){if(ae==u){i=Math.round((bb.f_amount+a7)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_amount",i);$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",a5)}else{i=Math.round((bb.f_amount-(a7/(a9-1)))*1000)/1000;bc=Math.round((i/a6)*1000)/10;$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_amount",i);$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",bc)}}else{$("#fermentableGrid").jqxGrid("setcellvalue",ae,"f_percentage",0)}}U();at();aO()}}}});$("#wf_max_in_batch").jqxNumberInput(Show1dec);$("#wf_adjust_to_total_100").jqxCheckBox({theme:theme,width:120,height:23});$("#wf_adjust_to_total_100").on("checked",function(a4){if(aL.f_adjust_to_total_100==0){if(l){var a3,a5=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(a3=0;a3<a5;a3++){if(a3!=u){$("#fermentableGrid").jqxGrid("setcellvalue",a3,"f_adjust_to_total_100",0)}}}$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",1);U()}});$("#wf_adjust_to_total_100").on("unchecked",function(i){if(aL.f_adjust_to_total_100!=0){$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",0);U()}});$("#wf_added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wf_added").on("select",function(a3){if(a3.args){var i=a3.args.index;$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_added",i);U();at();aO()}});$("#est_ibu2").jqxTooltip({content:"De bitterheid in IBU. Dit wordt automatisch berekend."});$("#est_ibu2").jqxNumberInput(Smal0dec);$("#hop_flavour").jqxProgressBar({width:300,height:23,theme:theme,showText:true,animationDuration:0,colorRanges:[{stop:20,color:"#004D00"},{stop:40,color:"#008C00"},{stop:60,color:"#00BF00"},{stop:80,color:"#00FF00"},{stop:100,color:"#80FF80"}],renderText:function(a3){var i=parseInt(a3);if(i<20){return"Weinig"}else{if(i<40){return"Matig"}else{if(i<60){return"Redelijk"}else{if(i<80){return"Veel"}else{return"Zeer veel"}}}}}});$("#hop_aroma").jqxProgressBar({width:300,height:23,theme:theme,showText:true,animationDuration:0,colorRanges:[{stop:20,color:"#004D00"},{stop:40,color:"#008C00"},{stop:60,color:"#00BF00"},{stop:80,color:"#00FF00"},{stop:100,color:"#80FF80"}],renderText:function(a3){var i=parseInt(a3);if(i<20){return"Weinig"}else{if(i<40){return"Matig"}else{if(i<60){return"Redelijk"}else{if(i<80){return"Veel"}else{return"Zeer veel"}}}}}});$("#popupHop").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#HopReady"),modalOpacity:0.4});$("#HopReady").jqxButton({template:"success",width:"90px",theme:theme});$("#HopReady").click(function(){var a3,i=$("#hopGrid").jqxGrid("getrowid",a);a3={h_name:$("#wh_name").val(),h_origin:e.h_origin,h_amount:parseFloat($("#wh_amount").jqxNumberInput("decimal"))/1000,h_cost:e.h_cost,h_type:e.h_type,h_form:e.h_form,h_useat:$("#wh_useat").val(),h_time:e.h_time,h_alpha:e.h_alpha,h_beta:e.h_beta,h_hsi:e.h_hsi,h_humulene:e.h_humulene,h_caryophyllene:e.h_caryophyllene,h_cohumulone:e.h_cohumulone,h_myrcene:e.h_myrcene,h_total_oil:e.h_total_oil,h_inventory:e.h_inventory,h_avail:e.h_avail};$("#hopGrid").jqxGrid("updaterow",i,a3);at()});$("#wh_name").jqxInput({theme:theme,width:320,height:23});$("#wh_instock").jqxCheckBox({theme:theme,height:23});$("#wh_instock").on("change",function(i){hopinstock=i.args.checked;hoplist.dataBind()});$("#wh_select").jqxDropDownList({placeHolder:"Kies hop:",theme:theme,source:hoplist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(a3,i,a5){var a4=hoplist.records[a3];return a4.origin+" - "+a4.name+" / "+HopFormData[a4.form].nl+" ("+a4.alpha+" % &alpha;)"}});$("#wh_select").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=hoplist.records[i];$("#wh_name").val(a3.name);e.h_name=a3.name;e.h_origin=a3.origin;e.h_cost=a3.cost;e.h_type=a3.type;e.h_form=a3.form;e.h_alpha=a3.alpha;e.h_beta=a3.beta;e.h_hsi=a3.hsi;e.h_humulene=a3.humulene;e.h_caryophyllene=a3.caryophyllene;e.h_cohumulone=a3.cohumulone;e.h_myrcene=a3.myrcene;e.h_total_oil=a3.total_oil;e.h_inventory=a3.inventory}});$("#wh_amount").jqxNumberInput(Spin1dec);$("#wh_amount").on("change",function(a3){console.log("amount changed: "+a3.args.value+" time:"+e.h_time+" alpha:"+e.h_alpha);var a4,i=parseFloat(a3.args.value)/1000;a4=toIBU(e.h_useat,e.h_form,al,parseFloat($("#batch_size").jqxNumberInput("decimal")),i,parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());e.h_amount=i;$("#wh_ibu").val(a4)});$("#wh_ibu").jqxNumberInput(Show1dec);$("#wh_time").jqxNumberInput(PosInt);$("#wh_time").on("change",function(i){var a4,a3=parseFloat(i.args.value);if(e.h_useat==2){if(a3>parseFloat($("#boil_time").jqxNumberInput("decimal"))){a3=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wh_time").val(a3)}e.h_time=a3}else{if(e.h_useat==4){if(a3>120){a3=120;$("#wh_time").val(a3)}e.h_time=a3}else{if(e.h_useat==5){if(a3>21){a3=21;$("#wh_time").val(a3)}e.h_time=a3*1440}}}a4=toIBU(e.h_useat,e.h_form,al,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(a4)});$("#wh_useat").jqxDropDownList({theme:theme,source:HopUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wh_useat").on("select",function(a3){if(a3.args){var i=a3.args.index;e.h_useat=i;if((i==0)||(i==1)){e.h_time=parseFloat(d.boil_time);$("#wh_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wh_time").val(e.h_time)}else{if(i==3){e.h_time=0;$("#wh_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wh_time").val(0)}else{$("#wh_time").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}}if(i==5){$("#wh_pmpt_time").html("Tijd in dagen")}else{$("#wh_pmpt_time").html("Tijd in minuten")}}});$("#popupMisc").jqxWindow({width:800,height:275,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#MiscReady"),modalOpacity:0.4});$("#MiscReady").jqxButton({template:"success",width:"90px",theme:theme});$("#MiscReady").click(function(){var a3,i=$("#miscGrid").jqxGrid("getrowid",aw);console.log("MiscReady row:"+aw+" ID:"+i);a3={m_name:aH.m_name,m_amount:aH.m_amount,m_cost:aH.m_cost,m_type:aH.m_type,m_use_use:aH.m_use_use,m_time:aH.m_time,m_amount_is_weight:aH.m_amount_is_weight,m_inventory:aH.m_inventory,m_avail:aH.m_avail};$("#miscGrid").jqxGrid("updaterow",i,a3);aG()});$("#wm_name").jqxInput({theme:theme,width:320,height:23});$("#wm_instock").jqxCheckBox({theme:theme,height:23});$("#wm_instock").on("change",function(i){miscinstock=i.args.checked;misclist.dataBind()});$("#wm_select").jqxDropDownList({placeHolder:"Kies ingredi&euml;nt:",theme:theme,source:misclist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500});$("#wm_select").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=misclist.records[i];$("#wm_name").val(a3.name);aH.m_name=a3.name;aH.m_cost=a3.cost;aH.m_type=a3.type;aH.m_use_use=a3.use_use;aH.m_amount_is_weight=a3.amount_is_weight;aH.m_inventory=a3.inventory}});$("#wm_amount").jqxNumberInput(Spin2dec);$("#wm_amount").on("change",function(i){console.log("amount changed: "+i.args.value);aH.m_amount=parseFloat(i.args.value)/1000});$("#wm_time").jqxNumberInput(PosInt);$("#wm_time").on("change",function(i){var a3=parseFloat(i.args.value);if(aH.m_use_use==2){if(a3>parseFloat($("#boil_time").jqxNumberInput("decimal"))){a3=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wm_time").val(a3)}aH.m_time=a3}else{if((aH.m_use_use==3)||(aH.m_use_use==4)){if(a3>21){a3=21;$("#wm_time").val(a3)}aH.m_time=a3*1440}}});$("#wm_use_use").jqxDropDownList({theme:theme,source:MiscUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wm_use_use").on("select",function(a3){if(a3.args){var i=a3.args.index;aH.m_use_use=i;if((i==2)||(i==3)||(i==4)){$("#wm_time").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}else{$("#wm_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wm_time").val(0);aH.m_time=0}}});$("#est_fg2").jqxTooltip({content:"Het verwachte eind SG. Dit wordt automatisch berekend."});$("#est_fg2").jqxNumberInput(Show3dec);$("#est_abv2").jqxTooltip({content:"Alcohol volume %. Dit wordt automatisch berekend."});$("#est_abv2").jqxNumberInput(Smal1dec);$("#yeast_cells").jqxTooltip({content:"Het aantal beschikbare gistcellen zonder eventuele starter."});$("#yeast_cells").jqxNumberInput(Show1dec);$("#need_cells").jqxTooltip({content:"Het aantal nodige cellen is afhankelijk van het biertype."});$("#need_cells").jqxNumberInput(Show1dec);$("#plato_cells").jqxTooltip({content:"De berekende hoeveelheid gistcellen in miljard per ml per graad Plato. Dit is de zogenaamde pitchrate."});$("#plato_cells").jqxNumberInput(Show2dec);$("#popupYeast").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#YeastReady"),modalOpacity:0.4});$("#YeastReady").jqxButton({template:"success",width:"90px",theme:theme});$("#YeastReady").click(function(){var a3,i=$("#yeastGrid").jqxGrid("getrowid",aE);console.log("YeastReady row:"+aE+" ID:"+i);a3={y_name:f.y_name,y_laboratory:f.y_laboratory,y_product_id:f.y_product_id,y_amount:f.y_amount,y_cost:f.y_cost,y_type:f.y_type,y_form:f.y_form,y_flocculation:f.y_flocculation,y_min_temperature:f.y_min_temperature,y_max_temperature:f.y_max_temperature,y_attenuation:f.y_attenuation,y_use:f.y_use,y_cells:f.y_cells,y_tolerance:f.y_tolerance,y_inventory:f.y_inventory,y_avail:f.y_avail};$("#yeastGrid").jqxGrid("updaterow",i,a3);U();Y()});$("#wy_name").jqxInput({theme:theme,width:320,height:23});$("#wy_laboratory").jqxInput({theme:theme,width:320,height:23});$("#wy_product_id").jqxInput({theme:theme,width:320,height:23});$("#wy_instock").jqxCheckBox({theme:theme,height:23});$("#wy_instock").on("change",function(i){yeastinstock=i.args.checked;yeastlist.dataBind()});$("#wy_select").jqxDropDownList({placeHolder:"Kies gist:",theme:theme,source:yeastlist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(a3,i,a5){var a4=yeastlist.records[a3];return a4.laboratory+" "+a4.product_id+" "+a4.name}});$("#wy_select").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=yeastlist.records[i];$("#wy_name").val(a3.name);$("#wy_laboratory").val(a3.laboratory);$("#wy_product_id").val(a3.product_id);f.y_name=a3.name;f.y_cost=a3.cost;f.y_type=a3.type;f.y_form=a3.form;f.y_laboratory=a3.laboratory;f.y_product_id=a3.product_id;f.y_min_temperature=a3.min_temperature;f.y_max_temperature=a3.max_temperature;f.y_flocculation=a3.flocculation;f.y_attenuation=a3.attenuation;f.y_cells=a3.cells;f.y_inventory=a3.inventory;if(f.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):")}else{if(f.y_form==1||f.y_form==6){$("#wy_pmpt_amount").html("Gewicht gram:")}else{$("#wy_pmpt_amount").html("Volume ml:")}}U();Y()}});$("#wy_amount").jqxNumberInput(Spin1dec);$("#wy_amount").on("change",function(a3){var i=parseFloat(a3.args.value);if(f.y_form!=0){i=parseFloat(a3.args.value)/1000}f.y_amount=i;U();Y()});$("#wy_use").jqxDropDownList({theme:theme,source:YeastUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wy_use").on("select",function(a3){if(a3.args){var i=a3.args.index;f.y_use=i;U();Y()}});for(ae=1;ae<5;ae++){$("#prop"+ae+"_type").jqxDropDownList({theme:theme,source:StarterTypeAdapter,valueMember:"id",displayMember:"nl",width:120,height:23,autoDropDownHeight:true});$("#prop"+ae+"_type").hide();$("#prop"+ae+"_volume").jqxTooltip({content:"Het volume van deze starter stap."});$("#prop"+ae+"_volume").jqxNumberInput(Spin3dec);$("#prop"+ae+"_volume").hide();$("#prop"+ae+"_irate").jqxTooltip({content:"Voor de beste gistgroei, houd de injectie factor tussen de 25 en 100 miljoen cellen per ml."});$("#prop"+ae+"_irate").jqxNumberInput(Show1dec);$("#prop"+ae+"_irate").hide();$("#prop"+ae+"_ncells").jqxTooltip({content:"Het aantal miljard nieuwe gistcellen in deze stap."});$("#prop"+ae+"_ncells").jqxNumberInput(Show1dec);$("#prop"+ae+"_ncells").hide();$("#prop"+ae+"_tcells").jqxTooltip({content:"Het totaal aantal miljard gistcellen na deze stap."});$("#prop"+ae+"_tcells").jqxNumberInput(Show1dec);$("#prop"+ae+"_tcells").hide();$("#prop"+ae+"_growf").jqxTooltip({content:"De groeifactor, minstens 1. Ongeroerde starters komen meestal niet boven de 3."});$("#prop"+ae+"_growf").jqxNumberInput(Show2dec);$("#prop"+ae+"_growf").hide()}$("#starter_enable").jqxCheckBox({theme:theme,height:23});$("#starter_type").jqxDropDownList({theme:theme,source:StarterTypeAdapter,valueMember:"id",displayMember:"nl",width:120,height:23,autoDropDownHeight:true});$("#starter_sg").jqxTooltip({content:"Het ideale starter SG moet tussen de 1.030 en 1.040 zijn. Optimaal is 1.037."});$("#starter_sg").jqxNumberInput(SGopts);$("#starter_viability").jqxTooltip({content:"De gist conditie te berekenen vanaf de productie datum. Vloeibare gist verlist iedere maand ongeveer 20% active cellen."});$("#starter_viability").jqxNumberInput(Perc0);$("#starter_try").jqxButton({template:"primary",width:"100px",height:23,theme:theme});$("#mash_name").jqxTooltip({content:"De omschrijving van dit maisch profiel."});$("#mash_name").jqxInput({theme:theme,width:320,height:23});$("#mash_select").jqxDropDownList({placeHolder:"Kies schema:",theme:theme,source:mashlist,displayMember:"name",width:250,height:23,dropDownWidth:500,dropDownHeight:500,dropDownHorizontalAlignment:"right"});$("#mash_select").on("select",function(a7){if(a7.args){var a9,a6,a3,a8,a5,ba,a4=a7.args.index;a3=new Array();a8=$("#mashGrid").jqxGrid("getdisplayrows");for(a5=0;a5<a8.length;a5++){ba=a8[a5];a3.push(ba.uid)}$("#mashGrid").jqxGrid("deleterow",a3);a6=mashlist.records[a4];$("#mash_name").val(a6.name);for(a5=0;a5<a6.steps.length;a5++){a9=a6.steps[a5];ba={};ba.step_name=a9.step_name;ba.step_type=a9.step_type;if(C==0&&d.w1_amount>0){C=d.w1_amount}if(a5==0){ba.step_infuse_amount=C}else{ba.step_infuse_amount=0}if(ap>0){ba.step_thickness=parseFloat(C/ap)}else{ba.step_thickness=0}ba.step_temp=a9.step_temp;ba.end_temp=a9.end_temp;ba.step_time=a9.step_time;ba.ramp_time=a9.ramp_time;$("#mashGrid").jqxGrid("addrow",null,ba)}aO()}});$("#est_mashvol").jqxTooltip({content:"Het totale volume van het maishwater en de mout in de maish pan."});$("#est_mashvol").jqxNumberInput(Show1dec);$("#est_mashtime").jqxTooltip({content:"De totale tijdsduur van het maischen."});$("#est_mashtime").jqxInput({theme:theme,width:70,height:23});$("#popupMash").jqxWindow({width:800,height:350,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#MashReady"),modalOpacity:0.4});$("#MashReady").jqxButton({template:"success",width:"90px",theme:theme});$("#MashReady").click(function(){aO()});$("#wstep_name").jqxInput({theme:theme,width:320,height:23});$("#wstep_name").on("change",function(i){var a3=$("#mashGrid").jqxGrid("getrowdata",ak);a3.step_name=i.args.value});$("#wstep_type").jqxDropDownList({theme:theme,source:MashStepTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#wstep_type").on("select",function(a5){if(a5.args){var a8,a4,a6,a7,a3=a5.args.index;a8=$("#mashGrid").jqxGrid("getrowdata",ak);a8.step_type=a3;if(a3==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{a8.step_infuse_amount=0;$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}C=0;a6=$("#mashGrid").jqxGrid("getrows");for(a4=0;a4<a6.length;a4++){a7=a6[a4];if(a7.step_type==0){C+=parseFloat(a7.step_infuse_amount)}}}});$("#wstep_temp").jqxNumberInput(Spin1dec);$("#wstep_temp").on("change",function(i){var a3=$("#mashGrid").jqxGrid("getrowdata",ak);a3.step_temp=parseFloat(i.args.value)});$("#wend_temp").jqxNumberInput(Spin1dec);$("#wend_temp").on("change",function(i){var a3=$("#mashGrid").jqxGrid("getrowdata",ak);a3.end_temp=parseFloat(i.args.value)});$("#wstep_time").jqxNumberInput(PosInt);$("#wstep_time").on("change",function(i){var a3=$("#mashGrid").jqxGrid("getrowdata",ak);a3.step_time=parseFloat(i.args.value);aO()});$("#wramp_time").jqxNumberInput(PosInt);$("#wramp_time").on("change",function(i){var a3=$("#mashGrid").jqxGrid("getrowdata",ak);a3.ramp_time=parseFloat(i.args.value);aO()});$("#wstep_infuse_amount").jqxNumberInput(Spin1dec);$("#wstep_infuse_amount").on("change",function(a4){var a6,a3,a5,a7=$("#mashGrid").jqxGrid("getrowdata",ak);a7.step_infuse_amount=parseFloat(a4.args.value);C=0;a5=$("#mashGrid").jqxGrid("getrows");for(a3=0;a3<a5.length;a3++){a6=a5[a3];if(a6.step_type==0){C+=parseFloat(a6.step_infuse_amount)}}if(d.w2_amount==0){d.w1_amount=C;$("#w1_amount").val(C)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*C;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*C;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(C);U();Q();j();aO()});$("#tgt_bu").jqxNumberInput(Show2wat);$("#tgt_cl_so4").jqxNumberInput(Show1wat);$("#got_cl_so4").jqxNumberInput(Show1wat);$("#w1_name").jqxDropDownList({placeHolder:"Kies hoofd water:",theme:theme,source:waterlist,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:400});$("#w1_name").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=waterlist.records[i];d.w1_name=a3.name;$("#w1_calcium").val(a3.calcium);d.w1_calcium=a3.calcium;$("#w1_sulfate").val(a3.sulfate);d.w1_sulfate=a3.sulfate;$("#w1_chloride").val(a3.chloride);d.w1_chloride=a3.chloride;$("#w1_sodium").val(a3.sodium);d.w1_sodium=a3.sodium;$("#w1_magnesium").val(a3.magnesium);d.w1_magnesium=a3.magnesium;$("#w1_total_alkalinity").val(a3.total_alkalinity);d.w1_total_alkalinity=a3.total_alkalinity;$("#w1_ph").val(a3.ph);d.w1_ph=a3.ph;$("#w1_cost").val(a3.cost);d.w1_cost=a3.cost;Q()}});$("#w1_amount").jqxNumberInput(Show1wat);$("#w1_calcium").jqxNumberInput(Show1wat);$("#w1_magnesium").jqxNumberInput(Show1wat);$("#w1_sodium").jqxNumberInput(Show1wat);$("#w1_total_alkalinity").jqxNumberInput(Show1wat);$("#w1_chloride").jqxNumberInput(Show1wat);$("#w1_sulfate").jqxNumberInput(Show1wat);$("#w1_ph").jqxNumberInput(Show1wat);$("#w2_name").jqxDropDownList({placeHolder:"Kies meng water:",theme:theme,source:waterlist,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:400});$("#w2_name").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=waterlist.records[i];d.w2_name=a3.name;$("#w2_calcium").val(a3.calcium);d.w2_calcium=a3.calcium;$("#w2_sulfate").val(a3.sulfate);d.w2_sulfate=a3.sulfate;$("#w2_chloride").val(a3.chloride);d.w2_chloride=a3.chloride;$("#w2_sodium").val(a3.sodium);d.w2_sodium=a3.sodium;$("#w2_magnesium").val(a3.magnesium);d.w2_magnesium=a3.magnesium;$("#w2_total_alkalinity").val(a3.total_alkalinity);d.w2_total_alkalinity=a3.total_alkalinity;$("#w2_ph").val(a3.ph);d.w2_ph=a3.ph;$("#w2_cost").val(a3.cost);d.w2_cost=a3.cost;$("#w2_amount").jqxNumberInput({max:100000,readOnly:false});Q()}});$("#w2_amount").jqxTooltip({content:"De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk."});$("#w2_amount").jqxNumberInput({inputMode:"simple",spinMode:"simple",theme:theme,width:94,height:23,min:0,max:0,decimalDigits:1,spinButtons:true,spinButtonsStep:0.5,readOnly:true});$("#w2_calcium").jqxNumberInput(Show1wat);$("#w2_magnesium").jqxNumberInput(Show1wat);$("#w2_sodium").jqxNumberInput(Show1wat);$("#w2_total_alkalinity").jqxNumberInput(Show1wat);$("#w2_chloride").jqxNumberInput(Show1wat);$("#w2_sulfate").jqxNumberInput(Show1wat);$("#w2_ph").jqxNumberInput(Show1wat);$("#wg_amount").jqxNumberInput(Show1wat);$("#wg_calcium").jqxNumberInput(Show1wat);$("#wg_magnesium").jqxNumberInput(Show1wat);$("#wg_sodium").jqxNumberInput(Show1wat);$("#wg_total_alkalinity").jqxNumberInput(Show1wat);$("#wg_chloride").jqxNumberInput(Show1wat);$("#wg_sulfate").jqxNumberInput(Show1wat);$("#wg_ph").jqxNumberInput(Show1wat);$("#wb_calcium").jqxTooltip({content:"De ideale hoeveelheid Calcium is tussen 40 en 150."});$("#wb_calcium").jqxNumberInput(Show1wat);$("#wb_magnesium").jqxTooltip({content:"De ideale hoeveelheid Magnesium is lager dan 30."});$("#wb_magnesium").jqxNumberInput(Show1wat);$("#wb_sodium").jqxTooltip({content:"De ideale hoeveelheid Natrium is lager dan 150."});$("#wb_sodium").jqxNumberInput(Show1wat);$("#wb_total_alkalinity").jqxNumberInput(Show1wat);$("#wb_chloride").jqxTooltip({content:"De ideale hoeveelheid Chloride is tussen 50 en 100."});$("#wb_chloride").jqxNumberInput(Show1wat);$("#wb_sulfate").jqxTooltip({content:"De ideale hoeveelheid Sulfaat is tussen 50 en 350."});$("#wb_sulfate").jqxNumberInput(Show1wat);$("#wb_ph").jqxNumberInput(Show1wat);$("#pr_name").jqxDropDownList({placeHolder:"Kies doel profiel:",theme:theme,source:waterprofiles,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:300});$("#pr_name").on("select",function(a4){if(a4.args){var a3,i=a4.args.index;a3=waterprofiles.records[i];$("#pr_calcium").val(a3.calcium);$("#pr_sulfate").val(a3.sulfate);$("#pr_chloride").val(a3.chloride);$("#pr_sodium").val(a3.sodium);$("#pr_magnesium").val(a3.magnesium);$("#pr_total_alkalinity").val(a3.total_alkalinity)}});$("#pr_calcium").jqxNumberInput(Show1wat);$("#pr_magnesium").jqxNumberInput(Show1wat);$("#pr_sodium").jqxNumberInput(Show1wat);$("#pr_total_alkalinity").jqxNumberInput(Show1wat);$("#pr_chloride").jqxNumberInput(Show1wat);$("#pr_sulfate").jqxNumberInput(Show1wat);$("#wa_cacl2").jqxTooltip({content:"Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren."});$("#wa_cacl2").jqxNumberInput(Spin1dec);$("#wa_caso4").jqxTooltip({content:"Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren."});$("#wa_caso4").jqxNumberInput(Spin1dec);$("#wa_mgso4").jqxTooltip({content:"Epsom zout. Voor het maken van een ander waterprofiel. Voegt magnesium en sulfaat toe. Gebruik spaarzaam!"});$("#wa_mgso4").jqxNumberInput(Spin1dec);$("#wa_nacl").jqxTooltip({content:"Keukenzout. Voor het maken van een ander waterprofiel. Voegt natrium en chloride toe. Voor het accentueren van zoetheid. Bij hoge dosering wordt het bier ziltig."});$("#wa_nacl").jqxNumberInput(Spin1dec);$("#mash_ph").jqxTooltip({content:"Maisch pH tussen 5.2 en 5.6. Gebruik 5.2 voor lichte en 5.5 voor donkere bieren."});$("#mash_ph").jqxNumberInput(SpinpH);$("#calc_acid").jqxCheckBox({theme:theme,width:120,height:23});$("#wa_base_name").jqxDropDownList({theme:theme,source:BaseTypeAdapter,valueMember:"id",displayMember:"nl",width:170,height:23,autoDropDownHeight:true});$("#wa_base").jqxNumberInput(Spin2dec);$("#wa_base").jqxNumberInput({symbol:" gr",symbolPosition:"right"});$("#wa_acid_name").jqxDropDownList({theme:theme,source:AcidTypeAdapter,valueMember:"id",displayMember:"nl",width:170,height:23,autoDropDownHeight:true});$("#wa_acid").jqxNumberInput(Spin2dec);$("#wa_acid").jqxNumberInput({symbol:" ml",symbolPosition:"right"});$("#wa_acid_perc").jqxNumberInput(Perc0);$("#wa_acid_perc").jqxNumberInput({width:70,symbol:"%",symbolPosition:"right"});$("#sparge_temp").jqxNumberInput(Spin1dec);$("#sparge_volume").jqxNumberInput(Spin1dec);$("#sparge_ph").jqxNumberInput(SpinpH);$("#sparge_source").jqxDropDownList({theme:theme,source:SpargeSourceAdapter,valueMember:"id",displayMember:"nl",width:110,height:23,autoDropDownHeight:true});$("#sparge_acid_amount").jqxNumberInput(Spin2dec);$("#sparge_acid_amount").jqxNumberInput({spinButtons:false,readOnly:true,symbol:" ml",symbolPosition:"right"});$("#sparge_acid_type").jqxDropDownList({theme:theme,source:AcidTypeAdapter,valueMember:"id",displayMember:"nl",width:110,height:23,autoDropDownHeight:true});$("#sparge_acid_perc").jqxNumberInput(Perc0);$("#sparge_acid_perc").jqxNumberInput({symbol:"%",symbolPosition:"right"});$("#brew_date_start").jqxTooltip({content:"Brouw datum en tijd. Voor planning laat de tijd op 00:00:00 staan."});$("#brew_date_start").jqxDateTimeInput(DateTimeopts);$("#brew_date_start").on("close",function(i){aV()});$("#brew_date_end").jqxTooltip({content:"End datum en tijd van de brouw. Leeg laten als er nog niet gebrouwen is."});$("#brew_date_end").jqxDateTimeInput(DateTimeopts);$("#brew_date_end").on("close",function(i){aV()});$("#brew_mash_ph").jqxTooltip({content:"De gemeten pH tijdens het maischen eventueel na correctie."});$("#brew_mash_ph").jqxNumberInput(SpinpH);$("#est_mash_ph").jqxTooltip({content:"De gewenste pH tijdens het maischen."});$("#est_mash_ph").jqxNumberInput(Show1wat);$("#brew_preboil_ph").jqxTooltip({content:"De gemeten pH in de kookketel na het spoelen en voor de kook."});$("#brew_preboil_ph").jqxNumberInput(SpinpH);$("#brew_aboil_ph").jqxTooltip({content:"De gemeten pH na het koken."});$("#brew_aboil_ph").jqxNumberInput(SpinpH);$("#brew_mash_sg").jqxTooltip({content:"Het bereikte SG na het maischen."});$("#brew_mash_sg").jqxNumberInput(SGopts);$("#brew_mash_sg").on("valueChanged",function(){a0()});$("#est_mash_sg").jqxTooltip({content:"Het berekende verwachte SG na het maischen."});$("#est_mash_sg").jqxNumberInput(Show3wat);$("#brew_preboil_sg").jqxTooltip({content:"Het gemeten SG in de kookketel na het spoelen en voor het koken."});$("#brew_preboil_sg").jqxNumberInput(SGopts);$("#brew_preboil_sg").on("valueChanged",function(i){d.brew_preboil_sg=i.args.value;w()});$("#est_pre_sg").jqxTooltip({content:"Het berekende SG in de kookketel na het spoelen en voor het koken."});$("#est_pre_sg").jqxNumberInput(Show3wat);$("#brew_aboil_sg").jqxTooltip({content:"Het gemeten SG in de kookketel na het koken."});$("#brew_aboil_sg").jqxNumberInput(SGopts);$("#brew_aboil_sg").on("valueChanged",function(i){d.brew_aboil_sg=i.args.value;S();U();at()});$("#est_og3").jqxTooltip({content:"Het gewenste SG in de kookketel na het koken."});$("#est_og3").jqxNumberInput(Show3wat);$("#brew_mash_efficiency").jqxTooltip({content:"Het behaalde maisch rendement."});$("#brew_mash_efficiency").jqxNumberInput(Show1dec);$("#brew_preboil_volume").jqxTooltip({content:"Het gemeten volume van het wort voor het koken."});$("#brew_preboil_volume").jqxNumberInput(Spin1dec);$("#brew_preboil_volume").on("valueChanged",function(i){d.brew_preboil_volume=i.args.value;w()});$("#est_pre_vol").jqxTooltip({content:"Het berekende volume van het wort voor het koken."});$("#est_pre_vol").jqxNumberInput(Show1wat);$("#brew_aboil_volume").jqxTooltip({content:"Het gemeten volume van het wort na het koken."});$("#brew_aboil_volume").jqxNumberInput(Spin1dec);$("#brew_aboil_volume").on("valueChanged",function(i){d.brew_aboil_volume=i.args.value;S();U();at()});$("#est_a_vol").jqxTooltip({content:"Het gewenste volume na het koken."});$("#est_a_vol").jqxNumberInput(Show1wat);$("#brew_preboil_efficiency").jqxTooltip({content:"Het berekende rendement voor het koken."});$("#brew_preboil_efficiency").jqxNumberInput(Show1dec);$("#brew_aboil_efficiency").jqxTooltip({content:"Het bereikte rendement na het koken."});$("#brew_aboil_efficiency").jqxNumberInput(Show1dec);$("#brew_sparge_temperature").jqxTooltip({content:"De spoelwater temperatuur, in te stellen in de Water tab."});$("#brew_sparge_temperature").jqxNumberInput(Show1dec);$("#brew_sparge_volume").jqxTooltip({content:"Het spoelwater voorraad volume, in te stellen in de Water tab."});$("#brew_sparge_volume").jqxNumberInput(Show1dec);$("#brew_sparge_est").jqxNumberInput(Show1dec);$("#brew_whirlpool9").jqxNumberInput(PosInt);$("#brew_whirlpool9").jqxNumberInput({max:120});$("#brew_cooling_to").jqxNumberInput(Spin1dec);$("#brew_sparge_ph").jqxNumberInput(SpinpH);$("#brew_whirlpool7").jqxNumberInput(PosInt);$("#brew_whirlpool7").jqxNumberInput({max:120});$("#brew_cooling_method").jqxDropDownList({theme:theme,source:CoolingTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#brew_whirlpool6").jqxNumberInput(PosInt);$("#brew_whirlpool6").jqxNumberInput({max:120});$("#brew_cooling_time").jqxNumberInput(PosInt);$("#brew_cooling_time").jqxNumberInput({max:1440});$("#brew_whirlpool2").jqxNumberInput(PosInt);$("#brew_whirlpool2").jqxNumberInput({max:120});$("#brew_aeration_type").jqxDropDownList({theme:theme,source:AerationTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#brew_aeration_time").jqxNumberInput(PosInt);$("#brew_aeration_time").jqxNumberInput({max:1440});$("#brew_aeration_speed").jqxNumberInput(PosInt);$("#brew_aeration_speed").jqxNumberInput({max:1440});$("#brew_fermenter_volume").jqxNumberInput(Show1dec);$("#brew_fermenter_extrawater").jqxNumberInput(Spin1dec);$("#brew_fermenter_sg").jqxNumberInput(Show3dec);$("#brew_fermenter_tcloss").jqxNumberInput(Spin1dec);$("#brew_fermenter_ibu").jqxNumberInput(Show0dec);$("#brew_fermenter_color").jqxNumberInput(Show0dec);$("#BLog").jqxButton({template:"info",width:"150px",theme:theme});$("#BLog").click(function(){window.open("log_brew.php?code="+d.code+"&name="+d.name)});$("#brew_fermenter_sg2").jqxTooltip({content:"Het behaalde SG in het gistvat, overgenomen van de brouwdag."});$("#brew_fermenter_sg2").jqxNumberInput(Show3dec);$("#primary_start_temp").jqxTooltip({content:"De begintemperatuur van de hoofdvergisting."});$("#primary_start_temp").jqxNumberInput(YeastT);$("#primary_max_temp").jqxTooltip({content:"De hoogst bereikte piek temperatuur tijdens de hoofgvergisting."});$("#primary_max_temp").jqxNumberInput(YeastT);$("#primary_end_temp").jqxTooltip({content:"De eind temperatuur van de hoofdvergisting."});$("#primary_end_temp").jqxNumberInput(YeastT);$("#primary_end_sg").jqxTooltip({content:"Het gemeten SG aan het eind van de hoofdvergisting."});$("#primary_end_sg").jqxNumberInput(SGopts);$("#primary_end_brix").jqxTooltip({content:"Hulpfinctie: de afgelezen &deg;Brix RI waarde met een refractometer."});$("#primary_end_brix").jqxNumberInput(Spin1dec);$("#primary_svg").jqxTooltip({content:"De schijnbare vergisting graad behaald na de hoofdgisting."});$("#primary_svg").jqxNumberInput(Show1dec);$("#primary_end_date").jqxTooltip({content:"De eind datum van de hoofdvergisting en eventueel overhevelen."});$("#primary_end_date").jqxDateTimeInput(Dateopts);$("#primary_end_date").on("close",function(i){aV()});$("#secondary_temp").jqxNumberInput(YeastT);$("#secondary_end_sg").jqxTooltip({content:"Het gemeten SG aan het eind van de navergisting."});$("#secondary_end_sg").jqxNumberInput(SGopts);$("#secondary_end_brix").jqxTooltip({content:"Hulpfinctie: de afgelezen &deg;Brix RI waarde met een refractometer."});$("#secondary_end_brix").jqxNumberInput(Spin1dec);$("#secondary_svg").jqxTooltip({content:"De schijnbare vergisting graad behaald na de nagisting."});$("#secondary_svg").jqxNumberInput(Show1dec);$("#secondary_end_date").jqxTooltip({content:"De eind datum van de navergisting en het begin van het lageren."});$("#secondary_end_date").jqxDateTimeInput(Dateopts);$("#secondary_end_date").on("close",function(i){aV()});$("#tertiary_temp").jqxNumberInput(YeastT);$("#fg").jqxNumberInput(Spin3dec);$("#est_fg3").jqxTooltip({content:"Het verwachte eind SG. Dit wordt automatisch berekend."});$("#est_fg3").jqxNumberInput(Show3dec);$("#final_brix").jqxTooltip({content:"Hulpfinctie: de afgelezen &deg;Brix RI waarde met een refractometer."});$("#final_brix").jqxNumberInput(Spin1dec);$("#final_abv").jqxNumberInput(Show2dec);$("#final_svg").jqxNumberInput(Show1dec);$("#FLog").jqxButton({template:"info",width:"150px",theme:theme});$("#FLog").click(function(){window.open("log_fermentation.php?code="+d.code+"&name="+d.name)});$("#package_date").jqxTooltip({content:"De verpakkings datum van dit bier."});$("#package_date").jqxDateTimeInput(Dateopts);$("#package_date").on("close",function(i){aV()});$("#package_volume").jqxTooltip({content:"Het beschikbare volume om te bottelen of op fust te zetten."});$("#package_volume").jqxNumberInput(Spin1dec);$("#package_infuse_amount").jqxTooltip({content:"De hoeveelheid water of drank extra toe te voegen."});$("#package_infuse_amount").jqxNumberInput(Spin3dec);$("#package_infuse_abv").jqxTooltip({content:"De hoeveelheid alcohol in de drank, of 0.0 als het water is."});$("#package_infuse_abv").jqxNumberInput(Spin1dec);$("#package_infuse_notes").jqxTooltip({content:"Omschrijving van de extra toevoeging."});$("#package_infuse_notes").jqxInput({theme:theme,width:640,height:23});$("#package_abv").jqxTooltip({content:"De uiteindelijke hoeveelheid alcohol volume %."});$("#package_abv").jqxNumberInput(Show2dec);$("#package_ph").jqxTooltip({content:"De gemeten pH vlak voor het verpakken."});$("#package_ph").jqxNumberInput(SpinpH);$("#st_carb_min2").jqxTooltip({content:"Het minimum aanbevolen koolzuur volume voor deze bierstijl."});$("#st_carb_min2").jqxNumberInput(Smal1dec);$("#st_carb_max2").jqxTooltip({content:"Het maximum aamnevolen koolzuur volume voor deze bierstijl."});$("#st_carb_max2").jqxNumberInput(Smal1dec);$("#bottle_amount").jqxTooltip({content:"De totale hoeveelheid te bottelen bier."});$("#bottle_amount").jqxNumberInput(Spin1dec);$("#keg_amount").jqxTooltip({content:"De totale hoeveelheid op fust te zetten bier."});$("#keg_amount").jqxNumberInput(Spin1dec);$("#bottle_carbonation").jqxTooltip({content:"Het gewenste CO2 volume in de flessen."});$("#bottle_carbonation").jqxNumberInput(Spin2dec);$("#bottle_carbonation").jqxNumberInput({max:5});$("#keg_carbonation").jqxTooltip({content:"Het gewenste CO2 volume door de suiker in de fusten."});$("#keg_carbonation").jqxNumberInput(Spin2dec);$("#keg_carbonation").jqxNumberInput({max:5});$("#bottle_priming_sugar").jqxDropDownList({placeHolder:"Kies suiker:",theme:theme,source:fermentablesugars,displayMember:"name",width:200,height:23,dropDownWidth:300,dropDownHeight:400});$("#bottle_priming_sugar").on("select",function(a7){if(a7.args){var a9,a3,a6=-1,a5,a8,a4,ba={};a3=a7.args.index;a5=fermentablesugars.records[a3];a8=$("#fermentableGrid").jqxGrid("getrows");for(a4=0;a4<a8.length;a4++){if(a8[a4].f_added==4){a6=a4}}ba.f_name=a5.name;ba.f_origin=a5.origin;ba.f_supplier=a5.supplier;ba.f_amount=parseFloat($("#bottle_priming_total").jqxNumberInput("decimal"))/1000;ba.f_cost=a5.cost;ba.f_type=a5.type;ba.f_yield=a5.yield;ba.f_color=a5.color;ba.f_coarse_fine_diff=a5.coarse_fine_diff;ba.f_moisture=a5.moisture;ba.f_diastatic_power=a5.diastatic_power;ba.f_protein=a5.protein;ba.f_max_in_batch=a5.max_in_batch;ba.f_graintype=a5.graintype;ba.f_added=4;ba.f_dissolved_protein=a5.dissolved_protein;ba.f_recommend_mash=a5.recommend_mash;ba.f_add_after_boil=1;ba.f_adjust_to_total_100=0;ba.f_percentage=0;ba.f_di_ph=a5.di_ph;ba.f_acid_to_ph_57=a5.acid_to_ph_57;ba.f_inventory=a5.inventory;if(a6>=0){a9=$("#fermentableGrid").jqxGrid("getrowid",a6);$("#fermentableGrid").jqxGrid("updaterow",a9,ba)}else{$("#fermentableGrid").jqxGrid("addrow",null,ba)}aS()}});$("#keg_priming_sugar").jqxDropDownList({placeHolder:"Kies suiker:",theme:theme,source:fermentablesugars,displayMember:"name",width:200,height:23,dropDownWidth:300,dropDownHeight:400});$("#keg_priming_sugar").on("select",function(a7){if(a7.args){var a9,a3,a6=-1,a5,a8,a4,ba={};a3=a7.args.index;a5=fermentablesugars.records[a3];a8=$("#fermentableGrid").jqxGrid("getrows");for(a4=0;a4<a8.length;a4++){if(a8[a4].f_added==5){a6=a4}}ba.f_name=a5.name;ba.f_origin=a5.origin;ba.f_supplier=a5.supplier;ba.f_amount=parseFloat($("#keg_priming_total").jqxNumberInput("decimal"))/1000;ba.f_cost=a5.cost;ba.f_type=a5.type;ba.f_yield=a5.yield;ba.f_color=a5.color;ba.f_coarse_fine_diff=a5.coarse_fine_diff;ba.f_moisture=a5.moisture;ba.f_diastatic_power=a5.diastatic_power;ba.f_protein=a5.protein;ba.f_max_in_batch=a5.max_in_batch;ba.f_graintype=a5.graintype;ba.f_added=5;ba.f_dissolved_protein=a5.dissolved_protein;ba.f_recommend_mash=a5.recommend_mash;ba.f_add_after_boil=1;ba.f_adjust_to_total_100=0;ba.f_percentage=0;ba.f_di_ph=a5.di_ph;ba.f_acid_to_ph_57=a5.acid_to_ph_57;ba.f_inventory=a5.inventory;if(a6>=0){a9=$("#fermentableGrid").jqxGrid("getrowid",a6);$("#fermentableGrid").jqxGrid("updaterow",a9,ba)}else{$("#fermentableGrid").jqxGrid("addrow",null,ba)}aS()}});$("#bottle_priming_amount").jqxNumberInput(Show1dec);$("#bottle_priming_water").jqxTooltip({content:"De hoeveelheid water om de suiker op te lossen."});$("#bottle_priming_water").jqxNumberInput(Spin3dec);$("#keg_priming_amount").jqxNumberInput(Show1dec);$("#keg_priming_water").jqxTooltip({content:"De hoeveelheid water om de suiker op te lossen."});$("#keg_priming_water").jqxNumberInput(Spin3dec);$("#bottle_priming_total").jqxNumberInput(Show1dec);$("#bottle_pressure").jqxTooltip({content:"De maximaal te verwachten druk tijdens het hergisten."});$("#bottle_pressure").jqxNumberInput(Show1dec);$("#keg_priming_total").jqxNumberInput(Show1dec);$("#keg_forced_carb").jqxCheckBox({theme:theme,width:120,height:23});$("#keg_pressure").jqxNumberInput(Show1dec);$("#bottle_abv").jqxNumberInput(Show2dec);$("#keg_abv").jqxNumberInput(Show2dec);$("#bottle_carbonation_temp").jqxNumberInput(YeastT);$("#keg_carbonation_temp").jqxNumberInput(YeastT);$("#taste_date").jqxTooltip({content:"De proef datum van dit bier."});$("#taste_date").jqxDateTimeInput(Dateopts);$("#taste_date").on("close",function(i){aV()});$("#taste_rate").jqxTooltip({content:"Het cijfer voor dit bier van 1 tot 10."});$("#taste_rate").jqxNumberInput(Spin1dec);$("#taste_rate").jqxNumberInput({max:10});$("#taste_color").jqxTooltip({content:"De kleur van het bier."});$("#taste_color").jqxInput({theme:theme,width:320,height:23});$("#taste_transparency").jqxTooltip({content:"De helderheid van het bier."});$("#taste_transparency").jqxInput({theme:theme,width:320,height:23});$("#taste_head").jqxTooltip({content:"Het schuim op het bier."});$("#taste_head").jqxInput({theme:theme,width:320,height:23});$("#taste_aroma").jqxTooltip({content:"Het aroma van het bier."});$("#taste_aroma").jqxInput({theme:theme,width:960,height:23});$("#taste_taste").jqxTooltip({content:"De smaak van het bier."});$("#taste_taste").jqxInput({theme:theme,width:960,height:23});$("#taste_aftertaste").jqxTooltip({content:"De nasmaak van het bier."});$("#taste_aftertaste").jqxInput({theme:theme,width:960,height:23});$("#taste_mouthfeel").jqxTooltip({content:"Het mondgevoelvan het bier."});$("#taste_mouthfeel").jqxInput({theme:theme,width:960,height:23});$("#taste_notes").jqxTooltip({content:"Het oordeel en opmerkingen over dit bier."});$("#taste_notes").jqxInput({theme:theme,width:960,height:100});$("#jqxTabs").jqxTabs({theme:theme,width:1280,height:660,autoHeight:false,position:"top"});$("#Export").jqxButton({template:"info",width:"80px",theme:theme});$("#Export").bind("click",function(){s(0)});$("#Delete").jqxButton({template:"danger",width:"80px",theme:theme});$("#Delete").bind("click",function(){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var i="delete=true&"+$.param({uuid:d.uuid});$.ajax({dataType:"json",url:E,cache:false,data:i,type:"POST",success:function(a4,a3,a5){window.location.href=my_return},error:function(a3,a5,a4){}})})});$("#Cancel").jqxButton({template:"primary",width:"80px",theme:theme});$("#Cancel").bind("click",function(){window.location.href=my_return});$("#Save").jqxButton({template:"success",width:"80px",theme:theme});$("#Save").bind("click",function(){s(1)});createDelElements()});
\ No newline at end of file
--- a/www/js/prod_export-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a=0;$("#name").html(my_name);$("#code").html(my_code);$("#jqxRadioButton1").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton2").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton3").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton4").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton5").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton6").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton7").jqxRadioButton({theme:theme,width:250,height:23});if((my_split!=0)||(my_stage>=6)){$("#jqxRadioButton3").jqxRadioButton({disabled:true});document.getElementById("pmpt3").style.color="red"}$("#jqxRadioButton1").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=1});$("#jqxRadioButton2").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=2});$("#jqxRadioButton3").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=3});$("#jqxRadioButton4").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=4});$("#jqxRadioButton5").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=5});$("#jqxRadioButton6").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=6});$("#jqxRadioButton7").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=7});$("#Start").jqxButton({template:"success",width:"100px",theme:theme,disabled:true});$("#Start").click(function(){if(a==1){window.open("prod_beerxml.php?record="+my_record)}else{if(a==2){window.open("prod_duplicate.php?record="+my_record)}else{if(a==3){window.location.href="prod_divide.php?record="+my_record+"&return="+my_return}else{if(a==4){window.open("prod_torecipe.php?record="+my_record)}else{if(a==5){window.open("prod_print.php?record="+my_record)}else{if(a==6){window.open("prod_checklist.php?record="+my_record)}else{if(a==7){window.open("prod_forum.php?record="+my_record)}}}}}}}if(a!=3){window.location.href="prod_edit.php?record="+my_record+"&return="+my_return}})});
\ No newline at end of file
--- a/www/js/prod_impbrew-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#jqxFileUpload").jqxFileUpload({width:300,browseTemplate:"success",cancelTemplate:"inverse",uploadTemplate:"primary",theme:theme,multipleFilesUpload:false,accept:"application/json",uploadUrl:"upl_brew.php",fileInputName:"fileToUpload"});$("#eventsPanel").jqxPanel({width:800,height:200,theme:theme});$("#jqxFileUpload").on("select",function(c){var d,a,b=c.args;d=b.file;a=b.size;$("#eventsPanel").jqxPanel("clearcontent");$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> "+d+"  size: "+a+"<br />")});$("#jqxFileUpload").on("uploadEnd",function(c){var d,a,b=c.args;d=b.file;a=b.response;$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> ontvangen "+d+"<br />"+a+"<br />")})});
\ No newline at end of file
--- a/www/js/prod_inprod-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"code",type:"string"},{name:"birth",type:"string"},{name:"stage",type:"int"},{name:"brew_date",type:"string"},{name:"package_date",type:"string"},],id:"record",url:"includes/db_product.php?select=inprod"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c,d;c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");d=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:90,height:20});d.click(function(f){window.location.href="prod_new.php?return=prod_inprod.php"})},columns:[{text:"Datum",datafield:"birth",width:120},{text:"Code",datafield:"code",width:120},{text:"Naam",datafield:"name"},{text:"Fase",datafield:"stage",width:200,cellsrenderer:function(k,f,m,o,g,q){var c,l,p,n,h,j,i,e;c=StageData[m].nl;if(m==2){c=StageData[m].nl+" op "+q.brew_date}if(m==7||m==8){l=new Date();n=q.package_date;n=n.split("-");p=new Date(l.getFullYear(),l.getMonth(),l.getDate());n=new Date(n[0],n[1]-1,n[2]);h=parseInt(p.getTime()/1000);j=parseInt(n.getTime()/1000);i=h-j;e=Math.round(i/60/60/24);if(e>=14){c=StageData[m].nl+" dag "+(e-14)+" van 28"}else{c=StageData[m].nl+" dag "+e+" van 14"}}return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+c+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(d){var c=b.records[d];window.location.href="prod_edit.php?record="+c.record+"&select=inprod&return=prod_inprod.php"}}],})});
\ No newline at end of file
--- a/www/js/prod_new-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#name").jqxTooltip({content:"De naam voor dit brouw project."});$("#name").jqxInput({theme:theme,width:640,height:23});$("#code").jqxTooltip({content:"Het unieke code nummer van dit brouw project."});$("#code").jqxInput({theme:theme,width:100,height:23});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit project."});$("#notes").jqxInput({theme:theme,width:960,height:200});$("#type").jqxDropDownList({theme:theme,source:RecipeTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#type").jqxDropDownList("selectItem",2);$("#type").on("select",function(e){if(e.args){a=e.args.index}});$("#st_name").jqxTooltip({content:"De bierstijl naam voor dit recept."});$("#st_name").jqxInput({theme:theme,width:250,height:23});$("#st_category").jqxTooltip({content:"De Amerikaanse bierstijl categorie."});$("#st_category").jqxInput({theme:theme,width:250,height:23});$("#st_category_number").jqxTooltip({content:"De Amerikaanse bierstijl categorie sub nummer."});$("#st_category_number").jqxInput({theme:theme,width:70,height:23});$("#st_letter").jqxTooltip({content:"De bierstijl letter voor dit recept."});$("#st_letter").jqxInput({theme:theme,width:250,height:23});$("#st_guide").jqxTooltip({content:"De bierstijl gids voor dit recept."});$("#st_guide").jqxInput({theme:theme,width:250,height:23});$("#st_notes").jqxInput({theme:theme,width:800,height:100});$("#st_type").jqxTooltip({content:"Het bierstijl type."});$("#st_type").jqxInput({theme:theme,width:250,height:23});$("#st_og_min").jqxTooltip({content:"Het minimum begin SG voor deze bierstijl."});$("#st_og_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:3,readOnly:true});$("#st_og_max").jqxTooltip({content:"Het maximum begin SG voor deze bierstijl."});$("#st_og_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:3,readOnly:true});$("#st_fg_min").jqxTooltip({content:"Het minimum eind SG voor deze bierstijl."});$("#st_fg_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:3,readOnly:true});$("#st_fg_max").jqxTooltip({content:"Het maximum eind SG voor deze bierstijl."});$("#st_fg_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:3,readOnly:true});$("#st_ibu_min").jqxTooltip({content:"De minimum bitterheid voor deze bierstijl."});$("#st_ibu_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:0,readOnly:true});$("#st_ibu_max").jqxTooltip({content:"De maximum bitterheid voor deze bierstijl."});$("#st_ibu_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:0,readOnly:true});$("#st_color_min").jqxTooltip({content:"De minimum kleur voor deze bierstijl."});$("#st_color_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:0,readOnly:true});$("#st_color_max").jqxTooltip({content:"De maximum kleur voor deze bierstijl."});$("#st_color_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:0,readOnly:true});$("#st_carb_min").jqxTooltip({content:"Het minimum koolzuur volume voor deze bierstijl."});$("#st_carb_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:1,readOnly:true});$("#st_carb_max").jqxTooltip({content:"Het maximum koolzuur volume voor deze bierstijl."});$("#st_carb_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:1,readOnly:true});$("#st_abv_min").jqxTooltip({content:"Het minimum alcohol volume % voor deze bierstijl."});$("#st_abv_min").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:1,readOnly:true});$("#st_abv_max").jqxTooltip({content:"Het maximum alcohol volume % voor deze bierstijl."});$("#st_abv_max").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:1,readOnly:true});$("#st_profile").jqxInput({theme:theme,width:800,height:48});$("#st_ingredients").jqxInput({theme:theme,width:800,height:23});$("#st_examples").jqxInput({theme:theme,width:800,height:48});$("#styleSelect").jqxDropDownList({placeHolder:"Kies bierstijl:",theme:theme,source:styleslist,displayMember:"name",width:250,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(f,e,h){var g=styleslist.records[f];return g.style_guide+" "+g.style_letter+" "+g.name}});$("#styleSelect").on("select",function(g){if(g.args){var e=g.args.index,f=styleslist.records[e];$("#st_name").val(f.name);$("#st_category").val(f.category);$("#st_category_number").val(f.category_number);$("#st_letter").val(f.style_letter);$("#st_guide").val(f.style_guide);b=f.type;$("#st_type").val(StyleTypeData[f.type].nl);$("#st_og_min").val(f.og_min);$("#st_og_max").val(f.og_max);$("#st_fg_min").val(f.fg_min);$("#st_fg_max").val(f.fg_max);$("#st_ibu_min").val(f.ibu_min);$("#st_ibu_max").val(f.ibu_max);$("#st_color_min").val(f.color_min);$("#st_color_max").val(f.color_max);$("#st_carb_min").val(f.carb_min);$("#st_carb_max").val(f.carb_max);$("#st_abv_min").val(f.abv_min);$("#st_abv_max").val(f.abv_max);$("#st_notes").val(f.notes);$("#st_profile").val(f.profile);$("#st_ingredients").val(f.ingredients);$("#st_examples").val(f.examples)}});$("#eq_name").jqxTooltip({content:"De naam van deze brouw apparatuur."});$("#eq_name").jqxInput({theme:theme,width:250,height:23});$("#eq_calc_boil_volume").jqxCheckBox({theme:theme,width:120,height:23,disabled:true});$("#eq_boil_size").jqxTooltip({content:"Normaal kook volume in liters"});$("#eq_boil_size").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_batch_size").jqxTooltip({content:"Berekende batch grootte in liters aan het eind van de kook."});$("#eq_batch_size").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_tun_volume").jqxTooltip({content:"Maisch ketel volume."});$("#eq_tun_volume").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_tun_weight").jqxTooltip({content:"Maisch ketel gewicht."});$("#eq_tun_weight").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_tun_height").jqxTooltip({content:"Maisch ketel hoogte."});$("#eq_tun_height").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_tun_material").jqxTooltip({content:"Maisch ketel materiaal."});$("#eq_tun_material").jqxInput({theme:theme,width:180,height:23});$("#eq_tun_specific_heat").jqxTooltip({content:"Maisch ketel warmte geleiding."});$("#eq_tun_specific_heat").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:3});$("#eq_top_up_water").jqxTooltip({content:"Extra water in het gistvat."});$("#eq_top_up_water").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_trub_chiller_loss").jqxTooltip({content:"Standaard verlies bij het overbrengen naar het gistvat."});$("#eq_trub_chiller_loss").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_evap_rate").jqxTooltip({content:"Verdamping in liters per uur."});$("#eq_evap_rate").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:2,});$("#eq_boil_time").jqxTooltip({content:"Normale kooktijd in minuten."});$("#eq_boil_time").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:0});$("#eq_top_up_kettle").jqxTooltip({content:"Extra water toevoegen tijdens de kook."});$("#eq_top_up_kettle").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_hop_utilization").jqxTooltip({content:"100% voor kleine installaties, hoger voor grote brouwerijen."});$("#eq_hop_utilization").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:0});$("#eq_notes").jqxTooltip({content:"Opmerkingen over deze apparatuur."});$("#eq_notes").jqxInput({theme:theme,width:960,height:100});$("#eq_lauter_volume").jqxTooltip({content:"Filterkuip volume."});$("#eq_lauter_volume").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_lauter_height").jqxTooltip({content:"Filterkuip hoogte."});$("#eq_lauter_height").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_lauter_deadspace").jqxTooltip({content:"Filterkuip verlies in liters."});$("#eq_lauter_deadspace").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_kettle_volume").jqxTooltip({content:"Kook ketel volume in liters."});$("#eq_kettle_volume").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_kettle_height").jqxTooltip({content:"Kook ketel hoogte in cm."});$("#eq_kettle_height").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_mash_volume").jqxTooltip({content:"Maisch water voor de eerste stap."});$("#eq_mash_volume").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_mash_max").jqxTooltip({content:"De maximale moutstort in Kg."});$("#eq_mash_max").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#eq_efficiency").jqxTooltip({content:"Gemiddeld brouwzaal rendement."});$("#eq_efficiency").jqxNumberInput({inputMode:"simple",readOnly:true,theme:theme,width:90,height:23,decimalDigits:1});$("#equipmentSelect").jqxDropDownList({placeHolder:"Kies apparatuur:",theme:theme,source:equipmentlist,displayMember:"name",width:250,height:27,dropDownWidth:300,renderer:function(f,e,h){var g=equipmentlist.records[f];return g.batch_size+" liter "+g.name}});$("#equipmentSelect").on("select",function(g){if(g.args){var e=g.args.index,f=equipmentlist.records[e];$("#eq_name").val(f.name);$("#eq_boil_size").val(f.boil_size);$("#eq_batch_size").val(f.batch_size);$("#eq_tun_volume").val(f.tun_volume);$("#eq_tun_weight").val(f.tun_weight);$("#eq_tun_specific_heat").val(f.tun_specific_heat);c=f.tun_material;$("#eq_tun_material").val(MaterialData[f.tun_material].nl);$("#eq_tun_height").val(f.tun_height);$("#eq_top_up_water").val(f.top_up_water);$("#eq_trub_chiller_loss").val(f.trub_chiller_loss);$("#eq_evap_rate").val(f.evap_rate);$("#eq_boil_time").val(f.boil_time);$("#eq_calc_boil_volume").val(f.calc_boil_volume);$("#eq_top_up_kettle").val(f.top_up_kettle);$("#eq_hop_utilization").val(f.hop_utilization);$("#eq_notes").val(f.notes);$("#eq_lauter_volume").val(f.lauter_volume);$("#eq_lauter_height").val(f.lauter_height);$("#eq_lauter_deadspace").val(f.lauter_deadspace);$("#eq_kettle_volume").val(f.kettle_volume);$("#eq_kettle_height").val(f.kettle_height);$("#eq_mash_volume").val(f.mash_volume);$("#eq_mash_max").val(f.mash_max);$("#eq_efficiency").val(f.efficiency)}});var a=2,b=0,c=0,d=(function(){var e=function(){$("#name").on("change",function(f){d.validate(true)});$("#code").on("change",function(f){d.validate(true)});$("#type").on("change",function(f){d.validate(true)});$("#styleSelect").on("change",function(f){d.validate(true)});$("#equipmentSelect").on("change",function(f){d.validate(true)});$("#nextButtonCompleted").click(function(){var j=new Date(),g=j.getMonth()+1,f=j.getFullYear()+"-",i,h;if(g<10){f=f+"0"}f=f+g+"-";if(j.getDate()<10){f=f+"0"}f=f+j.getDate();i={record:-1,name:$("#name").val(),code:$("#code").val(),birth:f,stage:0,notes:$("#notes").val(),log_brew:0,log_fermentation:0,inventory_reduced:0,locked:0,eq_name:$("#eq_name").val(),eq_boil_size:parseFloat($("#eq_boil_size").jqxNumberInput("decimal")),eq_batch_size:parseFloat($("#eq_batch_size").jqxNumberInput("decimal")),eq_tun_volume:parseFloat($("#eq_tun_volume").jqxNumberInput("decimal")),eq_tun_weight:parseFloat($("#eq_tun_weight").jqxNumberInput("decimal")),eq_tun_specific_heat:parseFloat($("#eq_tun_specific_heat").jqxNumberInput("decimal")),eq_tun_material:c,eq_tun_height:parseFloat($("#eq_tun_height").jqxNumberInput("decimal"))/100,eq_top_up_water:parseFloat($("#eq_top_up_water").jqxNumberInput("decimal")),eq_trub_chiller_loss:parseFloat($("#eq_trub_chiller_loss").jqxNumberInput("decimal")),eq_evap_rate:parseFloat($("#eq_evap_rate").jqxNumberInput("decimal")),eq_boil_time:parseFloat($("#eq_boil_time").jqxNumberInput("decimal")),eq_calc_boil_volume:$("#eq_calc_boil_volume").val(),eq_top_up_kettle:parseFloat($("#eq_top_up_kettle").jqxNumberInput("decimal")),eq_hop_utilization:parseFloat($("#eq_hop_utilization").jqxNumberInput("decimal")),eq_notes:$("#eq_notes").val(),eq_lauter_volume:parseFloat($("#eq_lauter_volume").jqxNumberInput("decimal")),eq_lauter_height:parseFloat($("#eq_lauter_height").jqxNumberInput("decimal"))/100,eq_lauter_deadspace:parseFloat($("#eq_lauter_deadspace").jqxNumberInput("decimal")),eq_kettle_volume:parseFloat($("#eq_kettle_volume").jqxNumberInput("decimal")),eq_kettle_height:parseFloat($("#eq_kettle_height").jqxNumberInput("decimal"))/100,eq_mash_volume:parseFloat($("#eq_mash_volume").jqxNumberInput("decimal")),eq_mash_max:parseFloat($("#eq_mash_max").jqxNumberInput("decimal")),eq_efficiency:parseFloat($("#eq_efficiency").jqxNumberInput("decimal")),brew_date_start:"",brew_mash_ph:0,brew_mash_sg:1,brew_mash_efficiency:0,brew_sparge_ph:0,brew_sparge_temperature:85,brew_sparge_est:0,brew_preboil_volume:0,brew_preboil_sg:0,brew_preboil_ph:0,brew_preboil_efficiency:0,brew_aboil_volume:0,brew_aboil_sg:0,brew_aboil_ph:0,brew_aboil_efficiency:0,brew_cooling_method:0,brew_cooling_time:0,brew_cooling_to:20,brew_whirlpool9:0,brew_whirlpool7:0,brew_whirlpool6:0,brew_whirlpool2:0,brew_fermenter_volume:parseFloat($("#eq_batch_size").jqxNumberInput("decimal"))-parseFloat($("#eq_trub_chiller_loss").jqxNumberInput("decimal"))+parseFloat($("#eq_top_up_water").jqxNumberInput("decimal")),brew_fermenter_extrawater:parseFloat($("#eq_top_up_water").jqxNumberInput("decimal")),brew_fermenter_tcloss:parseFloat($("#eq_trub_chiller_loss").jqxNumberInput("decimal")),brew_aeration_time:0,brew_aeration_speed:0,brew_aeration_type:0,brew_fermenter_sg:0,brew_fermenter_ibu:0,brew_fermenter_color:0,brew_date_end:"",og:0,fg:0,primary_start_temp:0,primary_max_temp:0,primary_end_temp:0,primary_end_sg:0,primary_end_date:"",secondary_temp:0,secondary_end_date:"",tertiary_temp:0,package_date:"",package_volume:0,package_infuse_amount:0,package_infuse_abv:0,package_infuse_notes:"",package_abv:0,package_ph:0,bottle_amount:0,bottle_carbonation:0,bottle_priming_water:0,bottle_priming_amount:0,bottle_carbonation_temp:23,keg_amount:0,keg_carbonation:0,keg_priming_water:0,keg_priming_amount:0,keg_carbonation_temp:23,keg_forced_carb:1,keg_pressure:0,taste_notes:"",taste_rate:0,taste_date:"",taste_color:"",taste_transparency:"",taste_head:"",taste_aroma:"",taste_taste:"",taste_mouthfeel:"",taste_aftertaste:"",st_name:$("#st_name").val(),st_letter:$("#st_letter").val(),st_guide:$("#st_guide").val(),st_type:b,st_category:$("#st_category").val(),st_category_number:parseFloat($("#st_category_number").jqxNumberInput("decimal")),st_og_min:parseFloat($("#st_og_min").jqxNumberInput("decimal")),st_og_max:parseFloat($("#st_og_max").jqxNumberInput("decimal")),st_fg_min:parseFloat($("#st_fg_min").jqxNumberInput("decimal")),st_fg_max:parseFloat($("#st_fg_max").jqxNumberInput("decimal")),st_ibu_min:parseFloat($("#st_ibu_min").jqxNumberInput("decimal")),st_ibu_max:parseFloat($("#st_ibu_max").jqxNumberInput("decimal")),st_color_min:parseFloat($("#st_color_min").jqxNumberInput("decimal")),st_color_max:parseFloat($("#st_color_max").jqxNumberInput("decimal")),st_carb_min:parseFloat($("#st_carb_min").jqxNumberInput("decimal")),st_carb_max:parseFloat($("#st_carb_max").jqxNumberInput("decimal")),st_abv_min:parseFloat($("#st_abv_min").jqxNumberInput("decimal")),st_abv_max:parseFloat($("#st_abv_max").jqxNumberInput("decimal")),type:a,batch_size:parseFloat($("#eq_batch_size").jqxNumberInput("decimal")),boil_size:parseFloat($("#eq_boil_size").jqxNumberInput("decimal")),boil_time:parseFloat($("#eq_boil_time").jqxNumberInput("decimal")),efficiency:parseFloat($("#eq_efficiency").jqxNumberInput("decimal")),est_og:0,est_fg:0,est_color:0,est_abv:0,est_carb:0,color_method:0,est_ibu:0,ibu_method:0,mash_name:"",mash_ph:5.4,sparge_temp:85,sparge_volume:parseFloat($("#eq_boil_size").jqxNumberInput("decimal"))/2,sparge_ph:5.8,sparge_source:0,sparge_acid_type:0,sparge_acid_perc:80,sparge_acid_amount:0,calc_acid:1,w1_name:"Tap water",w1_amount:parseFloat($("#eq_mash_volume").jqxNumberInput("decimal")),w1_calcium:0,w1_sulfate:0,w1_chloride:0,w1_sodium:0,w1_magnesium:0,w1_total_alkalinity:0,w1_ph:7,w1_cost:0,wa_acid_name:0,wa_acid_perc:80,wa_base_name:0,wg_amount:parseFloat($("#eq_mash_volume").jqxNumberInput("decimal")),wg_calcium:0,wg_sulfate:0,wg_chloride:0,wg_sodium:0,wg_magnesium:0,wg_total_alkalinity:0,wg_ph:7,wb_calcium:0,wb_sulfate:0,wb_sodium:0,wb_chloride:0,wb_magnesium:0,wb_total_alkalinity:0,wb_ph:0,starter_enable:0,divide_type:0,divide_size:0,divide_parts:0};h="insert=true&return="+my_return+"&"+$.param(i);$.ajax({dataType:"json",url:"includes/db_product.php",cache:false,data:h,type:"POST",success:function(l,k,m){window.location.href=my_return},error:function(k,m,l){}})});$(".nextButton").click(function(){d.validate(true);$("#jqxTabs").jqxTabs("next")});$(".backButton").click(function(){d.validate(true);$("#jqxTabs").jqxTabs("previous")})};return{init:function(){$("#jqxTabs").jqxTabs({theme:theme,height:630,width:1280,autoHeight:false,position:"top",keyboardNavigation:false});$("#nextButtonBase").jqxButton({theme:theme,width:150});$("#nextButtonStyle").jqxButton({theme:theme,width:150});$("#backButtonStyle").jqxButton({theme:theme,template:"success",width:150});$("#nextButtonEq").jqxButton({theme:theme,width:150});$("#backButtonEq").jqxButton({theme:theme,template:"success",width:150});$("#nextButtonCompleted").jqxButton({theme:theme,template:"success",width:150});$("#backButtonCompleted").jqxButton({theme:theme,template:"success",width:150});e();this.validate();this.showHint("Validation hints.")},validate:function(f){if(!this.firstTab(f)){$("#jqxTabs").jqxTabs("disableAt",1);$("#jqxTabs").jqxTabs("disableAt",2);$("#jqxTabs").jqxTabs("disableAt",3);return}else{$("#jqxTabs").jqxTabs("enableAt",1)}if(!this.secondTab(f)){$("#jqxTabs").jqxTabs("disableAt",2);$("#jqxTabs").jqxTabs("disableAt",3);return}else{$("#jqxTabs").jqxTabs("enableAt",2)}if(!this.thirdTab(f)){$("#jqxTabs").jqxTabs("disableAt",3);return}else{$("#jqxTabs").jqxTabs("enableAt",3)}},showHint:function(g,f){if(typeof f==="undefined"){f=".hint"}if(g===""){g="Ok, je mag doorgaan."}$(f).html("<strong>"+g+"</strong>")},firstTab:function(g){var f=$("#name").val(),i=$("#code").val(),h="";if(f.length<3){h+="Je moet een brouw project naam invullen. <br />"}if(i.length<3){h+="Je moet een brouw project code invullen. <br />"}if(h!==""){if(g){this.showHint(h,"#hintBase")}return false}this.showHint("Ok, je mag doorgaan.","#hintBase");$("#nextButtonBase").jqxButton({template:"success"});return true},secondTab:function(g){var f=$("#styleSelect").val(),h="";if(f.length<3){h+="Je moet een bierstijl kiezen. <br />"}if(h!==""){if(g){this.showHint(h,"#hintStyle")}return false}this.showHint("Ok, je mag doorgaan.","#hintStyle");$("#nextButtonStyle").jqxButton({template:"success"});return true},thirdTab:function(f){var h=$("#equipmentSelect").val(),g="";if(h.length<3){g+="Je moet een brouw installatie kiezen. <br />"}if(g!==""){if(f){this.showHint(g,"#hintEq")}return false}this.showHint("Ok, je mag doorgaan.","#hintEq");$("#nextButtonEq").jqxButton({template:"success"});return true}}}());d.init()});
\ No newline at end of file
--- a/www/js/profile_fermentation-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){$("#name").jqxTooltip({content:"De naam voor dit vergisting profiel."});$("#inittemp_lo").jqxTooltip({content:"De minimale begin temperatuur van dit profiel."});$("#inittemp_hi").jqxTooltip({content:"De maximale begin temperatuur van dit profiel."});var c={},b="includes/db_profile_fermentation.php",e={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"uuid",type:"string"},{name:"name",type:"string"},{name:"inittemp_lo",type:"float"},{name:"inittemp_hi",type:"float"},{name:"fridgemode",type:"int"},{name:"totalsteps",type:"int"},{name:"duration",type:"int"},{name:"steps",type:"array"}],id:"record",url:b,deleterow:function(g,i){var h="delete=true&"+$.param({record:g});$.ajax({dataType:"json",url:b,cache:false,data:h,type:"POST",success:function(k,j,l){i(true);location.reload(true)},error:function(j,l,k){i(false)}})},addrow:function(h,k,g,j){var i="insert=true&"+$.param(k);$.ajax({dataType:"json",url:b,cache:false,data:i,type:"POST",success:function(m,l,n){j(true);location.reload(true)},error:function(l,n,m){j(false)}})},updaterow:function(g,j,i){var h="update=true&"+$.param(j);$.ajax({dataType:"json",url:b,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})}},f=new $.jqx.dataAdapter(e),d=-1,a=function(j){var i=function(){var k={};k.name="Stap 1";k.steptime=12;k.resttime=24;k.target_lo=22;k.target_hi=23;k.fridgemode=0;return k},h={localdata:j.steps,datatype:"local",datafields:[{name:"name",type:"string"},{name:"steptime",type:"float"},{name:"resttime",type:"float"},{name:"target_lo",type:"float"},{name:"target_hi",type:"float"},{name:"fridgemode",type:"int"}],addrow:function(l,n,k,m){m(true)},deleterow:function(k,l){l(true)}},g=new $.jqx.dataAdapter(h);$("#grid").jqxGrid({width:800,height:330,source:g,theme:theme,selectionmode:"singlerow",editmode:"selectedcell",editable:true,showtoolbar:true,rendertoolbar:function(l){var k=$("<div style='margin: 5px;'></div>");l.append(k);k.append('<input style="margin-left: 100px;" id="addrowbutton" type="button" value="Nieuwe stap" />');k.append('<input style="margin-left: 290px;" id="deleterowbutton" type="button" value="Verwijder stap" />');$("#addrowbutton").jqxButton({template:"primary",theme:theme,width:150});$("#deleterowbutton").jqxButton({template:"danger",theme:theme,width:150});$("#addrowbutton").on("click",function(){var m=i();$("#grid").jqxGrid("addrow",null,m)});$("#deleterowbutton").on("click",function(){var m=$("#grid").jqxGrid("getselectedrowindex"),o=$("#grid").jqxGrid("getdatainformation").rowscount,n;if(m>=0&&m<o){n=$("#grid").jqxGrid("getrowid",m);$("#grid").jqxGrid("deleterow",n)}})},columns:[{text:"Stap naam",datafield:"name"},{text:"Min. &deg;C",datafield:"target_lo",width:100,align:"right",cellsalign:"right",cellsformat:"f1",validation:function(k,l){if(l<0||l>40){return{result:false,message:"De temperatuur moet tussen 0 en 40 zijn."}}return true}},{text:"Max. &deg;C",datafield:"target_hi",width:100,align:"right",cellsalign:"right",cellsformat:"f1",validation:function(k,l){if(l<0||l>40){return{result:false,message:"De temperatuur moet tussen 0 en 40 zijn."}}return true}},{text:"Koelkast",datafield:"fridgemode",columntype:"checkbox",width:80},{text:"Stap tijd",datafield:"steptime",width:80,align:"right",cellsalign:"right",validation:function(k,l){if(l<0||l>14400){return{result:false,message:"De tijd moet tussen 0 en 14400 zijn."}}return true}},{text:"Rust tijd",datafield:"resttime",width:80,align:"right",cellsalign:"right",validation:function(k,l){if(l<0||l>14400){return{result:false,message:"De tijd moet tussen 0 en 14400 zijn."}}return true}}]})};$("#name").jqxInput({theme:theme,width:640,height:23});$("#inittemp_lo").jqxNumberInput(Spin1dec);$("#inittemp_lo").jqxNumberInput({max:40});$("#inittemp_hi").jqxNumberInput(Spin1dec);$("#inittemp_hi").jqxNumberInput({max:40});$("#fridgemode").jqxCheckBox({theme:theme,height:23,enableContainerClick:false});$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var h,g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");h=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");g.append(h);i.append(g);h.jqxButton({theme:theme,width:90,height:20});h.click(function(j){d=-1;$("#name").val("Nieuw vergist profiel");c.uuid="";$("#inittemp_lo").val(20);$("#inittemp_hi").val(20);$("#fridgemode").val(0);c.totalsteps=0;c.duration=0;a("");$("#popupWindow").jqxWindow("open")})},filterable:false,columns:[{text:"Vergisting profiel",datafield:"name"},{text:"Min. start &deg;C",datafield:"inittemp_lo",width:150,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Max. start &deg;C",datafield:"inittemp_hi",width:150,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Stappen",datafield:"totalsteps",width:80,align:"right",cellsalign:"right"},{text:"Tijdsduur",datafield:"duration",width:150,align:"right",cellsrenderer:function(m,j,l,i,k){var h,n,g;if(l<24){h=l+" uur"}else{n=Math.floor(l/24);g=l%24;if(n==1){h=n+" dag, "+g+" uur"}else{h=n+" dagen, "+g+" uur"}}return"<span style='margin: 3px; margin-top: 6px; float: right;'>"+h+"</span>"}},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(g){d=g;c=$("#jqxgrid").jqxGrid("getrowdata",d);$("#name").val(c.name);$("#inittemp_lo").val(parseFloat(c.inittemp_lo));$("#inittemp_hi").val(parseFloat(c.inittemp_hi));$("#fridgemode").val(parseFloat(c.fridgemode));a(c);$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").jqxWindow({width:1050,height:550,position:{x:110,y:30},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(d>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var g=$("#jqxgrid").jqxGrid("getrowid",d);$("#jqxgrid").jqxGrid("deleterow",g)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var i,h=-1,g=$("#grid").jqxGrid("getrows");if(d>=0){h=$("#jqxgrid").jqxGrid("getrowid",d)}i={record:h,uuid:c.uuid,name:$("#name").val(),inittemp_lo:parseFloat($("#inittemp_lo").jqxNumberInput("decimal")),inittemp_hi:parseFloat($("#inittemp_hi").jqxNumberInput("decimal")),fridgemode:$("#fridgemode").val(),steps:g};if(d>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/profile_mash-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){$("#name").jqxTooltip({content:"De naam voor dit maisch profiel."});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit maisch profiel."});var g=0,d={},c={},b="includes/db_profile_mash.php",f={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"notes",type:"string"},{name:"steps",type:"array"}],id:"record",url:b,deleterow:function(i,k){var j="delete=true&"+$.param({record:i});$.ajax({dataType:"json",url:b,cache:false,data:j,type:"POST",success:function(m,l,n){k(true);console.log("mash deleterow "+i+" success");location.reload(true)},error:function(l,n,m){k(false);console.log("mash deleterow "+n)}})},addrow:function(j,m,i,l){var k="insert=true&"+$.param(m);$.ajax({dataType:"json",url:b,cache:false,data:k,type:"POST",success:function(o,n,p){l(true);console.log("mash addrow "+j+" success");location.reload(true)},error:function(n,p,o){l(false);console.log("mash addrow "+p)}})},updaterow:function(i,l,k){var j="update=true&"+$.param(l);$.ajax({dataType:"json",url:b,cache:false,data:j,type:"POST",success:function(n,m,o){k(true);console.log("mash updaterow "+i+" success");location.reload(true)},error:function(m,o,n){k(false);console.log("mash updaterow "+o)}})}},h=new $.jqx.dataAdapter(f),e=-1,a=function(l){var k=function(){var m={};m.step_name="Stap 1";m.step_type=0;m.step_temp=62;m.step_time=20;m.ramp_time=1;m.end_temp=62;return m},j={localdata:l.steps,datatype:"local",datafields:[{name:"step_name",type:"string"},{name:"step_type",type:"int"},{name:"step_temp",type:"float"},{name:"step_time",type:"float"},{name:"ramp_time",type:"float"},{name:"end_temp",type:"float"}],addrow:function(n,p,m,o){o(true)},deleterow:function(m,n){n(true)}},i=new $.jqx.dataAdapter(j);$("#grid").jqxGrid({width:1020,height:330,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(n){var m=$("<div style='margin: 5px;'></div>");n.append(m);m.append('<input style="margin-left: 100px;" id="addrowbutton" type="button" value="Nieuwe stap" />');m.append('<input style="margin-left: 450px;" id="deleterowbutton" type="button" value="Verwijder stap" />');$("#addrowbutton").jqxButton({template:"primary",theme:theme,width:150});$("#deleterowbutton").jqxButton({template:"danger",theme:theme,width:150});$("#addrowbutton").on("click",function(){var o=k();$("#grid").jqxGrid("addrow",null,o)});$("#deleterowbutton").on("click",function(){var q,p,o=$("#grid").jqxGrid("getselectedrowindex");q=$("#grid").jqxGrid("getdatainformation").rowscount;if(o>=0&&o<q){p=$("#grid").jqxGrid("getrowid",o);$("#grid").jqxGrid("deleterow",p)}})},columns:[{text:"Stap naam",datafield:"step_name"},{text:"Stap type",datafield:"step_type",width:150,cellsrenderer:function(n,m,q,p,o,r){return"<div style='margin: 4px;'>"+MashStepTypeData[q].nl+"</div>"}},{text:"Begin &deg;C",datafield:"step_temp",width:100,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Eind &deg;C",datafield:"end_temp",width:100,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Rust min.",datafield:"step_time",width:90,align:"right",cellsalign:"right"},{text:"Stap min.",datafield:"ramp_time",width:90,align:"right",cellsalign:"right"},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(m){g=m;d=$("#grid").jqxGrid("getrowdata",g);$("#m_step_name").val(d.step_name);$("#m_step_type").val(d.step_type);$("#m_step_temp").val(d.step_temp);$("#m_end_temp").val(d.end_temp);$("#m_step_time").val(d.step_time);$("#m_ramp_time").val(d.ramp_time);$("#popupStep").jqxWindow("open")}}]})};$("#m_step_name").jqxInput({theme:theme,width:320,height:23});$("#m_step_type").jqxDropDownList({theme:theme,source:MashStepTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#m_step_temp").jqxNumberInput(Spin1dec);$("#m_step_temp").jqxNumberInput({Min:30,Max:80});$("#m_end_temp").jqxNumberInput(Spin1dec);$("#m_end_temp").jqxNumberInput({Min:30,Max:80});$("#m_step_time").jqxNumberInput(PosInt);$("#m_step_time").jqxNumberInput({Min:1,Max:120});$("#m_ramp_time").jqxNumberInput(PosInt);$("#m_ramp_time").jqxNumberInput({Min:1,Max:30});$("#name").jqxInput({theme:theme,width:480,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#jqxgrid").jqxGrid({width:1280,height:630,source:h,theme:theme,showstatusbar:true,renderstatusbar:function(k){var j,i=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");j=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");i.append(j);k.append(i);j.jqxButton({theme:theme,width:90,height:20});j.click(function(l){e=-1;$("#name").val("Nieuw maisch schema");$("#notes").val("");a("");$("#popupWindow").jqxWindow("open")})},filterable:true,filtermode:"excel",columns:[{text:"Maish schema",datafield:"name",width:250},{text:"Opmerkingen",datafield:"notes"},{text:"",datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(i){e=i;c=$("#jqxgrid").jqxGrid("getrowdata",e);$("#name").val(c.name);$("#notes").val(c.notes);a(c);$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").jqxWindow({width:1050,height:580,position:{x:110,y:30},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#popupStep").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Ready"),modalOpacity:0.4});$("#Ready").jqxButton({template:"success",width:"90px",theme:theme});$("#Ready").click(function(){$("#grid").jqxGrid("setcellvalue",g,"step_name",$("#m_step_name").val());$("#grid").jqxGrid("setcellvalue",g,"step_type",$("#m_step_type").val());$("#grid").jqxGrid("setcellvalue",g,"step_temp",$("#m_step_temp").val());$("#grid").jqxGrid("setcellvalue",g,"end_temp",$("#m_end_temp").val());$("#grid").jqxGrid("setcellvalue",g,"step_time",$("#m_step_time").val());$("#grid").jqxGrid("setcellvalue",g,"ramp_time",$("#m_ramp_time").val());$("#grid").jqxGrid("sortby","step_temp","asc")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(e>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var i=$("#jqxgrid").jqxGrid("getrowid",e);$("#jqxgrid").jqxGrid("deleterow",i)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var i=$("#grid").jqxGrid("getrows"),j=-1,k;if(e>=0){j=$("#jqxgrid").jqxGrid("getrowid",e)}k={record:j,name:$("#name").val(),notes:$("#notes").val(),steps:i};if(e>=0){$("#jqxgrid").jqxGrid("updaterow",j,k)}else{$("#jqxgrid").jqxGrid("addrow",null,k)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/profile_setup-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var b={},c="getwatersources.php",a={datatype:"json",datafields:[{name:"name",type:"string"},],url:c,async:false},d=new $.jqx.dataAdapter(a);url="includes/db_setup.php",source={datatype:"json",cache:false,datafields:[{name:"brewery_name",type:"string"},{name:"factor_mashhop",type:"number"},{name:"factor_fwh",type:"number"},{name:"factor_pellet",type:"number"},{name:"factor_plug",type:"number"},{name:"factor_wethop",type:"number"},{name:"factor_cryohop",type:"number"},{name:"ibu_method",type:"int"},{name:"color_method",type:"int"},{name:"brix_correction",type:"float"},{name:"grain_absorbtion",type:"float"},{name:"default_water",type:"string"}],url:url},dataAdapter=new $.jqx.dataAdapter(source,{loadComplete:function(){var e=dataAdapter.records;b=e[0];$("#brewery_name").val(b.brewery_name);$("#factor_mashhop").val(b.factor_mashhop);$("#factor_fwh").val(b.factor_fwh);$("#factor_pellet").val(b.factor_pellet);$("#factor_plug").val(b.factor_plug);$("#factor_wethop").val(b.factor_wethop);$("#factor_cryohop").val(b.factor_cryohop);$("#color_method").val(b.color_method);$("#ibu_method").val(b.ibu_method);$("#brix_correction").val(b.brix_correction);$("#grain_absorbtion").val(b.grain_absorbtion)},loadError:function(g,e,f){},});dataAdapter.dataBind();$("#brewery_name").jqxTooltip({content:"De naam voor deze brouwerij."});$("#factor_mashhop").jqxTooltip({content:"Het efficientie percentage voor hop tijdens de maisch."});$("#factor_fwh").jqxTooltip({content:"Het efficientie percentage voor First Wort Hop."});$("#factor_pellet").jqxTooltip({content:"Het efficientie percentage bij gebruik van hop pellets."});$("#factor_plug").jqxTooltip({content:"Het efficientie percentage bij gebruik van hop plugs."});$("#factor_wethop").jqxTooltip({content:"Het efficientie percentage bij gebruik van nat geplukte hop."});$("#factor_cryohop").jqxTooltip({content:"Het efficientie percentage bij gebruik van Cryo Hop&reg;."});$("#brix_correction").jqxTooltip({content:"Omzettingsfactor voor Plato naar Brix"});$("#grain_absorbtion").jqxTooltip({content:"Absorbtie van water door graan (L/Kg)"});$("#brewery_name").jqxInput({theme:theme,width:640,height:23});$("#factor_fwh").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-50,max:50,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#factor_mashhop").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-50,max:50,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#factor_pellet").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:0,max:20,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#factor_plug").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:0,max:20,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#factor_wethop").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-98,max:-20,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#factor_cryohop").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:-20,max:150,decimalDigits:0,spinButtons:true,symbol:"%",symbolPosition:"right"});$("#brix_correction").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:1,max:1.05,decimalDigits:2,spinButtons:true});$("#grain_absorbtion").jqxNumberInput({inputMode:"simple",theme:theme,width:110,height:23,min:0.5,max:1.1,decimalDigits:2,spinButtons:true});$("#color_method").jqxDropDownList({theme:theme,source:ColorMethodAdapter,valueMember:"id",displayMember:"nl",width:180,autoDropDownHeight:true});$("#ibu_method").jqxDropDownList({theme:theme,source:IBUmethodAdapter,valueMember:"id",displayMember:"nl",width:180,autoDropDownHeight:true});$("#default_water").jqxDropDownList({placeHolder:"Kies water:",theme:theme,source:d,valueMember:"name",displayMember:"name",width:250,dropDownHorizontalAlignment:"right",dropDownWidth:300,autoDropDownHeight:true});$("#default_water").jqxDropDownList("selectItem",b.default_water);$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var e,f={record:1,brewery_name:$("#brewery_name").val(),factor_mashhop:$("#factor_mashhop").val(),factor_fwh:$("#factor_fwh").val(),factor_pellet:$("#factor_pellet").val(),factor_plug:$("#factor_plug").val(),factor_wethop:$("#factor_wethop").val(),factor_cryohop:$("#factor_cryohop").val(),color_method:$("#color_method").val(),ibu_method:$("#ibu_method").val(),brix_correction:parseFloat($("#brix_correction").jqxNumberInput("decimal")),grain_absorbtion:parseFloat($("#grain_absorbtion").jqxNumberInput("decimal")),default_water:$("#default_water").val()};e="update=true&"+$.param(f);$.ajax({dataType:"json",url:url,cache:false,data:e,type:"POST",success:function(h,g,i){},error:function(g,i,h){}})})});
\ No newline at end of file
--- a/www/js/profile_styles-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){var b={},a="includes/db_profile_styles.php",d={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"category",type:"string"},{name:"category_number",type:"number"},{name:"style_letter",type:"string"},{name:"style_guide",type:"string"},{name:"type",type:"int"},{name:"og_min",type:"float"},{name:"og_max",type:"float"},{name:"fg_min",type:"float"},{name:"fg_max",type:"float"},{name:"ibu_min",type:"float"},{name:"ibu_max",type:"float"},{name:"color_min",type:"float"},{name:"color_max",type:"float"},{name:"carb_min",type:"float"},{name:"carb_max",type:"float"},{name:"abv_min",type:"float"},{name:"abv_max",type:"float"},{name:"notes",type:"string"},{name:"profile",type:"string"},{name:"ingredients",type:"string"},{name:"examples",type:"string"}],id:"record",url:a,deleterow:function(f,h){var g="delete=true&"+$.param({record:f});$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(j,i,k){h(true);location.reload(true)},error:function(i,k,j){h(false)}})},addrow:function(g,j,f,i){var h="insert=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})},updaterow:function(f,i,h){var g="update=true&"+$.param(i);$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(k,j,l){h(true);location.reload(true)},error:function(j,l,k){h(false)}})}},e=new $.jqx.dataAdapter(d),c=-1;$("#name").jqxInput({theme:theme,width:320,height:23});$("#category").jqxInput({theme:theme,width:320,height:23});$("#category_number").jqxNumberInput(PosInt);$("#style_letter").jqxInput({theme:theme,width:250,height:23});$("#style_guide").jqxInput({theme:theme,width:320,height:23});$("#type").jqxDropDownList({theme:theme,source:StyleTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#og_min").jqxNumberInput(SGopts);$("#og_max").jqxNumberInput(SGopts);$("#fg_min").jqxNumberInput(SGopts);$("#fg_max").jqxNumberInput(SGopts);$("#ibu_min").jqxNumberInput(PosInt);$("#ibu_min").jqxNumberInput({max:200});$("#ibu_max").jqxNumberInput(PosInt);$("#ibu_max").jqxNumberInput({max:200});$("#color_min").jqxNumberInput(PosInt);$("#color_min").jqxNumberInput({max:200});$("#color_max").jqxNumberInput(PosInt);$("#color_max").jqxNumberInput({max:200});$("#carb_min").jqxNumberInput(Spin1dec);$("#carb_min").jqxNumberInput({max:5});$("#carb_max").jqxNumberInput(Spin1dec);$("#carb_max").jqxNumberInput({max:5});$("#abv_min").jqxNumberInput(Spin1dec);$("#abv_min").jqxNumberInput({max:20});$("#abv_max").jqxNumberInput(Spin1dec);$("#abv_max").jqxNumberInput({max:20});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#profile").jqxInput({theme:theme,width:800,height:48});$("#ingredients").jqxInput({theme:theme,width:800,height:23});$("#examples").jqxInput({theme:theme,width:800,height:48});$("#jqxgrid").jqxGrid({width:1280,height:630,source:e,theme:theme,showstatusbar:true,renderstatusbar:function(h){var f,g,i;f=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");g=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");i=$("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");f.append(g);f.append(i);h.append(f);g.jqxButton({theme:theme,width:90,height:20});i.jqxButton({theme:theme,width:90,height:20});g.click(function(j){c=-1;$("#name").val("Nieuwe stijl");$("#category").val("");$("#category_number").val("");$("#style_letter").val("");$("#style_guide").val("BKG 2015");$("#type").val(0);$("#og_min").val(1.03);$("#og_max").val(1.05);$("#fg_min").val(1.005);$("#fg_max").val(1.01);$("#ibu_min").val(20);$("#ibu_max").val(30);$("#color_min").val(52);$("#color_max").val(79);$("#carb_min").val(2);$("#carb_max").val(2.5);$("#abv_min").val(4);$("#abv_max").val(5);$("#notes").val("");$("#profile").val("");$("#ingredients").val("");$("#examples").val("");$("#popupWindow").jqxWindow("open")});i.click(function(j){window.location.href="import_ingredients.php?select=styles"})},filterable:true,filtermode:"excel",columns:[{text:"Gids",datafield:"style_guide",width:100},{text:"Groep",datafield:"style_letter",width:30},{text:"Style Name",menu:false,datafield:"name"},{text:"OG",menu:false,datafield:"og_min",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"OG",menu:false,datafield:"og_max",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"FG",menu:false,datafield:"fg_min",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"FG",menu:false,datafield:"fg_max",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"IBU",menu:false,datafield:"ibu_min",width:50,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"IBU",menu:false,datafield:"ibu_max",width:50,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"EBC",menu:false,datafield:"color_min",width:50,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"EBC",menu:false,datafield:"color_max",width:50,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"Co2",menu:false,datafield:"carb_min",width:50,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Co2",menu:false,datafield:"carb_max",width:50,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"ABV",menu:false,datafield:"abv_min",width:50,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"ABV",menu:false,datafield:"abv_max",width:50,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"",menu:false,datafield:"Edit",width:100,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(f){c=f;b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#category").val(b.category);$("#category_number").val(b.category_number);$("#style_letter").val(b.style_letter);$("#style_guide").val(b.style_guide);$("#type").val(b.type);$("#og_min").val(b.og_min);$("#og_max").val(b.og_max);$("#fg_min").val(b.fg_min);$("#fg_max").val(b.fg_max);$("#ibu_min").val(b.ibu_min);$("#ibu_max").val(b.ibu_max);$("#color_min").val(b.color_min);$("#color_max").val(b.color_max);$("#carb_min").val(b.carb_min);$("#carb_max").val(b.carb_max);$("#abv_min").val(b.abv_min);$("#abv_max").val(b.abv_max);$("#notes").val(b.notes);$("#profile").val(b.profile);$("#ingredients").val(b.ingredients);$("#examples").val(b.examples);$("#popupWindow").jqxWindow("open")}}]});$("#popupWindow").jqxWindow({width:1050,position:{x:110,y:30},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var f=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",f)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,f=-1;if(c>=0){f=$("#jqxgrid").jqxGrid("getrowid",c)}g={record:f,name:$("#name").val(),category:$("#category").val(),category_number:parseFloat($("#category_number").jqxNumberInput("decimal")),style_letter:$("#style_letter").val(),style_guide:$("#style_guide").val(),type:$("#type").val(),og_min:parseFloat($("#og_min").jqxNumberInput("decimal")),og_max:parseFloat($("#og_max").jqxNumberInput("decimal")),fg_min:parseFloat($("#fg_min").jqxNumberInput("decimal")),fg_max:parseFloat($("#fg_max").jqxNumberInput("decimal")),ibu_min:parseFloat($("#ibu_min").jqxNumberInput("decimal")),ibu_max:parseFloat($("#ibu_max").jqxNumberInput("decimal")),color_min:parseFloat($("#color_min").jqxNumberInput("decimal")),color_max:parseFloat($("#color_max").jqxNumberInput("decimal")),carb_min:parseFloat($("#carb_min").jqxNumberInput("decimal")),carb_max:parseFloat($("#carb_max").jqxNumberInput("decimal")),abv_min:parseFloat($("#abv_min").jqxNumberInput("decimal")),abv_max:parseFloat($("#abv_max").jqxNumberInput("decimal")),notes:$("#notes").val(),profile:$("#profile").val(),ingredients:$("#ingredients").val(),examples:$("#examples").val()};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",f,g)}else{$("#jqxgrid").jqxGrid("addrow",null,g)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/profile_styles.js	Fri Oct 18 13:09:37 2019 +0200
+++ b/www/js/profile_styles.js	Fri Oct 18 16:21:54 2019 +0200
@@ -22,323 +22,325 @@
 
 
 function createDelElements() {
-	$('#eventWindow').jqxWindow({
-		theme: theme,
-		position: { x: 490, y: 210 },
-		width: 300,
-		height: 175,
-		resizable: false,
-		isModal: true,
-		modalOpacity: 0.4,
-		okButton: $('#delOk'),
-		cancelButton: $('#delCancel'),
-		initContent: function () {
-			$('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
-			$('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
-			$('#delCancel').focus();
-		}
-	});
-	$('#eventWindow').jqxWindow('hide');
+ $('#eventWindow').jqxWindow({
+  theme: theme,
+  position: { x: 490, y: 210 },
+  width: 300,
+  height: 175,
+  resizable: false,
+  isModal: true,
+  modalOpacity: 0.4,
+  okButton: $('#delOk'),
+  cancelButton: $('#delCancel'),
+  initContent: function() {
+   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
+   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
+   $('#delCancel').focus();
+  }
+ });
+ $('#eventWindow').jqxWindow('hide');
 }
 
 
-$(document).ready(function () {
+$(document).ready(function() {
 
-	var dataRecord = {},
-	url = 'includes/db_profile_styles.php',
-	source = {
-		datatype: "json",
-		cache: false,
-		datafields: [
-			{ name: 'record', type: 'number' },
-			{ name: 'name', type: 'string' },
-			{ name: 'category', type: 'string' },
-			{ name: 'category_number', type: 'number' },
-			{ name: 'style_letter', type: 'string' },
-			{ name: 'style_guide', type: 'string' },
-			{ name: 'type', type: 'int' },
-			{ name: 'og_min', type: 'float' },
-			{ name: 'og_max', type: 'float' },
-			{ name: 'fg_min', type: 'float' },
-                        { name: 'fg_max', type: 'float' },
-			{ name: 'ibu_min', type: 'float' },
-                        { name: 'ibu_max', type: 'float' },
-			{ name: 'color_min', type: 'float' },
-			{ name: 'color_max', type: 'float' },
-			{ name: 'carb_min', type: 'float' },
-	                { name: 'carb_max', type: 'float' },
-			{ name: 'abv_min', type: 'float' },
-	                { name: 'abv_max', type: 'float' },
-			{ name: 'notes', type: 'string' },
-			{ name: 'profile', type: 'string' },
-			{ name: 'ingredients', type: 'string' },
-			{ name: 'examples', type: 'string' }
-		],
-		id: 'record',
-		url: url,
-		deleterow: function (rowid, commit) {
-			// synchronize with the server - send delete command
-			var data = "delete=true&" + $.param({ record: rowid });
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function (jqXHR, textStatus, errorThrown) {
-					commit(false);
-				}
-			});
-		},
-		addrow: function (rowid, rowdata, position, commit) {
-			var data = "insert=true&" + $.param(rowdata);
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function(jqXHR, textStatus, errorThrown) {
-                                        commit(false);
-                                }
-                        });
-                },
-		updaterow: function (rowid, rowdata, commit) {
-			var data = "update=true&" + $.param(rowdata);
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function(jqXHR, textStatus, errorThrown) {
-					commit(false);
-				}
-			});
-		}
-	},
-	dataAdapter = new $.jqx.dataAdapter(source),
+ var dataRecord = {},
+ url = 'includes/db_profile_styles.php',
+ source = {
+  datatype: 'json',
+  cache: false,
+  datafields: [
+   { name: 'record', type: 'number' },
+   { name: 'name', type: 'string' },
+   { name: 'category', type: 'string' },
+   { name: 'category_number', type: 'number' },
+   { name: 'style_letter', type: 'string' },
+   { name: 'style_guide', type: 'string' },
+   { name: 'type', type: 'int' },
+   { name: 'og_min', type: 'float' },
+   { name: 'og_max', type: 'float' },
+   { name: 'fg_min', type: 'float' },
+   { name: 'fg_max', type: 'float' },
+   { name: 'ibu_min', type: 'float' },
+   { name: 'ibu_max', type: 'float' },
+   { name: 'color_min', type: 'float' },
+   { name: 'color_max', type: 'float' },
+   { name: 'carb_min', type: 'float' },
+   { name: 'carb_max', type: 'float' },
+   { name: 'abv_min', type: 'float' },
+   { name: 'abv_max', type: 'float' },
+   { name: 'notes', type: 'string' },
+   { name: 'profile', type: 'string' },
+   { name: 'ingredients', type: 'string' },
+   { name: 'examples', type: 'string' }
+  ],
+  id: 'record',
+  url: url,
+  deleterow: function(rowid, commit) {
+   // synchronize with the server - send delete command
+   var data = 'delete=true&' + $.param({ record: rowid });
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  },
+  addrow: function(rowid, rowdata, position, commit) {
+   var data = 'insert=true&' + $.param(rowdata);
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  },
+  updaterow: function(rowid, rowdata, commit) {
+   var data = 'update=true&' + $.param(rowdata);
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  }
+ },
+ dataAdapter = new $.jqx.dataAdapter(source),
         editrow = -1;
 
-	// initialize the input fields.
-	$("#name").jqxInput({ theme: theme, width: 320, height: 23 });
-	$("#category").jqxInput({ theme: theme, width: 320, height: 23 });
-	$("#category_number").jqxNumberInput( PosInt );
-	$("#style_letter").jqxInput({ theme: theme, width: 250, height: 23 });
-	$("#style_guide").jqxInput({ theme: theme, width: 320, height: 23 });
-	$("#type").jqxDropDownList({
-		theme: theme,
-		source: StyleTypeAdapter,
-		valueMember: 'id',
-		displayMember: 'nl',
-		width: 180,
-		height: 23,
-		autoDropDownHeight: true
-	});
-	$("#og_min").jqxNumberInput( SGopts );
-	$("#og_max").jqxNumberInput( SGopts );
-	$("#fg_min").jqxNumberInput( SGopts );
-	$("#fg_max").jqxNumberInput( SGopts );
-	$("#ibu_min").jqxNumberInput( PosInt );
-	$("#ibu_min").jqxNumberInput({ max: 200 });
-	$("#ibu_max").jqxNumberInput( PosInt );
-	$("#ibu_max").jqxNumberInput({ max: 200 });
-	$("#color_min").jqxNumberInput( PosInt );
-	$("#color_min").jqxNumberInput({ max: 200 });
-	$("#color_max").jqxNumberInput( PosInt );
-	$("#color_max").jqxNumberInput({ max: 200 });
-	$("#carb_min").jqxNumberInput( Spin1dec );
-	$("#carb_min").jqxNumberInput({ max: 5 });
-	$("#carb_max").jqxNumberInput( Spin1dec );
-	$("#carb_max").jqxNumberInput({ max: 5 });
-	$("#abv_min").jqxNumberInput( Spin1dec );
-	$("#abv_min").jqxNumberInput({ max: 20 });
-	$("#abv_max").jqxNumberInput( Spin1dec );
-	$("#abv_max").jqxNumberInput({ max: 20 });
-	$("#notes").jqxInput({ theme: theme, width: 800, height: 100 });
-	$("#profile").jqxInput({ theme: theme, width: 800, height: 48 });
-	$("#ingredients").jqxInput({ theme: theme, width: 800, height: 23 });
-	$("#examples").jqxInput({ theme: theme, width: 800, height: 48 });
+ // initialize the input fields.
+ $('#name').jqxInput({ theme: theme, width: 320, height: 23 });
+ $('#category').jqxInput({ theme: theme, width: 320, height: 23 });
+ $('#category_number').jqxNumberInput(PosInt);
+ $('#style_letter').jqxInput({ theme: theme, width: 250, height: 23 });
+ $('#style_guide').jqxInput({ theme: theme, width: 320, height: 23 });
+ $('#type').jqxDropDownList({
+  theme: theme,
+  source: StyleTypeAdapter,
+  valueMember: 'id',
+  displayMember: 'nl',
+  width: 180,
+  height: 23,
+  autoDropDownHeight: true
+ });
+ $('#og_min').jqxNumberInput(SGopts);
+ $('#og_max').jqxNumberInput(SGopts);
+ $('#fg_min').jqxNumberInput(SGopts);
+ $('#fg_max').jqxNumberInput(SGopts);
+ $('#ibu_min').jqxNumberInput(PosInt);
+ $('#ibu_min').jqxNumberInput({ max: 200 });
+ $('#ibu_max').jqxNumberInput(PosInt);
+ $('#ibu_max').jqxNumberInput({ max: 200 });
+ $('#color_min').jqxNumberInput(PosInt);
+ $('#color_min').jqxNumberInput({ max: 200 });
+ $('#color_max').jqxNumberInput(PosInt);
+ $('#color_max').jqxNumberInput({ max: 200 });
+ $('#carb_min').jqxNumberInput(Spin1dec);
+ $('#carb_min').jqxNumberInput({ max: 5 });
+ $('#carb_max').jqxNumberInput(Spin1dec);
+ $('#carb_max').jqxNumberInput({ max: 5 });
+ $('#abv_min').jqxNumberInput(Spin1dec);
+ $('#abv_min').jqxNumberInput({ max: 20 });
+ $('#abv_max').jqxNumberInput(Spin1dec);
+ $('#abv_max').jqxNumberInput({ max: 20 });
+ $('#notes').jqxInput({ theme: theme, width: 800, height: 100 });
+ $('#profile').jqxInput({ theme: theme, width: 800, height: 48 });
+ $('#ingredients').jqxInput({ theme: theme, width: 800, height: 23 });
+ $('#examples').jqxInput({ theme: theme, width: 800, height: 48 });
 
-	// initialize jqxGrid
-	$("#jqxgrid").jqxGrid({
-		width: 1280,
-		height: 630,
-		source: dataAdapter,
-		theme: theme,
-		showstatusbar: true,
-		renderstatusbar: function (statusbar) {
-			var container, addButton, impButton;
-			container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
-			addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");
-			impButton = $("<div style='float: right; margin-right: 50px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Import</span></div>");
-			container.append(addButton);
-			container.append(impButton);
-			statusbar.append(container);
-			addButton.jqxButton({ theme: theme, width: 90, height: 20 });
-			impButton.jqxButton({ theme: theme, width: 90, height: 20 });
-			// add new row.
-			addButton.click(function (event) {
-				editrow = -1;
-				$("#name").val('Nieuwe stijl');
-				$("#category").val('');
-				$("#category_number").val('');
-				$("#style_letter").val('');
-				$("#style_guide").val('BKG 2015');
-				$("#type").val(0);
-				$("#og_min").val(1.030);
-				$("#og_max").val(1.050);
-				$("#fg_min").val(1.005);
-				$("#fg_max").val(1.010);
-				$("#ibu_min").val(20);
-				$("#ibu_max").val(30);
-				$("#color_min").val(52);
-				$("#color_max").val(79);
-				$("#carb_min").val(2.0);
-				$("#carb_max").val(2.5);
-				$("#abv_min").val(4.0);
-				$("#abv_max").val(5.0);
-				$("#notes").val('');
-				$("#profile").val('');
-				$("#ingredients").val('');
-				$("#examples").val('');
-				$("#popupWindow").jqxWindow('open');
-			});
-			impButton.click(function (event) {
-				window.location.href = 'import_ingredients.php?select=styles';
-			});
-		},
-		filterable: true,
-		filtermode: 'excel',
-		columns: [
-			{ text: 'Gids', datafield: 'style_guide', width: 100 },
-			{ text: 'Groep', datafield: 'style_letter', width: 30 },
-			{ text: 'Style Name', menu: false, datafield: 'name' },
-			{ text: 'OG', menu: false, datafield: 'og_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
-			{ text: 'OG', menu: false, datafield: 'og_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
-			{ text: 'FG', menu: false, datafield: 'fg_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
-			{ text: 'FG', menu: false, datafield: 'fg_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
-			{ text: 'IBU', menu: false, datafield: 'ibu_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
-			{ text: 'IBU', menu: false, datafield: 'ibu_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
-			{ text: 'EBC', menu: false, datafield: 'color_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
-			{ text: 'EBC', menu: false, datafield: 'color_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
-			{ text: 'Co2', menu: false, datafield: 'carb_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'Co2', menu: false, datafield: 'carb_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'ABV', menu: false, datafield: 'abv_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'ABV', menu: false, datafield: 'abv_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: '', menu: false, datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () {
-				return "Wijzig";
-				}, buttonclick: function (row) {
-					// open the popup window when the user clicks a button.
-					editrow = row;
-					// get the clicked row's data and initialize the input fields.
-					dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
-					$("#name").val(dataRecord.name);
-					$("#category").val(dataRecord.category);
-					$("#category_number").val(dataRecord.category_number);
-					$("#style_letter").val(dataRecord.style_letter);
-					$("#style_guide").val(dataRecord.style_guide);
-					$("#type").val(dataRecord.type);
-					$("#og_min").val(dataRecord.og_min);
-					$("#og_max").val(dataRecord.og_max);
-					$("#fg_min").val(dataRecord.fg_min);
-					$("#fg_max").val(dataRecord.fg_max);
-					$("#ibu_min").val(dataRecord.ibu_min);
-					$("#ibu_max").val(dataRecord.ibu_max);
-					$("#color_min").val(dataRecord.color_min);
-					$("#color_max").val(dataRecord.color_max);
-					$("#carb_min").val(dataRecord.carb_min);
-					$("#carb_max").val(dataRecord.carb_max);
-					$("#abv_min").val(dataRecord.abv_min);
-					$("#abv_max").val(dataRecord.abv_max);
-					$("#notes").val(dataRecord.notes);
-					$("#profile").val(dataRecord.profile);
-					$("#ingredients").val(dataRecord.ingredients);
-					$("#examples").val(dataRecord.examples);
-					// show the popup window.
-					$("#popupWindow").jqxWindow('open');
-				}
-			}
-		]
-	});
-	// initialize the popup window and buttons.
-	$("#popupWindow").jqxWindow({
-		width: 1050,
-		position: { x: 110, y: 30 },
-		resizable: false,
-		theme: theme,
-		isModal: true,
-		autoOpen: false,
-		cancelButton: $("#Cancel"),
-		modalOpacity: 0.40
-	});
-	$("#popupWindow").on('open', function () {
-		$("#name").jqxInput('selectAll');
-	});
-	$("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme });
-	$("#Delete").click(function () {
-		if (editrow >= 0) {
-			// Open a popup to confirm this action.
-			$('#eventWindow').jqxWindow('open');
-			$("#delOk").click(function () {
-				var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-				$("#jqxgrid").jqxGrid('deleterow', rowID);
-			});
-		}
-		$("#popupWindow").jqxWindow('hide');
-	});
-	$("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme });
-	$("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
-	// update the edited row when the user clicks the 'Save' button.
-	$("#Save").click(function () {
-		var row, rowID = -1;
-		if (editrow >= 0) {
-			rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-		}
-		row = {
-			record: rowID,
-			name: $("#name").val(),
-			category: $("#category").val(),
-			category_number: parseFloat($("#category_number").jqxNumberInput('decimal')),
-			style_letter: $("#style_letter").val(),
-			style_guide: $("#style_guide").val(),
-			type: $("#type").val(),
-			og_min: parseFloat($("#og_min").jqxNumberInput('decimal')),
-			og_max: parseFloat($("#og_max").jqxNumberInput('decimal')),
-			fg_min: parseFloat($("#fg_min").jqxNumberInput('decimal')),
-			fg_max: parseFloat($("#fg_max").jqxNumberInput('decimal')),
-			ibu_min: parseFloat($("#ibu_min").jqxNumberInput('decimal')),
-			ibu_max: parseFloat($("#ibu_max").jqxNumberInput('decimal')),
-			color_min: parseFloat($("#color_min").jqxNumberInput('decimal')),
-			color_max: parseFloat($("#color_max").jqxNumberInput('decimal')),
-			carb_min: parseFloat($("#carb_min").jqxNumberInput('decimal')),
-			carb_max: parseFloat($("#carb_max").jqxNumberInput('decimal')),
-			abv_min: parseFloat($("#abv_min").jqxNumberInput('decimal')),
-			abv_max: parseFloat($("#abv_max").jqxNumberInput('decimal')),
-			notes: $("#notes").val(),
-			profile: $("#profile").val(),
-			ingredients: $("#ingredients").val(),
-			examples: $("#examples").val()
-		};
-		if (editrow >= 0) {
-			$('#jqxgrid').jqxGrid('updaterow', rowID, row);
-		} else {
-			$('#jqxgrid').jqxGrid('addrow', null, row);
-		}
-		$("#popupWindow").jqxWindow('hide');
-	});
-	createDelElements();
+ // initialize jqxGrid
+ $('#jqxgrid').jqxGrid({
+  width: 1280,
+  height: 630,
+  source: dataAdapter,
+  theme: theme,
+  showstatusbar: true,
+  renderstatusbar: function(statusbar) {
+   var container, addButton, impButton;
+   container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
+   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
+       'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>');
+   impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' +
+       'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>');
+   container.append(addButton);
+   container.append(impButton);
+   statusbar.append(container);
+   addButton.jqxButton({ theme: theme, width: 90, height: 20 });
+   impButton.jqxButton({ theme: theme, width: 90, height: 20 });
+   // add new row.
+   addButton.click(function(event) {
+    editrow = -1;
+    $('#name').val('Nieuwe stijl');
+    $('#category').val('');
+    $('#category_number').val('');
+    $('#style_letter').val('');
+    $('#style_guide').val('BKG 2015');
+    $('#type').val(0);
+    $('#og_min').val(1.030);
+    $('#og_max').val(1.050);
+    $('#fg_min').val(1.005);
+    $('#fg_max').val(1.010);
+    $('#ibu_min').val(20);
+    $('#ibu_max').val(30);
+    $('#color_min').val(52);
+    $('#color_max').val(79);
+    $('#carb_min').val(2.0);
+    $('#carb_max').val(2.5);
+    $('#abv_min').val(4.0);
+    $('#abv_max').val(5.0);
+    $('#notes').val('');
+    $('#profile').val('');
+    $('#ingredients').val('');
+    $('#examples').val('');
+    $('#popupWindow').jqxWindow('open');
+   });
+   impButton.click(function(event) {
+    window.location.href = 'import_ingredients.php?select=styles';
+   });
+  },
+  filterable: true,
+  filtermode: 'excel',
+  columns: [
+   { text: 'Gids', datafield: 'style_guide', width: 100 },
+   { text: 'Groep', datafield: 'style_letter', width: 30 },
+   { text: 'Style Name', menu: false, datafield: 'name' },
+   { text: 'OG', menu: false, datafield: 'og_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
+   { text: 'OG', menu: false, datafield: 'og_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
+   { text: 'FG', menu: false, datafield: 'fg_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
+   { text: 'FG', menu: false, datafield: 'fg_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
+   { text: 'IBU', menu: false, datafield: 'ibu_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
+   { text: 'IBU', menu: false, datafield: 'ibu_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
+   { text: 'EBC', menu: false, datafield: 'color_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
+   { text: 'EBC', menu: false, datafield: 'color_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' },
+   { text: 'Co2', menu: false, datafield: 'carb_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'Co2', menu: false, datafield: 'carb_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'ABV', menu: false, datafield: 'abv_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'ABV', menu: false, datafield: 'abv_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: '', menu: false, datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function() {
+    return 'Wijzig';
+    }, buttonclick: function(row) {
+     // open the popup window when the user clicks a button.
+     editrow = row;
+     // get the clicked row's data and initialize the input fields.
+     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
+     $('#name').val(dataRecord.name);
+     $('#category').val(dataRecord.category);
+     $('#category_number').val(dataRecord.category_number);
+     $('#style_letter').val(dataRecord.style_letter);
+     $('#style_guide').val(dataRecord.style_guide);
+     $('#type').val(dataRecord.type);
+     $('#og_min').val(dataRecord.og_min);
+     $('#og_max').val(dataRecord.og_max);
+     $('#fg_min').val(dataRecord.fg_min);
+     $('#fg_max').val(dataRecord.fg_max);
+     $('#ibu_min').val(dataRecord.ibu_min);
+     $('#ibu_max').val(dataRecord.ibu_max);
+     $('#color_min').val(dataRecord.color_min);
+     $('#color_max').val(dataRecord.color_max);
+     $('#carb_min').val(dataRecord.carb_min);
+     $('#carb_max').val(dataRecord.carb_max);
+     $('#abv_min').val(dataRecord.abv_min);
+     $('#abv_max').val(dataRecord.abv_max);
+     $('#notes').val(dataRecord.notes);
+     $('#profile').val(dataRecord.profile);
+     $('#ingredients').val(dataRecord.ingredients);
+     $('#examples').val(dataRecord.examples);
+     // show the popup window.
+     $('#popupWindow').jqxWindow('open');
+    }
+   }
+  ]
+ });
+ // initialize the popup window and buttons.
+ $('#popupWindow').jqxWindow({
+  width: 1050,
+  position: { x: 110, y: 30 },
+  resizable: false,
+  theme: theme,
+  isModal: true,
+  autoOpen: false,
+  cancelButton: $('#Cancel'),
+  modalOpacity: 0.40
+ });
+ $('#popupWindow').on('open', function() {
+  $('#name').jqxInput('selectAll');
+ });
+ $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
+ $('#Delete').click(function() {
+  if (editrow >= 0) {
+   // Open a popup to confirm this action.
+   $('#eventWindow').jqxWindow('open');
+   $('#delOk').click(function() {
+    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
+    $('#jqxgrid').jqxGrid('deleterow', rowID);
+   });
+  }
+  $('#popupWindow').jqxWindow('hide');
+ });
+ $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
+ $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
+ // update the edited row when the user clicks the 'Save' button.
+ $('#Save').click(function() {
+  var row, rowID = -1;
+  if (editrow >= 0) {
+   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
+  }
+  row = {
+   record: rowID,
+   name: $('#name').val(),
+   category: $('#category').val(),
+   category_number: parseFloat($('#category_number').jqxNumberInput('decimal')),
+   style_letter: $('#style_letter').val(),
+   style_guide: $('#style_guide').val(),
+   type: $('#type').val(),
+   og_min: parseFloat($('#og_min').jqxNumberInput('decimal')),
+   og_max: parseFloat($('#og_max').jqxNumberInput('decimal')),
+   fg_min: parseFloat($('#fg_min').jqxNumberInput('decimal')),
+   fg_max: parseFloat($('#fg_max').jqxNumberInput('decimal')),
+   ibu_min: parseFloat($('#ibu_min').jqxNumberInput('decimal')),
+   ibu_max: parseFloat($('#ibu_max').jqxNumberInput('decimal')),
+   color_min: parseFloat($('#color_min').jqxNumberInput('decimal')),
+   color_max: parseFloat($('#color_max').jqxNumberInput('decimal')),
+   carb_min: parseFloat($('#carb_min').jqxNumberInput('decimal')),
+   carb_max: parseFloat($('#carb_max').jqxNumberInput('decimal')),
+   abv_min: parseFloat($('#abv_min').jqxNumberInput('decimal')),
+   abv_max: parseFloat($('#abv_max').jqxNumberInput('decimal')),
+   notes: $('#notes').val(),
+   profile: $('#profile').val(),
+   ingredients: $('#ingredients').val(),
+   examples: $('#examples').val()
+  };
+  if (editrow >= 0) {
+   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
+  } else {
+   $('#jqxgrid').jqxGrid('addrow', null, row);
+  }
+  $('#popupWindow').jqxWindow('hide');
+ });
+ createDelElements();
 });
 
--- a/www/js/profile_water-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}$(document).ready(function(){$("#name").jqxTooltip({content:"De unieke naam van dit water profiel."});$("#notes").jqxTooltip({content:"Extra opmerkingen over dit water."});$("#calcium").jqxTooltip({content:"Calcium (Ca)."});$("#bicarbonate").jqxTooltip({content:"Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit."});$("#sulfate").jqxTooltip({content:"Calcium Sulfaat (CaSO4)."});$("#chloride").jqxTooltip({content:"Chloride (Cl)."});$("#sodium").jqxTooltip({content:"Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium."});$("#magnesium").jqxTooltip({content:"Magnesium (Mg)."});$("#ph").jqxTooltip({content:"De zuurgraad (pH)."});$("#total_alkalinity").jqxTooltip({content:"Totale alkaliniteit. Berekend meteen de Bicarbonaat."});var b={},a="includes/db_profile_water.php",d={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"calcium",type:"float"},{name:"bicarbonate",type:"float"},{name:"sulfate",type:"float"},{name:"chloride",type:"float"},{name:"sodium",type:"float"},{name:"magnesium",type:"float"},{name:"ph",type:"float"},{name:"notes",type:"string"},{name:"total_alkalinity",type:"float"}],id:"record",url:a,deleterow:function(f,h){var g="delete=true&"+$.param({record:f});$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(j,i,k){h(true);location.reload(true)},error:function(i,k,j){h(false)}})},addrow:function(g,j,f,i){var h="insert=true&"+$.param(j);$.ajax({dataType:"json",url:a,cache:false,data:h,type:"POST",success:function(l,k,m){i(true);location.reload(true)},error:function(k,m,l){i(false)}})},updaterow:function(f,i,h){var g="update=true&"+$.param(i);$.ajax({dataType:"json",url:a,cache:false,data:g,type:"POST",success:function(k,j,l){h(true);location.reload(true)},error:function(j,l,k){h(false)}})}},e=new $.jqx.dataAdapter(d),c=-1;$("#name").jqxInput({theme:theme,width:640,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#calcium").jqxNumberInput(Spin1dec);$("#bicarbonate").jqxNumberInput(Spin1dec);$("#sulfate").jqxNumberInput(Spin1dec);$("#chloride").jqxNumberInput(Spin1dec);$("#sodium").jqxNumberInput(Spin1dec);$("#magnesium").jqxNumberInput(Spin1dec);$("#ph").jqxNumberInput(Spin2pH);$("#total_alkalinity").jqxNumberInput(Spin1dec);$("#jqxgrid").jqxGrid({width:1280,height:630,source:e,theme:theme,showstatusbar:true,renderstatusbar:function(h){var f=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"),g=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");f.append(g);h.append(f);g.jqxButton({theme:theme,width:90,height:20});g.click(function(i){c=-1;$("#popupWindow").jqxWindow({position:{x:110,y:30}});$("#name").val("");$("#calcium").val(0);$("#bicarbonate").val(0);$("#sulfate").val(0);$("#chloride").val(0);$("#sodium").val(0);$("#magnesium").val(0);$("#ph").val(7);$("#notes").val("");$("#total_alkalinity").val(0);$("#popupWindow").jqxWindow("open")})},filterable:false,filtermode:"excel",columns:[{text:"Water Profiel",datafield:"name",width:225},{text:"Opmerkingen",datafield:"notes"},{text:"Ca",datafield:"calcium",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Mg",datafield:"magnesium",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Na",datafield:"sodium",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"CaCO3",datafield:"total_alkalinity",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Cl",datafield:"chloride",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"SO4",datafield:"sulfate",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"pH",datafield:"ph",width:60,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"",datafield:"Edit",width:100,columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(f){c=f;$("#popupWindow").jqxWindow({position:{x:110,y:30}});b=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(b.name);$("#calcium").val(b.calcium);$("#bicarbonate").val(b.bicarbonate);$("#sulfate").val(b.sulfate);$("#chloride").val(b.chloride);$("#sodium").val(b.sodium);$("#magnesium").val(b.magnesium);$("#ph").val(b.ph);$("#notes").val(b.notes);$("#total_alkalinity").val(b.total_alkalinity);$("#popupWindow").jqxWindow("open")}}]});$("#total_alkalinity").on("change",function(f){b.bicarbonate=parseFloat(f.args.value)*1.22;$("#bicarbonate").val(b.bicarbonate)});$("#bicarbonate").on("change",function(f){b.total_alkalinity=parseFloat(f.args.value)*50/61;$("#total_alkalinity").val(b.total_alkalinity)});$("#popupWindow").jqxWindow({width:1050,height:550,resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#Cancel"),modalOpacity:0.4});$("#popupWindow").on("open",function(){$("#name").jqxInput("selectAll")});$("#Delete").jqxButton({template:"danger",width:"90px",theme:theme});$("#Delete").click(function(){if(c>=0){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var f=$("#jqxgrid").jqxGrid("getrowid",c);$("#jqxgrid").jqxGrid("deleterow",f)})}$("#popupWindow").jqxWindow("hide")});$("#Cancel").jqxButton({template:"primary",width:"90px",theme:theme});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g,f=-1;if(c>=0){f=$("#jqxgrid").jqxGrid("getrowid",c)}g={record:f,name:$("#name").val(),calcium:parseFloat($("#calcium").jqxNumberInput("decimal")),bicarbonate:parseFloat($("#bicarbonate").jqxNumberInput("decimal")),sulfate:parseFloat($("#sulfate").jqxNumberInput("decimal")),chloride:parseFloat($("#chloride").jqxNumberInput("decimal")),sodium:parseFloat($("#sodium").jqxNumberInput("decimal")),magnesium:parseFloat($("#magnesium").jqxNumberInput("decimal")),ph:parseFloat($("#ph").jqxNumberInput("decimal")),notes:$("#notes").val(),total_alkalinity:parseFloat($("#total_alkalinity").jqxNumberInput("decimal"))};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",f,g)}else{$("#jqxgrid").jqxGrid("addrow",null,g)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- a/www/js/profile_water.js	Fri Oct 18 13:09:37 2019 +0200
+++ b/www/js/profile_water.js	Fri Oct 18 16:21:54 2019 +0200
@@ -22,258 +22,260 @@
 
 
 function createDelElements() {
-	$('#eventWindow').jqxWindow({
-		theme: theme,
-		position: { x: 490, y: 210 },
-		width: 300,
-		height: 175,
-		resizable: false,
-		isModal: true,
-		modalOpacity: 0.4,
-		okButton: $('#delOk'),
-		cancelButton: $('#delCancel'),
-		initContent: function () {
-			$('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
-			$('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
-			$('#delCancel').focus();
-		}
-	});
-	$('#eventWindow').jqxWindow('hide');
+ $('#eventWindow').jqxWindow({
+  theme: theme,
+  position: { x: 490, y: 210 },
+  width: 300,
+  height: 175,
+  resizable: false,
+  isModal: true,
+  modalOpacity: 0.4,
+  okButton: $('#delOk'),
+  cancelButton: $('#delCancel'),
+  initContent: function() {
+   $('#delOk').jqxButton({ template: 'danger', width: '65px', theme: theme });
+   $('#delCancel').jqxButton({ template: 'success', width: '65px', theme: theme });
+   $('#delCancel').focus();
+  }
+ });
+ $('#eventWindow').jqxWindow('hide');
 }
 
 
-$(document).ready(function () {
-
-	// tooltips
-	$("#name").jqxTooltip({ content: 'De unieke naam van dit water profiel.' });
-	$("#notes").jqxTooltip({ content: 'Extra opmerkingen over dit water.' });
-	$("#calcium").jqxTooltip({ content: 'Calcium (Ca).' });
-	$("#bicarbonate").jqxTooltip({ content: 'Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit.' });
-	$("#sulfate").jqxTooltip({ content: 'Calcium Sulfaat (CaSO4).' });
-	$("#chloride").jqxTooltip({ content: 'Chloride (Cl).' });
-	$("#sodium").jqxTooltip({ content: 'Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium.' });
-	$("#magnesium").jqxTooltip({ content: 'Magnesium (Mg).' });
-	$("#ph").jqxTooltip({ content: 'De zuurgraad (pH).' });
-	$("#total_alkalinity").jqxTooltip({ content: 'Totale alkaliniteit. Berekend meteen de Bicarbonaat.' });
+$(document).ready(function() {
 
-	var dataRecord = {},
-        url = 'includes/db_profile_water.php',
-	source = {
-		datatype: "json",
-		cache: false,
-		datafields: [
-			{ name: 'record', type: 'number' },
-			{ name: 'name', type: 'string' },
-			{ name: 'calcium', type: 'float' },
-			{ name: 'bicarbonate', type: 'float' },
-			{ name: 'sulfate', type: 'float' },
-			{ name: 'chloride', type: 'float' },
-			{ name: 'sodium', type: 'float' },
-			{ name: 'magnesium', type: 'float' },
-			{ name: 'ph', type: 'float' },
-			{ name: 'notes', type: 'string' },
-			{ name: 'total_alkalinity', type: 'float' }
-		],
-		id: 'record',
-		url: url,
-		deleterow: function (rowid, commit) {
-			// synchronize with the server - send delete command
-			var data = "delete=true&" + $.param({ record: rowid });
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function (jqXHR, textStatus, errorThrown) {
-					commit(false);
-				}
-			});
-		},
-		addrow: function (rowid, rowdata, position, commit) {
-			var data = "insert=true&" + $.param(rowdata);
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function(jqXHR, textStatus, errorThrown) {
-                                        commit(false);
-                                }
-                        });
-                },
-		updaterow: function (rowid, rowdata, commit) {
-			var data = "update=true&" + $.param(rowdata);
-			$.ajax({
-				dataType: 'json',
-				url: url,
-				cache: false,
-				data: data,
-				type: "POST",
-				success: function (data, status, xhr) {
-					commit(true);
-					location.reload( true );
-				},
-				error: function(jqXHR, textStatus, errorThrown) {
-					commit(false);
-				}
-			});
-		}
-	},
-	dataAdapter = new $.jqx.dataAdapter(source),
-        editrow = -1;
+ var dataRecord = {},
+ url = 'includes/db_profile_water.php',
+ source = {
+  datatype: 'json',
+  cache: false,
+  datafields: [
+   { name: 'record', type: 'number' },
+   { name: 'name', type: 'string' },
+   { name: 'calcium', type: 'float' },
+   { name: 'bicarbonate', type: 'float' },
+   { name: 'sulfate', type: 'float' },
+   { name: 'chloride', type: 'float' },
+   { name: 'sodium', type: 'float' },
+   { name: 'magnesium', type: 'float' },
+   { name: 'ph', type: 'float' },
+   { name: 'notes', type: 'string' },
+   { name: 'total_alkalinity', type: 'float' }
+  ],
+  id: 'record',
+  url: url,
+  deleterow: function(rowid, commit) {
+   // synchronize with the server - send delete command
+   var data = 'delete=true&' + $.param({ record: rowid });
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  },
+  addrow: function(rowid, rowdata, position, commit) {
+   var data = 'insert=true&' + $.param(rowdata);
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  },
+  updaterow: function(rowid, rowdata, commit) {
+   var data = 'update=true&' + $.param(rowdata);
+   $.ajax({
+    dataType: 'json',
+    url: url,
+    cache: false,
+    data: data,
+    type: 'POST',
+    success: function(data, status, xhr) {
+     commit(true);
+     location.reload(true);
+    },
+    error: function(jqXHR, textStatus, errorThrown) {
+     commit(false);
+    }
+   });
+  }
+ },
+ dataAdapter = new $.jqx.dataAdapter(source),
+ editrow = -1;
 
-	// initialize the input fields.
-	$("#name").jqxInput({ theme: theme, width: 640, height: 23 });
-	$("#notes").jqxInput({ theme: theme, width: 800, height: 100 });
-	$("#calcium").jqxNumberInput( Spin1dec );
-	$("#bicarbonate").jqxNumberInput( Spin1dec );
-	$("#sulfate").jqxNumberInput( Spin1dec );
-	$("#chloride").jqxNumberInput( Spin1dec );
-	$("#sodium").jqxNumberInput( Spin1dec );
-	$("#magnesium").jqxNumberInput( Spin1dec );
-	$("#ph").jqxNumberInput( Spin2pH );
-	$("#total_alkalinity").jqxNumberInput( Spin1dec );
+ // tooltips
+ $('#name').jqxTooltip({ content: 'De unieke naam van dit water profiel.' });
+ $('#notes').jqxTooltip({ content: 'Extra opmerkingen over dit water.' });
+ $('#calcium').jqxTooltip({ content: 'Calcium (Ca).' });
+ $('#bicarbonate').jqxTooltip({ content: 'Bicarbonaat (HCO3). Berekend meteen de Totale alkaliteit.' });
+ $('#sulfate').jqxTooltip({ content: 'Calcium Sulfaat (CaSO4).' });
+ $('#chloride').jqxTooltip({ content: 'Chloride (Cl).' });
+ $('#sodium').jqxTooltip({ content: 'Natrium, oftewel keukenzout (Na). In berekeningen ook vaak als Sodium.' });
+ $('#magnesium').jqxTooltip({ content: 'Magnesium (Mg).' });
+ $('#ph').jqxTooltip({ content: 'De zuurgraad (pH).' });
+ $('#total_alkalinity').jqxTooltip({ content: 'Totale alkaliniteit. Berekend meteen de Bicarbonaat.' });
+
+ // initialize the input fields.
+ $('#name').jqxInput({ theme: theme, width: 640, height: 23 });
+ $('#notes').jqxInput({ theme: theme, width: 800, height: 100 });
+ $('#calcium').jqxNumberInput(Spin1dec);
+ $('#bicarbonate').jqxNumberInput(Spin1dec);
+ $('#sulfate').jqxNumberInput(Spin1dec);
+ $('#chloride').jqxNumberInput(Spin1dec);
+ $('#sodium').jqxNumberInput(Spin1dec);
+ $('#magnesium').jqxNumberInput(Spin1dec);
+ $('#ph').jqxNumberInput(Spin2pH);
+ $('#total_alkalinity').jqxNumberInput(Spin1dec);
 
-	// initialize jqxGrid
-	$("#jqxgrid").jqxGrid({
-		width: 1280,
-		height: 630,
-		source: dataAdapter,
-		theme: theme,
-		showstatusbar: true,
-		renderstatusbar: function (statusbar) {
-			var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"),
-			addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>");
-			container.append(addButton);
-			statusbar.append(container);
-			addButton.jqxButton({ theme: theme, width: 90, height: 20 });
-			// add new row.
-			addButton.click(function (event) {
-				editrow = -1;
-				$("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
-				$("#name").val('');
-				$("#calcium").val(0);
-				$("#bicarbonate").val(0);
-				$("#sulfate").val(0);
-				$("#chloride").val(0);
-				$("#sodium").val(0);
-				$("#magnesium").val(0);
-				$("#ph").val(7);
-				$("#notes").val('');
-				$("#total_alkalinity").val(0);
-				$("#popupWindow").jqxWindow('open');
-			});
-		},
-		filterable: false,
-		filtermode: 'excel',
-		columns: [
-			{ text: 'Water Profiel', datafield: 'name', width: 225 },
-			{ text: 'Opmerkingen', datafield: 'notes' },
-			{ text: 'Ca', datafield: 'calcium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'Mg', datafield: 'magnesium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'Na', datafield: 'sodium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'CaCO3', datafield: 'total_alkalinity', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'Cl', datafield: 'chloride', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'SO4', datafield: 'sulfate', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: 'pH', datafield: 'ph', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-			{ text: '', datafield: 'Edit', width: 100, columntype: 'button', cellsrenderer: function () {
-				return "Wijzig";
-				}, buttonclick: function (row) {
-					// open the popup window when the user clicks a button.
-					editrow = row;
-					$("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
-					// get the clicked row's data and initialize the input fields.
-					dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
-					$("#name").val(dataRecord.name);
-					$("#calcium").val(dataRecord.calcium);
-					$("#bicarbonate").val(dataRecord.bicarbonate);
-					$("#sulfate").val(dataRecord.sulfate);
-					$("#chloride").val(dataRecord.chloride);
-					$("#sodium").val(dataRecord.sodium);
-					$("#magnesium").val(dataRecord.magnesium);
-					$("#ph").val(dataRecord.ph);
-					$("#notes").val(dataRecord.notes);
-					$("#total_alkalinity").val(dataRecord.total_alkalinity);
-					// show the popup window.
-					$("#popupWindow").jqxWindow('open');
-				}
-			}
-		]
-	});
+ // initialize jqxGrid
+ $('#jqxgrid').jqxGrid({
+  width: 1280,
+  height: 630,
+  source: dataAdapter,
+  theme: theme,
+  showstatusbar: true,
+  renderstatusbar: function(statusbar) {
+   var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'),
+   addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' +
+     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>');
+   container.append(addButton);
+   statusbar.append(container);
+   addButton.jqxButton({ theme: theme, width: 90, height: 20 });
+   // add new row.
+   addButton.click(function(event) {
+    editrow = -1;
+    $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
+    $('#name').val('');
+    $('#calcium').val(0);
+    $('#bicarbonate').val(0);
+    $('#sulfate').val(0);
+    $('#chloride').val(0);
+    $('#sodium').val(0);
+    $('#magnesium').val(0);
+    $('#ph').val(7);
+    $('#notes').val('');
+    $('#total_alkalinity').val(0);
+    $('#popupWindow').jqxWindow('open');
+   });
+  },
+  filterable: false,
+  filtermode: 'excel',
+  columns: [
+   { text: 'Water Profiel', datafield: 'name', width: 225 },
+   { text: 'Opmerkingen', datafield: 'notes' },
+   { text: 'Ca', datafield: 'calcium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'Mg', datafield: 'magnesium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'Na', datafield: 'sodium', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'CaCO3', datafield: 'total_alkalinity', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'Cl', datafield: 'chloride', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'SO4', datafield: 'sulfate', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: 'pH', datafield: 'ph', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
+   { text: '', datafield: 'Edit', width: 100, columntype: 'button',
+    cellsrenderer: function() {
+     return 'Wijzig';
+    }, buttonclick: function(row) {
+     // open the popup window when the user clicks a button.
+     editrow = row;
+     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
+     // get the clicked row's data and initialize the input fields.
+     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
+     $('#name').val(dataRecord.name);
+     $('#calcium').val(dataRecord.calcium);
+     $('#bicarbonate').val(dataRecord.bicarbonate);
+     $('#sulfate').val(dataRecord.sulfate);
+     $('#chloride').val(dataRecord.chloride);
+     $('#sodium').val(dataRecord.sodium);
+     $('#magnesium').val(dataRecord.magnesium);
+     $('#ph').val(dataRecord.ph);
+     $('#notes').val(dataRecord.notes);
+     $('#total_alkalinity').val(dataRecord.total_alkalinity);
+     // show the popup window.
+     $('#popupWindow').jqxWindow('open');
+    }
+   }
+  ]
+ });
 
-	$("#total_alkalinity").on('change', function (event) {
-		dataRecord.bicarbonate = parseFloat(event.args.value) * 1.22;
-		$("#bicarbonate").val(dataRecord.bicarbonate);
-	});
-	$("#bicarbonate").on('change', function (event) {
-		dataRecord.total_alkalinity = parseFloat(event.args.value) * 50 / 61;
-		$("#total_alkalinity").val(dataRecord.total_alkalinity);
-	});
+ $('#total_alkalinity').on('change', function(event) {
+  dataRecord.bicarbonate = parseFloat(event.args.value) * 1.22;
+  $('#bicarbonate').val(dataRecord.bicarbonate);
+ });
+ $('#bicarbonate').on('change', function(event) {
+  dataRecord.total_alkalinity = parseFloat(event.args.value) * 50 / 61;
+  $('#total_alkalinity').val(dataRecord.total_alkalinity);
+ });
 
-	// initialize the popup window and buttons.
-	$("#popupWindow").jqxWindow({
-		width: 1050,
-		height: 550,
-		resizable: false,
-		theme: theme,
-		isModal: true,
-		autoOpen: false,
-		cancelButton: $("#Cancel"),
-		modalOpacity: 0.40
-	});
-	$("#popupWindow").on('open', function () {
-		$("#name").jqxInput('selectAll');
-	});
-	$("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme });
-	$("#Delete").click(function () {
-		if (editrow >= 0) {
-			// Open a popup to confirm this action.
-			$('#eventWindow').jqxWindow('open');
-			$("#delOk").click(function () {
-				var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-				$("#jqxgrid").jqxGrid('deleterow', rowID);
-			});
-		}
-		$("#popupWindow").jqxWindow('hide');
-	});
-	$("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme });
-	$("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
-	// update the edited row when the user clicks the 'Save' button.
-	$("#Save").click(function () {
-		var row, rowID = -1;
-		if (editrow >= 0) {
-			rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
-		}
-		row = {
-			record: rowID,
-			name: $("#name").val(),
-			calcium: parseFloat($("#calcium").jqxNumberInput('decimal')),
-			bicarbonate: parseFloat($("#bicarbonate").jqxNumberInput('decimal')),
-			sulfate: parseFloat($("#sulfate").jqxNumberInput('decimal')),
-			chloride: parseFloat($("#chloride").jqxNumberInput('decimal')),
-			sodium: parseFloat($("#sodium").jqxNumberInput('decimal')),
-			magnesium: parseFloat($("#magnesium").jqxNumberInput('decimal')),
-			ph: parseFloat($("#ph").jqxNumberInput('decimal')),
-			notes: $("#notes").val(),
-			total_alkalinity: parseFloat($("#total_alkalinity").jqxNumberInput('decimal'))
-		};
-		if (editrow >= 0) {
-			$('#jqxgrid').jqxGrid('updaterow', rowID, row);
-		} else {
-			$('#jqxgrid').jqxGrid('addrow', null, row);
-		}
-		$("#popupWindow").jqxWindow('hide');
-	});
-	createDelElements();
+ // initialize the popup window and buttons.
+ $('#popupWindow').jqxWindow({
+  width: 1050,
+  height: 550,
+  resizable: false,
+  theme: theme,
+  isModal: true,
+  autoOpen: false,
+  cancelButton: $('#Cancel'),
+  modalOpacity: 0.40
+ });
+ $('#popupWindow').on('open', function() {
+  $('#name').jqxInput('selectAll');
+ });
+ $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme });
+ $('#Delete').click(function() {
+  if (editrow >= 0) {
+   // Open a popup to confirm this action.
+   $('#eventWindow').jqxWindow('open');
+   $('#delOk').click(function() {
+    var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
+    $('#jqxgrid').jqxGrid('deleterow', rowID);
+   });
+  }
+  $('#popupWindow').jqxWindow('hide');
+ });
+ $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
+ $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
+ // update the edited row when the user clicks the 'Save' button.
+ $('#Save').click(function() {
+  var row, rowID = -1;
+  if (editrow >= 0) {
+   rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
+  }
+  row = {
+   record: rowID,
+   name: $('#name').val(),
+   calcium: parseFloat($('#calcium').jqxNumberInput('decimal')),
+   bicarbonate: parseFloat($('#bicarbonate').jqxNumberInput('decimal')),
+   sulfate: parseFloat($('#sulfate').jqxNumberInput('decimal')),
+   chloride: parseFloat($('#chloride').jqxNumberInput('decimal')),
+   sodium: parseFloat($('#sodium').jqxNumberInput('decimal')),
+   magnesium: parseFloat($('#magnesium').jqxNumberInput('decimal')),
+   ph: parseFloat($('#ph').jqxNumberInput('decimal')),
+   notes: $('#notes').val(),
+   total_alkalinity: parseFloat($('#total_alkalinity').jqxNumberInput('decimal'))
+  };
+  if (editrow >= 0) {
+   $('#jqxgrid').jqxGrid('updaterow', rowID, row);
+  } else {
+   $('#jqxgrid').jqxGrid('addrow', null, row);
+  }
+  $('#popupWindow').jqxWindow('hide');
+ });
+ createDelElements();
 });
 
--- a/www/js/rec_edit-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-var psugar=0,pcara=0,svg=77,mashkg=0,mash_infuse=0,dataRecord={},hop_flavour=0,hop_aroma=0,preboil_sg=0,last_base="",last_acid="",Ka1=4.445e-7,Ka2=4.68e-11,MMCa=40.048,MMMg=24.305,MMNa=22.98976928,MMCl=35.453,MMSO4=96.0626,MMCO3=60.01684,MMHCO3=61.01684,MMCaSO4=172.171,MMCaCl2=147.015,MMCaCO3=100.087,MMMgSO4=246.475,MMNaHCO3=84.007,MMNa2CO3=105.996,MMNaCl=58.443,MMCaOH2=74.06268;function createDelElements(){$("#eventWindow").jqxWindow({theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$("#delOk"),cancelButton:$("#delCancel"),initContent:function(){$("#delOk").jqxButton({template:"danger",width:"65px",theme:theme});$("#delCancel").jqxButton({template:"success",width:"65px",theme:theme});$("#delCancel").focus()}});$("#eventWindow").jqxWindow("hide")}function hopFlavourContribution(c,e,b,d){var a;if(b==1){a=0.15}else{if(c>50){a=0.1}else{a=15.25/(6*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((c-21)/6,2));if(a<0.1){a=0.1}}}return(a*d*1000)/e}function hopAromaContribution(c,e,b,d){var a=0;if(b==5){a=1.33}else{if(c>20){a=0}else{if(c>7.5){a=10.03/(4*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((c-7.5)/4,2))}else{if(b==2){a=1}else{if(b==3){a=1.2}else{if(b==4){a=1.2}}}}}}return(a*d*1000)/e}function setReadonly(c){var d=!c,a=110,b=80;if(c){a=90;b=60}$("#batch_size").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#boil_size").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#boil_time").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#efficiency").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#est_og").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#type").jqxDropDownList({disabled:c});$("#styleSelect").jqxDropDownList({disabled:c});$("#color_method").jqxDropDownList({disabled:c});$("#ibu_method").jqxDropDownList({disabled:c});$("#Delete").jqxButton({disabled:c});$("#fermentableGrid").jqxGrid({editable:d});$("#faddrowbutton").jqxDropDownList({disabled:c});$("#finstockbutton").jqxCheckBox({disabled:c});$("#fdeleterowbutton").jqxButton({disabled:c});$("#hopGrid").jqxGrid({editable:d});$("#haddrowbutton").jqxDropDownList({disabled:c});$("#hinstockbutton").jqxCheckBox({disabled:c});$("#hdeleterowbutton").jqxButton({disabled:c});$("#miscGrid").jqxGrid({editable:d});$("#maddrowbutton").jqxDropDownList({disabled:c});$("#minstockbutton").jqxCheckBox({disabled:c});$("#mdeleterowbutton").jqxButton({disabled:c});$("#yeastGrid").jqxGrid({editable:d});$("#yaddrowbutton").jqxDropDownList({disabled:c});$("#yinstockbutton").jqxCheckBox({disabled:c});$("#ydeleterowbutton").jqxButton({disabled:c});$("#mashGrid").jqxGrid({editable:d});$("#saddrowbutton").jqxButton({disabled:c});$("#sdeleterowbutton").jqxButton({disabled:c});$("#w1_name").jqxDropDownList({disabled:c});$("#w2_name").jqxDropDownList({disabled:c});$("#pr_name").jqxDropDownList({disabled:c});$("#wa_cacl2").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#wa_caso4").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#wa_mgso4").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#wa_nacl").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#mash_ph").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#calc_acid").jqxCheckBox({disabled:c});$("#wa_base_name").jqxDropDownList({disabled:c});$("#wa_base").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#wa_acid_name").jqxDropDownList({disabled:c});$("#wa_acid").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#wa_acid_perc").jqxNumberInput({spinButtons:d,readOnly:c,width:b});$("#sparge_temp").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#sparge_volume").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#sparge_ph").jqxNumberInput({spinButtons:d,readOnly:c,width:a});$("#sparge_source").jqxDropDownList({disabled:c});$("#sparge_acid_type").jqxDropDownList({disabled:c});$("#sparge_acid_perc").jqxNumberInput({spinButtons:d,readOnly:c,width:a})}function calcPercentages(){console.log("calcPercentages()");var b,e,a,c,d=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(d>1){b=0;for(c=0;c<d;c++){e=$("#fermentableGrid").jqxGrid("getrowdata",c);if(e.f_added<4){b+=Round(e.f_amount,3)}}b=Round(b,3);for(c=0;c<d;c++){e=$("#fermentableGrid").jqxGrid("getrowdata",c);if(e.f_added<4){a=Round(e.f_amount/b*100,1);$("#fermentableGrid").jqxGrid("setcellvalue",c,"f_percentage",a)}else{$("#fermentableGrid").jqxGrid("setcellvalue",c,"f_percentage",0)}}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}}function calcFermentables(){console.log("calcFermentables()");var g,o,p,n,q=0,k,l,m,c,f,e,j,b,h=0,a=0;vol=0,addedS=0,addedmass=0,mvol=0,colort=0,colorh=0,colorn=0,my_100=false,mashtime=0,mashtemp=0,bv=0.925,sr=0.95,lintner=0;psugar=0;pcara=0;mashkg=0;if((p=$("#mashGrid").jqxGrid("getrows"))){for(g=0;g<p.length;g++){o=p[g];if(o.step_type==0){mvol+=parseFloat(o.step_infuse_amount)}if(o.step_temp<=75){mashtime+=o.step_time;mashtemp+=o.step_time*o.step_temp}}mashtemp=mashtemp/mashtime}if(!(p=$("#fermentableGrid").jqxGrid("getrows"))){return}for(g=0;g<p.length;g++){o=p[g];if(o.f_adjust_to_total_100){my_100=true}if(o.f_type==1&&o.f_added<4){psugar+=o.f_percentage}if(o.f_graintype==2&&o.f_added<4){pcara+=o.f_percentage}k=o.f_amount*(o.f_yield/100)*(1-o.f_moisture/100);if(o.f_added==0){if(mvol>0){mvol+=o.f_amount*o.f_moisture/100;q+=k}k=parseFloat(dataRecord.efficiency)/100*k;a+=k;mashkg+=o.f_amount}if(o.f_added==0||o.f_added==1){h+=k}if(o.f_added==2||o.f_added==3){l=(o.f_yield/100)*(1-o.f_moisture/100);addedS+=o.f_amount*l;addedmass+=o.f_amount;vol+=(l*sugardensity+(1-l)*1)*o.f_amount}if(o.f_added==0&&(o.f_type==0||o.f_type==4)&&o.f_color<50){lintner+=o.f_diastatic_power*o.f_amount}if(o.f_added<4){colort+=o.f_amount*ebc_to_srm(o.f_color);colorh+=o.f_amount*o.f_color*get_kt(o.f_color);colorn+=(o.f_percentage/100)*o.f_color}}$("#ferm_lintner").val(Math.round(parseFloat(lintner/mashkg)));to_100=my_100;if(to_100){$("#wf_amount").jqxNumberInput({width:90,readOnly:true,spinButtons:false})}else{$("#wf_amount").jqxNumberInput({width:110,readOnly:false,spinButtons:true})}dataRecord.est_og=estimate_sg(h+addedS,parseFloat(dataRecord.batch_size));$("#est_og").val(dataRecord.est_og);$("#est_og2").val(dataRecord.est_og);n=dataRecord.est_og;preboil_sg=estimate_sg(a,parseFloat(dataRecord.boil_size));if(dataRecord.color_method==4){e=Math.round(((sg_to_plato(dataRecord.est_og)/8.6)*colorn)+(dataRecord.boil_time/60))}else{if(dataRecord.color_method==3){e=Math.round((4.46*bv*sr)/parseFloat(dataRecord.batch_size)*colorh)}else{f=colort/parseFloat(dataRecord.batch_size)*8.34436;e=kw_to_ebc(dataRecord.color_method,f)}}dataRecord.est_color=e;$("#est_color").val(e);$("#est_color2").val(e);j=ebc_to_color(e);document.getElementById("bcolor").style.background=j;document.getElementById("bcolor2").style.background=j;pmalts=mashkg/(dataRecord.boil_size/3)*100;$("#perc_malts").jqxProgressBar("val",pmalts);$("#perc_sugars").jqxProgressBar("val",psugar);$("#perc_cara").jqxProgressBar("val",pcara);svg=0;p=$("#yeastGrid").jqxGrid("getrows");for(g=0;g<p.length;g++){o=p[g];if(o.y_use==0){if(parseFloat(o.y_attenuation)>svg){svg=parseFloat(o.y_attenuation)}}}if(svg==0){svg=77}if((mashkg>0)&&(mash_infuse>0)&&(mashtime>0)&&(mashtemp>0)){dataRecord.est_fg=estimate_fg(psugar,pcara,mash_infuse/mashkg,mashtime,mashtemp,svg,dataRecord.est_og)}else{dataRecord.est_fg=estimate_fg(psugar,pcara,0,0,0,svg,dataRecord.est_og)}$("#est_fg").val(dataRecord.est_fg);$("#est_fg2").val(dataRecord.est_fg);b=dataRecord.est_fg;dataRecord.est_abv=abvol(dataRecord.est_og,dataRecord.est_fg);$("#est_abv").val(dataRecord.est_abv);$("#est_abv2").val(dataRecord.est_abv);c=1881.22*b*(n-b)/(1.775-n);m=3550*b*(0.1808*n+0.8192*b-1.0004);$("#kcal").val(Math.round((c+m)/(12*0.0295735296)))}function calcMash(){var a=0,b,d,c;if(!(c=$("#mashGrid").jqxGrid("getrows"))){return}if(mashkg==0){return}for(b=0;b<c.length;b++){d=$("#mashGrid").jqxGrid("getrowdata",b);if(d.step_type==0){a+=d.step_infuse_amount}$("#mashGrid").jqxGrid("setcellvalue",b,"step_thickness",a/mashkg)}}function calcIBUs(){var a=0,c={},b,d;hop_aroma=hop_flavour=0;if(!(c=$("#hopGrid").jqxGrid("getrows"))){return}for(b=0;b<c.length;b++){d=c[b];a+=toIBU(d.h_useat,d.h_form,preboil_sg,parseFloat(dataRecord.batch_size),parseFloat(d.h_amount),parseFloat(d.h_time),parseFloat(d.h_alpha),dataRecord.ibu_method);hop_flavour+=hopFlavourContribution(parseFloat(d.h_time),parseFloat(dataRecord.batch_size),d.h_useat,parseFloat(d.h_amount));hop_aroma+=hopAromaContribution(parseFloat(d.h_time),parseFloat(dataRecord.batch_size),d.h_useat,parseFloat(d.h_amount))}a=Round(a,1);hop_flavour=Round(hop_flavour*100/5,1);hop_aroma=Round(hop_aroma*100/6,1);if(hop_flavour>100){hop_flavour=100}if(hop_aroma>100){hop_aroma=100}console.log("calcIBUs(): "+a+"  flavour: "+hop_flavour+"  aroma: "+hop_aroma);dataRecord.est_ibu=a;$("#est_ibu").val(a);$("#est_ibu2").val(a);$("#hop_flavour").jqxProgressBar("val",hop_flavour);$("#hop_aroma").jqxProgressBar("val",hop_aroma)}function adjustHops(c){var b,d,a,e=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(e==0){return}for(b=0;b<e;b++){d=$("#hopGrid").jqxGrid("getrowdata",b);a=d.h_amount*c;$("#hopGrid").jqxGrid("setcellvalue",b,"h_amount",a)}}function adjustMiscs(c){var b,d,a,e=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(e==0){return}for(b=0;b<e;b++){d=$("#miscGrid").jqxGrid("getrowdata",b);a=d.m_amount*c;$("#miscGrid").jqxGrid("setcellvalue",b,"m_amount",a);switch(d.m_name){case"CaCl2":$("#wa_cacl2").val(d.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(d.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(d.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(d.m_amount*1000);break;case"Melkzuur":case"Zoutzuur":case"Fosforzuur":case"Zwavelzuur":$("#wa_acid").val(d.m_amount*1000);break;case"NaHCO3":case"Na2CO3":case"CaCO3":case"Ca(OH)2":$("#wa_base").val(d.m_amount*1000);break}}}function adjustYeasts(c){var b,d,a,e=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(e==0){return}for(b=0;b<e;b++){d=$("#yeastGrid").jqxGrid("getrowdata",b);if(d.y_form==1){a=d.y_amount*c;$("#yeastGrid").jqxGrid("setcellvalue",b,"y_amount",a)}}}function adjustWaters(c){var b,d,a,e=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(e==0){return}mash_infuse=0;for(b=0;b<e;b++){d=$("#mashGrid").jqxGrid("getrowdata",b);if(d.step_type==0){a=Round(d.step_infuse_amount*c,1);$("#mashGrid").jqxGrid("setcellvalue",b,"step_infuse_amount",a);mash_infuse+=a}}if(dataRecord.w2_amount==0){dataRecord.w1_amount=mash_infuse;$("#w1_amount").val(mash_infuse)}else{dataRecord.w1_amount=(dataRecord.w1_amount/(dataRecord.w1_amount+dataRecord.w2_amount))*mash_infuse;dataRecord.w2_amount=(dataRecord.w2_amount/(dataRecord.w1_amount+dataRecord.w2_amount))*mash_infuse;$("#w1_amount").val(dataRecord.w1_amount);$("#w2_amount").val(dataRecord.w2_amount)}$("#wg_amount").val(mash_infuse)}function GetBUGU(){var a=(dataRecord.est_og-1)*1000;if(a>0){return dataRecord.est_ibu/a}else{return 0.5}}function GetOptClSO4ratio(){var a=GetBUGU();return(-1.2*a+1.4)}function setRangeIndicator(b,a){if((a=="laag")||(a=="hoog")){$("#wr_"+b).html('<img src="images/dialog-error.png"><span style="vertical-align: top; font-size: 10px; font-style: italic;">'+a+"</span>")}else{$("#wr_"+b).html('<img src="images/dialog-ok-apply.png">')}}function mix(d,c,b,a){if((d+c)>0){return((d*b)+(c*a))/(d+c)}return 0}function ResidualAlkalinity(c,b,a){return c-(b/1.4+a/1.7)}function PartCO3(b){var a=Math.pow(10,-b);return 100*Ka1*Ka2/(a*a+a*Ka1+Ka1*Ka2)}function PartHCO3(b){var a=Math.pow(10,-b);return 100*Ka1*a/(a*a+a*Ka1+Ka1*Ka2)}function Charge(a){return(-2*PartCO3(a)-PartHCO3(a))}function ZAlkalinity(b){var e=Charge(4.3),c=Charge(parseFloat($("#wg_ph").jqxNumberInput("decimal"))),a=Charge(b),g=-e+c,f=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))/50/g,d=-a+c;return f*d}function ZRA(b){var a=parseFloat($("#wg_calcium").jqxNumberInput("decimal"))/(MMCa/2),c=parseFloat($("#wg_magnesium").jqxNumberInput("decimal"))/(MMMg/2),d=ZAlkalinity(b);return d-(a/3.5+c/7)}function ProtonDeficit(b){var a,e,c,d,f,g=ZRA(b)*parseFloat($("#wg_amount").jqxNumberInput("decimal"));d=$("#fermentableGrid").jqxGrid("getrows");for(c=0;c<d.length;c++){f=d[c];if(f.f_added==0&&f.f_graintype!=6){e=0;if((f.f_di_ph!=5.7)&&((f.f_acid_to_ph_57<-0.1)||(f.f_acid_to_ph_57>0.1))){e=f.f_acid_to_ph_57/(f.f_di_ph-5.7)}else{a=f.f_color;switch(f.f_graintype){case 0:case 3:case 5:e=0.014*a-34.192;break;case 2:e=-0.0597*a-32.457;break;case 1:e=0.0107*a-54.768;break;case 4:e=-149;break}}x=e*(b-f.f_di_ph);g+=x*f.f_amount}}return g}function MashpH(){var e=0,c=5.4,b=0.001,d=0.1,a=ProtonDeficit(c);while(((a<-d)||(a>d))&&(e<2000)){e++;if(a<-d){c-=b}else{if(a>d){c+=b}}a=ProtonDeficit(c)}return c}function GetAcidSpecs(a){switch(a){case 0:return{pK1:3.86,pK2:20,pK3:20,MolWt:90.08,AcidSG:1214,AcidPrc:0.88};case 1:return{pK1:-7,pK2:20,pK3:20,MolWt:36.46,AcidSG:1142,AcidPrc:0.28};case 2:return{pK1:2.12,pK2:7.2,pK3:12.44,MolWt:98,AcidSG:1170,AcidPrc:0.25};case 3:return{pK1:-1,pK2:1.92,pK3:20,MolWt:98.07,AcidSG:1700,AcidPrc:0.93}}}$(document).ready(function(){var h=false,u=0,e={},o=0,t={},q=0,p={},c=0,g={},l=0,r={},f="includes/db_recipes.php",s={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"uuid",type:"string"},{name:"locked",type:"int"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"st_type",type:"int"},{name:"st_category",type:"string"},{name:"st_category_number",type:"float"},{name:"st_og_min",type:"float"},{name:"st_og_max",type:"float"},{name:"st_fg_min",type:"float"},{name:"st_fg_max",type:"float"},{name:"st_ibu_min",type:"float"},{name:"st_ibu_max",type:"float"},{name:"st_color_min",type:"float"},{name:"st_color_max",type:"float"},{name:"st_carb_min",type:"float"},{name:"st_carb_max",type:"float"},{name:"st_abv_min",type:"float"},{name:"st_abv_max",type:"float"},{name:"name",type:"string"},{name:"notes",type:"string"},{name:"type",type:"int"},{name:"batch_size",type:"float"},{name:"boil_size",type:"float"},{name:"boil_time",type:"float"},{name:"efficiency",type:"float"},{name:"est_og",type:"float"},{name:"est_fg",type:"float"},{name:"est_abv",type:"float"},{name:"est_color",type:"float"},{name:"color_method",type:"int"},{name:"est_ibu",type:"float"},{name:"ibu_method",type:"int"},{name:"est_carb",type:"float"},{name:"sparge_temp",type:"float"},{name:"sparge_ph",type:"float"},{name:"sparge_volume",type:"float"},{name:"sparge_source",type:"int"},{name:"sparge_acid_type",type:"int"},{name:"sparge_acid_perc",type:"float"},{name:"sparge_acid_amount",type:"float"},{name:"mash_ph",type:"float"},{name:"mash_name",type:"string"},{name:"calc_acid",type:"int"},{name:"w1_name",type:"string"},{name:"w1_amount",type:"float"},{name:"w1_calcium",type:"float"},{name:"w1_sulfate",type:"float"},{name:"w1_chloride",type:"float"},{name:"w1_sodium",type:"float"},{name:"w1_magnesium",type:"float"},{name:"w1_total_alkalinity",type:"float"},{name:"w1_ph",type:"float"},{name:"w1_cost",type:"float"},{name:"w2_name",type:"string"},{name:"w2_amount",type:"float"},{name:"w2_calcium",type:"float"},{name:"w2_sulfate",type:"float"},{name:"w2_chloride",type:"float"},{name:"w2_sodium",type:"float"},{name:"w2_magnesium",type:"float"},{name:"w2_total_alkalinity",type:"float"},{name:"w2_ph",type:"float"},{name:"w2_cost",type:"float"},{name:"wg_amount",type:"float"},{name:"wg_calcium",type:"float"},{name:"wg_sulfate",type:"float"},{name:"wg_chloride",type:"float"},{name:"wg_sodium",type:"float"},{name:"wg_magnesium",type:"float"},{name:"wg_total_alkalinity",type:"float"},{name:"wg_ph",type:"float"},{name:"wb_calcium",type:"float"},{name:"wb_sulfate",type:"float"},{name:"wb_chloride",type:"float"},{name:"wb_sodium",type:"float"},{name:"wb_magnesium",type:"float"},{name:"wb_total_alkalinity",type:"float"},{name:"wb_ph",type:"float"},{name:"wa_acid_name",type:"int"},{name:"wa_acid_perc",type:"int"},{name:"wa_base_name",type:"int"},{name:"fermentables",type:"array"},{name:"hops",type:"array"},{name:"miscs",type:"array"},{name:"yeasts",type:"array"},{name:"mashs",type:"array"}],id:"record",url:f+"?record="+my_record},y=new $.jqx.dataAdapter(s,{loadComplete:function(){var B=y.records;dataRecord=B[0];$("#name").val(dataRecord.name);$("#notes").val(dataRecord.notes);$("#locked").val(dataRecord.locked);$("#st_name").val(dataRecord.st_name);$("#st_letter").val(dataRecord.st_letter);$("#st_guide").val(dataRecord.st_guide);$("#st_category").val(dataRecord.st_category);$("#st_category_number").val(dataRecord.st_category_number);$("#st_type").val(StyleTypeData[dataRecord.st_type].nl);$("#type").val(dataRecord.type);$("#batch_size").val(dataRecord.batch_size);$("#boil_size").val(dataRecord.boil_size);$("#boil_time").val(dataRecord.boil_time);$("#efficiency").val(dataRecord.efficiency);$("#est_og").val(dataRecord.est_og);$("#est_og2").val(dataRecord.est_og);$("#st_og_min").val(dataRecord.st_og_min);$("#st_og_max").val(dataRecord.st_og_max);$("#est_fg").val(dataRecord.est_fg);$("#est_fg2").val(dataRecord.est_fg);$("#st_fg_min").val(dataRecord.st_fg_min);$("#st_fg_max").val(dataRecord.st_fg_max);$("#est_fg").val(dataRecord.est_fg);$("#est_fg2").val(dataRecord.est_fg);$("#st_fg_min").val(dataRecord.st_fg_min);$("#st_fg_max").val(dataRecord.st_fg_max);$("#est_color").val(dataRecord.est_color);$("#est_color2").val(dataRecord.est_color);$("#est_abv").val(dataRecord.est_abv);$("#est_abv2").val(dataRecord.est_abv);$("#st_abv_min").val(dataRecord.st_abv_min);$("#st_abv_max").val(dataRecord.st_abv_max);$("#st_color_min").val(dataRecord.st_color_min);$("#st_color_max").val(dataRecord.st_color_max);$("#color_method").val(dataRecord.color_method);$("#est_ibu").val(dataRecord.est_ibu);$("#est_ibu2").val(dataRecord.est_ibu);$("#st_ibu_min").val(dataRecord.st_ibu_min);$("#st_ibu_max").val(dataRecord.st_ibu_max);$("#ibu_method").val(dataRecord.ibu_method);$("#est_carb").val(dataRecord.est_carb);$("#st_carb_min").val(dataRecord.st_carb_min);$("#st_carb_max").val(dataRecord.st_carb_max);$("#mash_name").val(dataRecord.mash_name);$("#mash_ph").val(dataRecord.mash_ph);$("#sparge_temp").val(dataRecord.sparge_temp);$("#sparge_ph").val(dataRecord.sparge_ph);$("#sparge_volume").val(dataRecord.sparge_volume);$("#sparge_source").val(dataRecord.sparge_source);$("#sparge_acid_type").val(dataRecord.sparge_acid_type);$("#sparge_acid_perc").val(dataRecord.sparge_acid_perc);$("#sparge_acid_amount").val(dataRecord.sparge_acid_amount*1000);$("#calc_acid").val(dataRecord.calc_acid);$("#w1_name").val(dataRecord.w1_name);$("#w1_amount").val(dataRecord.w1_amount);$("#w1_calcium").val(dataRecord.w1_calcium);$("#w1_sulfate").val(dataRecord.w1_sulfate);$("#w1_chloride").val(dataRecord.w1_chloride);$("#w1_sodium").val(dataRecord.w1_sodium);$("#w1_magnesium").val(dataRecord.w1_magnesium);$("#w1_total_alkalinity").val(dataRecord.w1_total_alkalinity);$("#w1_ph").val(dataRecord.w1_ph);$("#w1_cost").val(dataRecord.w1_cost);$("#w2_name").val(dataRecord.w2_name);$("#w2_amount").val(dataRecord.w2_amount);$("#w2_calcium").val(dataRecord.w2_calcium);$("#w2_sulfate").val(dataRecord.w2_sulfate);$("#w2_chloride").val(dataRecord.w2_chloride);$("#w2_sodium").val(dataRecord.w2_sodium);$("#w2_magnesium").val(dataRecord.w2_magnesium);$("#w2_total_alkalinity").val(dataRecord.w2_total_alkalinity);$("#w2_ph").val(dataRecord.w2_ph);$("#w2_cost").val(dataRecord.w2_cost);$("#wg_amount").val(dataRecord.wg_amount);$("#wg_calcium").val(dataRecord.wg_calcium);$("#wg_sulfate").val(dataRecord.wg_sulfate);$("#wg_chloride").val(dataRecord.wg_chloride);$("#wg_sodium").val(dataRecord.wg_sodium);$("#wg_magnesium").val(dataRecord.wg_magnesium);$("#wg_total_alkalinity").val(dataRecord.wg_total_alkalinity);$("#wg_ph").val(dataRecord.wg_ph);$("#wb_calcium").val(dataRecord.wb_calcium);$("#wb_sulfate").val(dataRecord.wb_sulfate);$("#wb_chloride").val(dataRecord.wb_chloride);$("#wb_sodium").val(dataRecord.wb_sodium);$("#wb_magnesium").val(dataRecord.wb_magnesium);$("#wb_total_alkalinity").val(dataRecord.wb_total_alkalinity);$("#wb_ph").val(dataRecord.wb_ph);$("#wa_acid_name").val(dataRecord.wa_acid_name);$("#wa_acid_perc").val(dataRecord.wa_acid_perc);$("#wa_base_name").val(dataRecord.wa_base_name);j(dataRecord);A(dataRecord);b(dataRecord);w(dataRecord);n(dataRecord);$("#jqxTabs").jqxTabs("next")},loadError:function(D,B,C){},beforeLoadComplete:function(B){$("#jqxLoader").jqxLoader("open")}}),j=function(C){var B={localdata:C.fermentables,datatype:"local",cache:false,async:false,datafields:[{name:"f_name",type:"string"},{name:"f_origin",type:"string"},{name:"f_supplier",type:"string"},{name:"f_amount",type:"float"},{name:"f_cost",type:"float"},{name:"f_type",type:"int"},{name:"f_yield",type:"float"},{name:"f_color",type:"float"},{name:"f_coarse_fine_diff",type:"float"},{name:"f_moisture",type:"float"},{name:"f_diastatic_power",type:"float"},{name:"f_protein",type:"float"},{name:"f_max_in_batch",type:"float"},{name:"f_graintype",type:"int"},{name:"f_added",type:"int"},{name:"f_dissolved_protein",type:"float"},{name:"f_recommend_mash",type:"int"},{name:"f_add_after_boil",type:"int"},{name:"f_adjust_to_total_100",type:"int"},{name:"f_percentage",type:"float"},{name:"f_di_ph",type:"float"},{name:"f_acid_to_ph_57",type:"float"},{name:"f_inventory",type:"float"},{name:"f_avail",type:"int"}],addrow:function(F,H,E,G){G(true)},deleterow:function(E,F){F(true)},updaterow:function(E,G,F){F(true)}},D=new $.jqx.dataAdapter(B);$("#fermentableGrid").jqxGrid({width:1240,height:470,source:D,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(F){var E=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');F.append(E);E.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>');E.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');E.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>');E.append('<input style="float: left; margin-left: 400px;" id="fdeleterowbutton" type="button" value="Verwijder mout" />');$("#faddrowbutton").jqxDropDownList({placeHolder:"Kies mout:",theme:theme,template:"primary",source:fermentablelist,displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(H,G,J){var I=fermentablelist.records[H];return I.supplier+" / "+I.name+" ("+I.color+" EBC)"}});$("#faddrowbutton").on("select",function(I){if(I.args){var G,H,J={},K=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;G=I.args.index;H=fermentablelist.records[G];J.f_name=H.name;J.f_origin=H.origin;J.f_supplier=H.supplier;J.f_amount=0;J["[_cost"]=H.cost;J.f_type=H.type;J.f_yield=H.yield;J.f_color=H.color;J.f_coarse_fine_diff=H.coarse_fine_diff;J.f_moisture=H.moisture;J.f_diastatic_power=H.diastatic_power;J.f_protein=H.protein;J.f_max_in_batch=H.max_in_batch;J.f_graintype=H.graintype;if(H.add_after_boil){J.f_added=2}else{if((H.type==1)||(H.type==4)){J.f_added=1}else{J.f_added=0}}J.f_dissolved_protein=H.dissolved_protein;J.f_recommend_mash=H.recommend_mash;J.f_add_after_boil=H.add_after_boil;if(K==0){J.f_adjust_to_total_100=1;J.f_percentage=100}else{J.f_adjust_to_total_100=0;J.f_percentage=0}J.f_di_ph=H.di_ph;J.f_acid_to_ph_57=H.acid_to_ph_57;J.f_inventory=H.inventory;$("#fermentableGrid").jqxGrid("addrow",null,J)}});$("#finstockbutton").jqxCheckBox({theme:theme,height:27});$("#finstockbutton").on("change",function(G){fermentableinstock=G.args.checked;fermentablelist.dataBind()});$("#fdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#fdeleterowbutton").on("click",function(){var M,J,I,H,L,K,G=$("#fermentableGrid").jqxGrid("getselectedrowindex");K=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(G>=0&&G<K){M=$("#fermentableGrid").jqxGrid("getrowid",G);J=$("#fermentableGrid").jqxGrid("getcellvalue",M,"f_percentage");I=$("#fermentableGrid").jqxGrid("getcellvalue",M,"f_amount");$("#fermentableGrid").jqxGrid("deleterow",M)}K=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(K>1){if(h){for(H=0;H<K;H++){L=$("#fermentableGrid").jqxGrid("getrowdata",H);if(L.f_adjust_to_total_100){L.f_percentage+=J;L.f_amount+=I}}}else{calcPercentages()}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}calcFermentables();calcIBUs()})},ready:function(){calcFermentables();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Vergistbaar ingredi&euml;nt",datafield:"f_name",cellsrenderer:function(G,F,I,E,H,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+J.f_supplier+" / "+J.f_name+" ("+J.f_color+" EBC)</span>"}},{text:"Type",width:100,datafield:"f_type",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+FermentableTypeData[I].nl+"</span>"}},{text:"Moment",width:110,datafield:"f_added",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+AddedData[I].nl+"</span>"}},{text:"Maxinbatch",datafield:"f_max_in_batch",hidden:true},{text:"Opbrengst",editable:false,datafield:"f_yield",width:90,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gewicht Kg",datafield:"f_amount",width:120,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"Voorr. Kg",datafield:"f_inventory",width:120,align:"right",cellsrenderer:function(I,G,H,E,K,J){var F="#ffffff";if(H<J.f_amount){F="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+F+';">'+D.formatNumber(H,"f3")+"</span>"}},{text:"Procent",datafield:"f_percentage",width:90,align:"right",cellsrenderer:function(I,G,H,E,K,J){var F="#ffffff";if(H>J.f_max_in_batch){F="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+F+';">'+D.formatNumber(H,"p1")+"</span>"}},{text:"100%",align:"center",datafield:"f_adjust_to_total_100",columntype:"checkbox",width:70},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(E){u=E;e=$("#fermentableGrid").jqxGrid("getrowdata",u);$("#wf_name").val(e.f_name);$("#wf_amount").val(e.f_amount);$("#wf_percentage").val(e.f_percentage);$("#wf_max_in_batch").val(e.f_max_in_batch);$("#wf_adjust_to_total_100").val(e.f_adjust_to_total_100);$("#wf_added").val(e.f_added);$("#popupFermentable").jqxWindow("open")}}]})};var A=function(B){var D={localdata:B.hops,datatype:"local",cache:false,async:false,datafields:[{name:"h_name",type:"string"},{name:"h_origin",type:"string"},{name:"h_amount",type:"float"},{name:"h_cost",type:"float"},{name:"h_type",type:"int"},{name:"h_form",type:"int"},{name:"h_useat",type:"int"},{name:"h_time",type:"float"},{name:"h_alpha",type:"float"},{name:"h_beta",type:"float"},{name:"h_hsi",type:"float"},{name:"h_humulene",type:"float"},{name:"h_caryophyllene",type:"float"},{name:"h_cohumulone",type:"float"},{name:"h_myrcene",type:"float"},{name:"h_total_oil",type:"float"},{name:"h_inventory",type:"float"},{name:"h_avail",type:"int"}],addrow:function(F,H,E,G){G(true)},deleterow:function(E,F){F(true)},updaterow:function(E,G,F){F(true)}},C=new $.jqx.dataAdapter(D);$("#hopGrid").jqxGrid({width:1240,height:560,source:C,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(F){var E=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');F.append(E);E.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>');E.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');E.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>');E.append('<input style="float: left; margin-left: 400px;" id="hdeleterowbutton" type="button" value="Verwijder hop" />');$("#haddrowbutton").jqxDropDownList({placeHolder:"Kies hop:",theme:theme,template:"primary",source:hoplist,displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(H,G,J){var I=hoplist.records[H];return I.origin+" / "+I.name+" ("+I.alpha+"% &alpha;)"}});$("#haddrowbutton").on("select",function(I){if(I.args){var H,J={},G=I.args.index;H=hoplist.records[G];J.h_name=H.name;J.h_origin=H.origin;J.h_amount=0;J.h_cost=H.cost;J.h_type=H.type;J.h_form=H.form;J.h_useat=2;J.h_time=0;J.h_alpha=H.alpha;J.h_beta=H.beta;J.h_hsi=H.hsi;J.h_humulene=H.humulene;J.h_caryophyllene=H.caryophyllene;J.h_cohumulone=H.cohumulone;J.h_myrcene=H.myrcene;J.h_total_oil=H.total_oil;J.h_inventory=H.inventory;$("#hopGrid").jqxGrid("addrow",null,J)}$("#haddrowbutton").jqxDropDownList("clearSelection")});$("#hinstockbutton").jqxCheckBox({theme:theme,height:27});$("#hinstockbutton").on("change",function(G){hopinstock=G.args.checked;hoplist.dataBind()});$("#hdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#hdeleterowbutton").on("click",function(){var I,H,G=$("#hopGrid").jqxGrid("getselectedrowindex");I=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(G>=0&&G<I){H=$("#hopGrid").jqxGrid("getrowid",G);$("#hopGrid").jqxGrid("deleterow",H)}calcIBUs()})},ready:function(){calcIBUs();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Hop",datafield:"h_name",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+J.h_origin+" / "+J.h_name+"</span>"}},{text:"Type",width:90,datafield:"h_type",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopTypeData[I].nl+"</span>"}},{text:"Vorm",width:90,datafield:"h_form",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopFormData[I].nl+"</span>"}},{text:"Alpha",datafield:"h_alpha",width:80,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gebruik",width:110,datafield:"h_useat",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopUseData[I].nl+"</span>"}},{text:"Tijdsduur",datafield:"h_time",width:90,align:"right",cellsrenderer:function(F,E,I,H,G,K){var J="";if((K.h_useat==2)||(K.h_useat==4)){J=y.formatNumber(I,"f0")+" min."}else{if(K.h_useat==5){J=y.formatNumber(I/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+J+"</span>"}},{text:"IBU",datafield:"ibu",width:80,align:"right",cellsrenderer:function(F,E,I,H,G,K){var J=toIBU(K.h_useat,K.h_form,preboil_sg,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(K.h_amount),parseFloat(K.h_time),parseFloat(K.h_alpha),$("#ibu_method").val());return'<span style="margin: 4px; margin-top: 6px; float: right;">'+y.formatNumber(J,"f1")+"</span>"}},{text:"Gewicht",datafield:"h_amount",width:110,align:"right",cellsrenderer:function(F,E,J,I,H,K){var G=y.formatNumber(J,"f1")+" kg";if(J<1){G=y.formatNumber(J*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+G+"</span>"}},{text:"Voorraad",datafield:"h_inventory",width:110,align:"right",cellsrenderer:function(G,F,K,J,I,L){var H,E="#ffffff";if(K<L.h_amount){E="#ff4040"}H=y.formatNumber(K,"f1")+" kg";if(K<1){H=y.formatNumber(K*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+E+';">'+H+"</span>"}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(E){o=E;t=$("#hopGrid").jqxGrid("getrowdata",o);$("#wh_name").val(t.h_name);$("#wh_amount").val(t.h_amount*1000);var F=toIBU(t.h_useat,t.h_form,preboil_sg,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(t.h_amount),parseFloat(t.h_time),parseFloat(t.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(F);if(t.h_useat==5){$("#wh_time").val(t.h_time/1440)}else{$("#wh_time").val(t.h_time)}$("#wh_useat").val(t.h_useat);$("#popupHop").jqxWindow("open")}}]})};var b=function(D){var C={localdata:D.miscs,datatype:"local",cache:false,async:false,datafields:[{name:"m_name",type:"string"},{name:"m_amount",type:"float"},{name:"m_cost",type:"float"},{name:"m_type",type:"int"},{name:"m_use_use",type:"int"},{name:"m_time",type:"float"},{name:"m_amount_is_weight",type:"int"},{name:"m_inventory",type:"float"},{name:"m_avail",type:"int"}],addrow:function(F,H,E,G){G(true)},deleterow:function(E,F){F(true)},updaterow:function(E,G,F){F(true)}},B=new $.jqx.dataAdapter(C,{beforeLoadComplete:function(E){var F,H,G=new Array();for(F=0;F<E.length;F++){H=E[F];G.push(H);switch(H.m_name){case"CaCl2":$("#wa_cacl2").val(H.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(H.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(H.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(H.m_amount*1000);break;case"Melkzuur":$("#wa_acid_name").val(0);$("#wa_acid").val(H.m_amount*1000);$("#wa_acid_perc").val(80);last_acid="Melkzuur";break;case"Zoutzuur":$("#wa_acid_name").val(1);$("#wa_acid").val(H.m_amount*1000);$("#wa_acid_perc").val(80);last_acid="Zoutzuur";break;case"Fosforzuur":$("#wa_acid_name").val(2);$("#wa_acid").val(H.m_amount*1000);$("#wa_acid_perc").val(80);last_acid="Fosforzuur";break;case"Zwavelzuur":$("#wa_acid_name").val(3);$("#wa_acid").val(H.m_amount*1000);$("#wa_acid_perc").val(80);last_acid="Zwavelzuur";break;case"NaHCO3":$("#wa_base_name").val(0);$("#wa_base").val(H.m_amount*1000);last_base="NaHCO3";break;case"Na2CO3":$("#wa_base_name").val(1);$("#wa_base").val(H.m_amount*1000);last_base="Na2CO3";break;case"CaCO3":$("#wa_base_name").val(2);$("#wa_base").val(H.m_amount*1000);last_base="CaCO3";break;case"Ca(OH)2":$("#wa_base_name").val(3);$("#wa_base").val(H.m_amount*1000);last_base="Ca(OH)2";break}}return G},loadError:function(G,E,F){}});$("#miscGrid").jqxGrid({width:1240,height:575,source:B,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(F){var E=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');F.append(E);E.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>');E.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');E.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>');E.append('<input style="float: left; margin-left: 400px;" id="mdeleterowbutton" type="button" value="Verwijder ingredi&euml;nt" />');$("#maddrowbutton").jqxDropDownList({placeHolder:"Kies ingredi&euml;nt:",theme:theme,template:"primary",source:misclist,displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500});$("#maddrowbutton").on("select",function(I){if(I.args){var H,J={},G=I.args.index;H=misclist.records[G];J.m_name=H.name;J.m_amount=0;J.m_cost=H.cost;J.m_type=H.type;J.m_use_use=H.use_use;J.m_time=0;J.m_amount_is_weight=H.amount_is_weight;J.m_inventory=H.inventory;$("#miscGrid").jqxGrid("addrow",null,J)}});$("#minstockbutton").jqxCheckBox({theme:theme,height:27});$("#minstockbutton").on("change",function(G){miscinstock=G.args.checked;misclist.dataBind()});$("#mdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#mdeleterowbutton").on("click",function(){var J,H,I,G=$("#miscGrid").jqxGrid("getselectedrowindex");J=$("#miscGrid").jqxGrid("getdatainformation").rowscount;H=$("#miscGrid").jqxGrid("getcellvalue",G,"m_type");if(G>=0&&G<J&&H!=4){I=$("#miscGrid").jqxGrid("getrowid",G);$("#miscGrid").jqxGrid("deleterow",I)}})},ready:function(){$("#jqxTabs").jqxTabs("next")},columns:[{text:"Ingredient",datafield:"m_name"},{text:"Type",width:140,datafield:"m_type",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+MiscTypeData[I].nl+"</span>"}},{text:"Gebruik",width:140,datafield:"m_use_use",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 3px; margin-top: 6px; float: left;">'+MiscUseData[I].nl+"</span>"}},{text:"Tijd",datafield:"m_time",width:90,align:"right",cellsrenderer:function(F,E,I,H,G,K){var J="";if(K.m_use_use==2){J=y.formatNumber(I,"f0")+" min."}else{if((K.m_use_use==3)||(K.m_use_use==4)){J=y.formatNumber(I/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+J+"</span>"}},{text:"Hoeveel",datafield:"m_amount",width:110,align:"right",cellsrenderer:function(F,E,J,H,G,K){var I=K.m_amount_is_weight?"gr":"ml";return'<span style="margin: 4px; margin-top: 6px; float: right;">'+y.formatNumber(J*1000,"f2")+" "+I+"</span>"}},{text:"Voorraad",datafield:"m_inventory",width:110,align:"right",cellsrenderer:function(I,E,J,L,F,M){var H,G="#ffffff",K=M.m_amount_is_weight?"gr":"ml";if(J<M.m_amount){G="#ff4040"}H=y.formatNumber(J*1000,"f2")+" "+K;return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+G+';">'+H+"</span>"},},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(E){q=E;p=$("#miscGrid").jqxGrid("getrowdata",q);if(p.m_type==4){alert("Brouwzouten wijzigen in de water tab.")}else{if(p.m_amount_is_weight){$("#wm_pmpt_amount").html("Gewicht gram:")}else{$("#wm_pmpt_amount").html("Volume ml:")}$("#wm_name").val(p.m_name);$("#wm_amount").val(p.m_amount*1000);if((p.m_use_use==3)||(p.m_use_use==4)){$("#wm_time").val(p.m_time/1440)}else{$("#wm_time").val(p.m_time)}$("#wm_use_use").val(p.m_use_use);$("#popupMisc").jqxWindow("open")}}}]})};var w=function(C){var B={localdata:C.yeasts,datatype:"local",cache:false,async:false,datafields:[{name:"y_name",type:"string"},{name:"y_laboratory",type:"string"},{name:"y_product_id",type:"string"},{name:"y_amount",type:"float"},{name:"y_cost",type:"float"},{name:"y_type",type:"int"},{name:"y_form",type:"int"},{name:"y_flocculation",type:"int"},{name:"y_min_temperature",type:"float"},{name:"y_max_temperature",type:"float"},{name:"y_attenuation",type:"float"},{name:"y_use",type:"int"},{name:"y_cells",type:"float"},{name:"y_tolerance",type:"float"},{name:"y_inventory",type:"float"},{name:"y_avail",type:"int"}],addrow:function(F,H,E,G){G(true)},deleterow:function(E,F){F(true)},updaterow:function(E,G,F){F(true)}},D=new $.jqx.dataAdapter(B);$("#yeastGrid").jqxGrid({width:1240,height:350,source:D,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(F){var E=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');F.append(E);E.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>');E.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');E.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>');E.append('<input style="float: left; margin-left: 400px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />');$("#yaddrowbutton").jqxDropDownList({placeHolder:"Kies gist:",theme:theme,source:yeastlist,template:"primary",displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(H,G,J){var I=yeastlist.records[H];return I.laboratory+" "+I.product_id+" "+I.name}});$("#yaddrowbutton").on("select",function(I){if(I.args){var H,J={},G=I.args.index;H=yeastlist.records[G];J.y_name=H.name;J.y_laboratory=H.laboratory;J.y_product_id=H.product_id;J.y_type=H.type;J.y_form=H.form;J.y_amount=0;J.y_cost=H.cost;J.y_use=0;J.y_min_temperature=H.min_temperature;J.y_max_temperature=H.max_temperature;J.y_attenuation=H.attenuation;J.y_flocculation=H.flocculation;J.y_cells=H.cells;J.y_tolerance=H.tolerance;J.y_inventory=H.inventory;$("#yeastGrid").jqxGrid("addrow",null,J)}$("#yaddrowbutton").jqxDropDownList("clearSelection")});$("#yinstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(dataRecord.stage>3)});$("#yinstockbutton").on("change",function(G){yeastinstock=G.args.checked;yeastlist.dataBind()});$("#ydeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(dataRecord.stage>3)});$("#ydeleterowbutton").on("click",function(){var I,H,G=$("#yeastGrid").jqxGrid("getselectedrowindex");H=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(G>=0&&G<H){I=$("#yeastGrid").jqxGrid("getrowid",G);$("#yeastGrid").jqxGrid("deleterow",I)}})},ready:function(){calcFermentables();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Gist",datafield:"y_name"},{text:"Laboratorium",width:150,datafield:"y_laboratory"},{text:"Code",width:90,datafield:"y_product_id"},{text:"Soort",width:100,datafield:"y_form",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastFormData[I].nl+"</span>"}},{text:"Min. &deg;C",width:70,align:"right",cellsalign:"right",datafield:"y_min_temperature"},{text:"Max. &deg;C",width:70,align:"right",cellsalign:"right",datafield:"y_max_temperature"},{text:"Tol. %",width:60,align:"right",cellsalign:"right",datafield:"y_tolerance",cellsrenderer:function(G,F,K,J,I,L){var H="",E="#ffffff";if(K>0){H=y.formatNumber(K,"f1");if(dataRecord.est_abv>K){E="#ff4040"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+E+';">'+H+"</span>"}},{text:"Attn. %",width:70,align:"right",cellsalign:"right",datafield:"y_attenuation",cellsformat:"f1"},{text:"Voor",width:120,datafield:"y_use",cellsrenderer:function(F,E,I,H,G,J){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastUseData[I].nl+"</span>"}},{text:"Hoeveel",datafield:"y_amount",width:90,align:"right",cellsrenderer:function(F,E,J,I,H,K){var G=y.formatNumber(J*1000,"f0")+" ml";if(K.y_form==0){G=y.formatNumber(J,"f0")+" pk"}else{if(K.y_form==1){G=y.formatNumber(J*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+G+"</span>"}},{text:"Voorraad",datafield:"y_inventory",width:90,align:"right",cellsrenderer:function(G,F,K,J,I,L){var E,H;E="#ffffff";if(K<L.y_amount){E="#ff4040"}H=y.formatNumber(K*1000,"f0")+" ml";if(L.y_form==0){H=y.formatNumber(K,"f0")+" pk"}else{if(L.y_form==1){H=y.formatNumber(K*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+E+';">'+H+"</span>"}},{text:"",datafield:"Edit",columntype:"button",width:90,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(E){c=E;g=$("#yeastGrid").jqxGrid("getrowdata",c);if(g.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):");$("#wy_amount").val(g.y_amount);$("#wy_amount").jqxNumberInput({decimalDigits:0})}else{if(g.y_form==1){$("#wy_pmpt_amount").html("Gewicht gram:");$("#wy_amount").val(g.y_amount*1000);$("#wy_amount").jqxNumberInput({decimalDigits:1})}else{$("#wy_pmpt_amount").html("Volume ml:");$("#wy_amount").val(g.y_amount*1000);$("#wy_amount").jqxNumberInput({decimalDigits:0})}}$("#wy_name").val(g.y_name);$("#wy_laboratory").val(g.y_laboratory);$("#wy_product_id").val(g.y_product_id);$("#wy_use").val(g.y_use);$("#popupYeast").jqxWindow("open")}}]})};var n=function(E){var D=function(){var F={};F.step_name="Stap 1";F.step_type=0;F.step_infuse_amount=15;F.step_temp=62;F.step_time=20;F.step_thickness=0;F.ramp_time=1;F.end_temp=62;return F};var C={localdata:E.mashs,datatype:"local",cache:false,async:false,datafields:[{name:"step_name",type:"string"},{name:"step_type",type:"int"},{name:"step_infuse_amount",type:"float"},{name:"step_temp",type:"float"},{name:"step_time",type:"float"},{name:"step_thickness",type:"float"},{name:"ramp_time",type:"float"},{name:"end_temp",type:"float"}],addrow:function(G,I,F,H){H(true)},deleterow:function(F,G){G(true)}},B=new $.jqx.dataAdapter(C,{beforeLoadComplete:function(F){mash_infuse=0;var I,G,H=new Array();for(G=0;G<F.length;G++){I=F[G];if(I.step_type==0){mash_infuse+=parseFloat(I.step_infuse_amount)}I.step_thickness=0;H.push(I)}},});$("#mashGrid").jqxGrid({width:1240,height:400,source:B,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(G){var F=$('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');G.append(F);F.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');F.append('<input style="float: left; margin-left: 565px;" id="sdeleterowbutton" type="button" value="Verwijder stap" />');$("#saddrowbutton").jqxButton({template:"primary",theme:theme,height:27,width:150});$("#saddrowbutton").on("click",function(){var H=D();$("#mashGrid").jqxGrid("addrow",null,H)});$("#sdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#sdeleterowbutton").on("click",function(){var J,I,H=$("#mashGrid").jqxGrid("getselectedrowindex");I=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(H>=0&&H<I){J=$("#mashGrid").jqxGrid("getrowid",H);$("#mashGrid").jqxGrid("deleterow",J)}})},ready:function(){calcFermentables();a();calcMash();$("#jqxLoader").jqxLoader("close");$("#jqxTabs").jqxTabs("first")},columns:[{text:"Stap naam",datafield:"step_name"},{text:"Stap type",datafield:"step_type",width:175,cellsrenderer:function(G,F,J,I,H,K){return'<div style="margin: 4px;">'+MashStepTypeData[J].nl+"</div>"}},{text:"Start &deg;C",datafield:"step_temp",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Eind &deg;C",datafield:"end_temp",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"Rust min.",datafield:"step_time",width:90,align:"right",cellsalign:"right"},{text:"Stap min.",datafield:"ramp_time",width:90,align:"right",cellsalign:"right"},{text:"Infuse L.",datafield:"step_infuse_amount",width:90,align:"right",cellsalign:"right",cellsformat:"f1"},{text:"L/Kg.",datafield:"step_thickness",width:90,align:"right",cellsalign:"right",cellsformat:"f2"},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(F){l=F;r=$("#mashGrid").jqxGrid("getrowdata",l);$("#wstep_name").val(r.step_name);$("#wstep_type").val(r.step_type);$("#wstep_infuse_amount").val(r.step_infuse_amount);$("#wstep_temp").val(r.step_temp);$("#wend_temp").val(r.end_temp);$("#wstep_time").val(r.step_time);$("#wramp_time").val(r.ramp_time);if(r.step_type==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}$("#popupMash").jqxWindow("open")}}]})};$("#jqxMenu").jqxMenu("destroy");console.log("record:"+my_record+"  return:"+my_return+"  theme:"+theme);$("#jqxLoader").jqxLoader({width:250,height:150,isModal:true,text:"Laden recept ...",theme:theme});function z(B,F){var G,D,H,E,C,K,J=false,I=$("#miscGrid").jqxGrid("getrows");if(F==0){for(E=0;E<I.length;E++){K=I[E];if(K.m_name==B){C=$("#miscGrid").jqxGrid("getrowid",E);$("#miscGrid").jqxGrid("deleterow",C)}}}else{for(E=0;E<I.length;E++){K=I[E];if(K.m_name==B){J=true;$("#miscGrid").jqxGrid("setcellvalue",E,"m_amount",F/1000);break}}if(!J){H=new $.jqx.dataAdapter(miscInvSource,{loadComplete:function(){D=H.records;for(E=0;E<D.length;E++){G=D[E];if(G.name==B){K={};K.m_name=G.name;K.m_amount=F/1000;K.m_cost=G.cost;K.m_type=G.type;K.m_use_use=G.use_use;K.m_time=0;K.m_amount_is_weight=G.amount_is_weight;K.m_inventory=G.inventory;K.m_avail=1;$("#miscGrid").jqxGrid("addrow",null,K)}}}});H.dataBind();return}}}function m(){console.log("calcWater()");var T=0,ai=0,J=0,U=0,K=0,af=0,L=0,ad=0,N=0,W=0,ao=0,am=0,aj=0,ah,X,P,E,D,B,O,G,F,Z,R,I,aa,S,ag,Y,Q,ab,an,ac,M,ak,V,al,H,ae,C;if(dataRecord.w1_name==""){return}if(dataRecord.w2_name!=""){T=dataRecord.w1_amount+dataRecord.w2_amount;ai=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_calcium,dataRecord.w2_calcium);J=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_magnesium,dataRecord.w2_magnesium);U=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_sodium,dataRecord.w2_sodium);L=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_chloride,dataRecord.w2_chloride);ad=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_sulfate,dataRecord.w2_sulfate);K=mix(dataRecord.w1_amount,dataRecord.w2_amount,dataRecord.w1_total_alkalinity,dataRecord.w2_total_alkalinity);N=-Math.log10(((Math.pow(10,-dataRecord.w1_ph)*dataRecord.w1_amount)+(Math.pow(10,-dataRecord.w2_ph)*dataRecord.w2_amount))/T)}else{T=dataRecord.w1_amount;ai=dataRecord.w1_calcium;J=dataRecord.w1_magnesium;U=dataRecord.w1_sodium;L=dataRecord.w1_chloride;ad=dataRecord.w1_sulfate;K=dataRecord.w1_total_alkalinity;N=dataRecord.w1_ph}$("#wg_amount").val(T);ak=ai;$("#wg_calcium").val(Math.round(ai*10)/10);$("#wg_magnesium").val(Math.round(J*10)/10);V=U;$("#wg_sodium").val(Math.round(U*10)/10);al=K;$("#wg_total_alkalinity").val(Math.round(K*10)/10);H=L;$("#wg_chloride").val(Math.round(L*10)/10);ae=ad;$("#wg_sulfate").val(Math.round(ad*10)/10);$("#wg_ph").val(Round(N,1));$("#wb_ph").val(Round(MashpH(),1));af=K*1.22;C=af;W=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCa/MMCaCl2+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMCa/MMCaSO4;ai+=1000*W/T;W=parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*MMMg/MMMgSO4;J+=1000*W/T;W=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMNa/MMNaCl;U+=1000*W/T;W=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMSO4/MMCaSO4+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*MMSO4/MMMgSO4;ad+=1000*W/T;W=2*parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCl/MMCaCl2+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMCl/MMNaCl;L+=1000*W/T;if($("#wa_acid_name").val()<0||$("#wa_acid_name").val()>3){$("#wa_acid_name").val(0);dataRecord.wa_acid_name=0}if(last_acid==""){last_acid=AcidTypeData[$("#wa_acid_name").val()].nl}if($("#wa_base_name").val()<0||$("#wa_base_name").val()>3){$("#wa_base_name").val(0);dataRecord.wa_base_name=0}if(last_base==""){last_base=BaseTypeData[$("#wa_base_name").val()].nl}ah=dataRecord.wa_acid_name;X=dataRecord.wa_base_name;P=GetAcidSpecs(ah);E=P.pK1;D=P.pK2;B=P.pK3;O=P.MolWt;G=P.AcidSG;F=P.AcidPrc;if(dataRecord.calc_acid){am=parseFloat(dataRecord.mash_ph);aj=ProtonDeficit(am);console.log("calc_acid tgt: "+am+" protonDeficit: "+aj);if(aj>0){$("#wa_base").val(0);z(last_base,0);ao=CalcFrac(am,E,D,B);Acid=aj/ao;Acid*=O;Acidmg=Acid;Acid=Acid/G;if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(F)}Acid=Acid*F/(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);console.log("Final ml: "+Acid);$("#wa_acid").val(Math.round(Acid*100)/100);z(AcidTypeData[ah].nl,Math.round(Acid*100)/100);af=af-aj*ao/T;K=af*50/61}else{if(aj<0){$("#wa_acid").val(0);z(last_acid,0);Z=Math.pow(10,(am-6.38));R=Math.pow(10,(am-10.38));I=1/(1+Z+Z*R);aa=I*Z;S=aa*R;switch(X){case 0:W=-aj/(I-S);W=W*MMNaHCO3/1000;$("#wa_base").val(Round(W,2));z("NaHCO3",Round(W,2));if(T>0){W=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMNa/MMNaCl+parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMNa/MMNaHCO3;W=1000*W/T;U=V+W;W=parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMHCO3/MMNaHCO3;W=1000*W/T;af=C+W;K=af*50/61;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 1:W=-aj/(2*I+aa);W=W*MMNa2CO3/1000;$("#wa_base").val(Round(W,2));z("Na2CO3",Round(W,2));if(T>0){W=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMNa/MMNaCl+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*MMNa/MMNa2CO3;W=1000*W/T;U=V+W;W=parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMHCO3/MMNa2CO3;W=1000*W/T;af=C+W;K=af*50/61;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 2:W=-aj*(I-S);W=W*MMCaCO3/1000;W=3*W;$("#wa_base").val(Round(W,2));z("CaCO3",Round(W,2));if(T>0){W=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*MMHCO3/MMCaCO3;W=1000*W/T;af=C+W;K=af*50/61;W=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCa/MMCaCl2+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMCa/MMCaSO4+parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMCa/MMCaCO3;W=1000*W/T;ai=ak+W;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 3:W=-aj/19.3;$("#wa_base").val(Round(W,2));z("Ca(OH)2",Round(W,2));if(T>0){W=-aj/T;K=al+W;af=K*61/50;W=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCa/MMCaCl2+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMCa/MMCaSO4+parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMCa/MMCaOH2;W=1000*W/T;ai=ak+W;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium)}break}}}N=am;$("#wb_ph").val(Math.round(N*10)/10)}else{console.log("calc_acid no");if(parseFloat($("#wa_base").jqxNumberInput("decimal"))>0){if(T>0){switch(X){case 0:W=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMNa/MMNaCl+parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMNa/MMNaHCO3;W=1000*W/T;U=V+W;W=parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMHCO3/MMNaHCO3;W=1000*W/T;af=C+W;K=af*50/61;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 1:W=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMNa/MMNaCl+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*MMNa/MMNa2CO3;W=1000*W/T;U=V+W;W=parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMHCO3/MMNa2CO3;W=1000*W/T;af=C+W;K=af*50/61;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 2:W=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*MMHCO3/MMCaCO3;W=1000*W/T;af=C+W;K=af*50/61;W=ResidualAlkalinity(wb_total_alkalinity,wb_calcium,wb_magnesium);W=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCa/MMCaCl2+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMCa/MMCaSO4+parseFloat($("#wa_base").jqxNumberInput("decimal"))*MMCa/MMCaCO3;W=1000*W/T;ai=ak+W;break}}}am=parseFloat(dataRecord.mash_ph);pHa=MashpH();if(parseFloat($("#wa_acid").jqxNumberInput("decimal"))>0){console.log("TpH: "+am+" water: "+pHa);Acid=parseFloat($("#wa_acid").jqxNumberInput("decimal"));if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(F)}Acid=Acid/F*(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);Acid*=G;Acid/=O;Acidmg=Acid;ao=CalcFrac(pHa,E,D,B);aj=Acid*ao;ag=0.001;Y=0.1;Q=ProtonDeficit(pHa);ab=0;while(((Q<(aj-Y))||(Q>(aj+Y)))&&(ab<2000)){ab++;if(Q<(aj-Y)){pHa-=ag}else{if(Q>(aj+Y)){pHa+=ag}}ao=CalcFrac(pHa,E,D,B);aj=Acid*ao;Q=ProtonDeficit(pHa)}console.log("n: "+ab+" pd: "+Q+" protonDeficit: "+aj+" frac: "+ao+" pHa: "+pHa);W=C-aj*ao/T;af=W;K=W*50/61;N=pHa;$("#wb_ph").val(Round(N,1))}}if((ah==3)&&(T>0)){W=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*MMSO4/MMCaSO4+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*MMSO4/MMMgSO4+Acidmg/1000*MMSO4/(MMSO4+2);W=1000*W/T;ad=ae+W}else{if((ah==1)&&(T>0)){W=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*MMCl/MMCaCl2+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*MMCl/MMNaCl+Acidmg/1000*MMCl/(MMCl+1);W=1000*W/T;L=H+W}}$("#tgt_bu").val(Math.round(GetBUGU()*100)/100);if(GetBUGU()<0.32){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig en zoet</span>")}else{if(GetBUGU()<0.43){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig, zoet</span>")}else{if(GetBUGU()<0.52){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Evenwichtig</span>")}else{if(GetBUGU()<0.63){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Licht hoppig, bitter</span>")}else{$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Extra hoppig, zeer bitter</span>")}}}}$("#tgt_cl_so4").val(Math.round(GetOptClSO4ratio()*10)/10);if(ad>0){W=L/ad}else{W=10}$("#got_cl_so4").val(Math.round(W*10)/10);an=0.8*GetOptClSO4ratio();ac=1.2*GetOptClSO4ratio();M="normaal";if(W<an){M="laag"}else{if(W>ac){M="hoog"}}setRangeIndicator("cl_so4",M);$("#wb_calcium").val(Round(ai,1));$("#wb_magnesium").val(Round(J,1));$("#wb_sodium").val(Round(U,1));$("#wb_sulfate").val(Round(ad,1));$("#wb_chloride").val(Round(L,1));$("#wb_total_alkalinity").val(Round(K,1));if(ai<40){setRangeIndicator("calcium","laag")}else{if(ai>150){setRangeIndicator("calcium","hoog")}else{setRangeIndicator("calcium","normaal")}}if(J>=0&&J<=30){setRangeIndicator("magnesium","normaal")}else{setRangeIndicator("magnesium","hoog")}if(U<=150){setRangeIndicator("sodium","normaal")}else{setRangeIndicator("sodium","hoog")}if(L<=50){setRangeIndicator("chloride","laag")}else{if(L<=100){setRangeIndicator("chloride","normaal")}else{setRangeIndicator("chloride","hoog")}}if(ad<=50){setRangeIndicator("sulfate","laag")}else{if(ad<=350){setRangeIndicator("sulfate","normaal")}else{setRangeIndicator("sulfate","hoog")}}if(N<5.2){setRangeIndicator("ph","laag")}else{if(N>5.6){setRangeIndicator("ph","hoog")}else{setRangeIndicator("ph","normaal")}}v()}function v(){var E,Q,O,W,V,Z,T,S,U,H,ae,ac,C,G,J,P,aa,Y,ab,R,D,I,N,M,L,K,ad,F,B,X;E=dataRecord.sparge_ph;Q=dataRecord.w1_ph;O=dataRecord.w1_total_alkalinity;if(dataRecord.sparge_source==1){if(dataRecord.w2_ph>0){Q=dataRecord.w2_ph;O=dataRecord.w2_total_alkalinity}else{dataRecord.sparge_source=0;$("#sparge_source").val(0)}}else{if(dataRecord.sparge_source==2){if(dataRecord.w2_ph>0){Q=parseFloat($("#wg_ph").jqxNumberInput("decimal"));O=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))}else{dataRecord.sparge_source=0;$("#sparge_source").val(0)}}}W=Math.pow(10,Q-6.38);V=Math.pow(10,Q-10.373);Z=1+W+W*V;T=1/Z;S=W*V/Z;U=Math.pow(10,4.3-6.38);H=Math.pow(10,4.3-10.373);ae=1+U+U*H;ac=1/ae;C=U*H/ae;G=O/50;J=(G-1000*(Math.pow(10,-4.3)-Math.pow(10,-Q)))/((ac-T)+(S-C));P=Math.pow(10,E-6.38);aa=Math.pow(10,E-10.373);Y=1+P+P*aa;ab=1/Y;R=P*aa/Y;D=J*((ab-T)+(S-R))+Math.pow(10,-E)-Math.pow(10,-Q);D+=0.01;if(dataRecord.sparge_acid_type<0||dataRecord.sparge_acid_type>3){dataRecord.sparge_acid_type=0;$("#sparge_acid_type").val(0)}I=dataRecord.sparge_acid_type;N=GetAcidSpecs(I);M=N.pK1;L=N.pK2;K=N.pK3;ad=N.MolWt;F=N.AcidSG;B=N.AcidPrc;X=CalcFrac(E,M,L,K);D/=X;D*=ad;D=D/F;T=dataRecord.sparge_acid_perc;if(T<=0.1){T=B}D=D*B/(T/100);D*=dataRecord.sparge_volume;D=Round(D,2);dataRecord.sparge_acid_amount=D/1000;$("#sparge_acid_amount").val(D)}function k(C){console.log("calcFermentablesFromOG("+C+")");var E,K,H,D,J,G=0,F=0,I,B=parseFloat($("#efficiency").jqxNumberInput("decimal"));J=sg_to_plato(C)*parseFloat($("#batch_size").jqxNumberInput("decimal"))*C/100;I=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(D=0;D<I;D++){K=$("#fermentableGrid").jqxGrid("getrowdata",D);if(K.f_added<4){H=K.f_percentage/100*(K.f_yield/100)*(1-K.f_moisture/100);if(K.f_added==0){H=B/100*H}G+=H}}if(G){F=Math.round((J/G)*1000)/1000}if(F){for(D=0;D<I;D++){K=$("#fermentableGrid").jqxGrid("getrowdata",D);if(K.f_added<4){E=Math.round(K.f_percentage*10*F)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",D,"f_amount",E)}}}}function a(){console.log("calc.init()");$("#calc_acid").on("checked",function(B){dataRecord.calc_acid=1;m()});$("#calc_acid").on("unchecked",function(B){dataRecord.calc_acid=0;m()});$("#w1_name").jqxDropDownList("selectItem",dataRecord.w1_name);$("#w2_name").jqxDropDownList("selectItem",dataRecord.w2_name);if(parseFloat($("#w1_amount").jqxNumberInput("decimal"))==0&&mash_infuse>0){$("#w1_amount").val(mash_infuse);dataRecord.w1_amount=mash_infuse;$("#wg_amount").val(mash_infuse);$("#w2_amount").val(0);dataRecord.w2_amount=0}m();$("#w2_amount").on("change",function(B){var C=parseFloat(B.args.value);if(C>mash_infuse){$("#w2_amount").val(dataRecord.w2_amount);return}dataRecord.w1_amount=parseFloat($("#wg_amount").jqxNumberInput("decimal"))-C;$("#w1_amount").val(dataRecord.w1_amount);dataRecord.w2_amount=C;console.log("new: "+B.args.value+" w1: "+dataRecord.w1_amount+"  w2: "+dataRecord.w2_amount);m()});$("#wa_cacl2").on("change",function(B){if(B.args){z("CaCl2",0);z("CaCl2",B.args.value);m()}});$("#wa_caso4").on("change",function(B){if(B.args){z("CaSO4",0);z("CaSO4",B.args.value);m()}});$("#wa_mgso4").on("change",function(B){if(B.args){z("MgSO4",0);z("MgSO4",B.args.value);m()}});$("#wa_nacl").on("change",function(B){if(B.args){z("NaCl",0);z("NaCl",B.args.value);m()}});$("#wa_base_name").on("change",function(C){if(C.args){var B=C.args.index;z(last_base,0);last_base=BaseTypeData[B].nl;z(last_base,parseFloat($("#wa_base").jqxNumberInput("decimal")));dataRecord.wa_base_name=B;m()}});$("#wa_base").on("change",function(C){var B=BaseTypeData[$("#wa_base_name").val()].nl;z(B,parseFloat(C.args.value));m()});$("#wa_acid_name").on("change",function(C){if(C.args){var B=C.args.index;z(last_acid,0);last_acid=AcidTypeData[B].nl;z(last_acid,parseFloat($("#wa_acid").jqxNumberInput("decimal")));dataRecord.wa_acid_name=B;m()}});$("#wa_acid").on("change",function(C){var B=AcidTypeData[$("#wa_acid_name").val()].nl;z(B,parseFloat(C.args.value));m()});$("#wa_acid_perc").on("change",function(B){m()});$("#color_method").on("change",function(B){dataRecord.color_method=B.args.index;calcFermentables()});$("#ibu_method").on("change",function(B){dataRecord.ibu_method=B.args.index;calcFermentables();calcIBUs()});$("#batch_size").on("change",function(D){console.log("batch_size change:"+D.args.value+" old:"+dataRecord.batch_size);var B,C=parseFloat(D.args.value)+dataRecord.boil_size-dataRecord.batch_size;B=parseFloat(D.args.value)/dataRecord.batch_size;dataRecord.boil_size=C;$("#boil_size").val(Round(C,2));dataRecord.sparge_volume*=B;$("#sparge_volume").val(dataRecord.sparge_volume);dataRecord.batch_size=parseFloat(D.args.value);k(parseFloat($("#est_og").jqxNumberInput("decimal")));adjustWaters(B);calcFermentables();adjustHops(B);adjustMiscs(B);adjustYeasts(B);calcIBUs();m();v();calcMash()});$("#boil_time").on("change",function(D){console.log("boil_time change:"+parseFloat(D.args.value)+" old:"+dataRecord.boil_time);var C,B,E=parseFloat(dataRecord.boil_size)-parseFloat(dataRecord.batch_size);B=E*(parseFloat(D.args.value)/dataRecord.boil_time);C=parseFloat(dataRecord.batch_size)+B;dataRecord.boil_time=parseFloat(D.args.value);dataRecord.boil_size=C;$("#boil_size").val(Round(C,2));calcFermentables();calcIBUs()});$("#efficiency").on("change",function(C){var B=parseFloat($("#est_og").jqxNumberInput("decimal"));dataRecord.efficiency=parseFloat(C.args.value);console.log("efficiency change:"+dataRecord.efficiency);k(B);calcFermentables();calcIBUs()});$("#est_og").on("change",function(B){dataRecord.est_og=parseFloat(B.args.value);console.log("est_og change:"+dataRecord.est_og);k(dataRecord.est_og);calcFermentables();calcIBUs();calcMash()});$("#mash_ph").on("change",function(B){dataRecord.mash_ph=parseFloat(B.args.value);m()});$("#sparge_ph").on("change",function(B){dataRecord.sparge_ph=parseFloat(B.args.value);v()});$("#sparge_volume").on("change",function(B){dataRecord.sparge_volume=parseFloat(B.args.value);v()});$("#sparge_source").on("change",function(C){if(C.args){var B=C.args.index;dataRecord.sparge_source=B;v()}});$("#sparge_acid_type").on("change",function(C){if(C.args){var B=C.args.index;dataRecord.sparge_acid_type=B;console.log("new sparge_acid_type: "+dataRecord.sparge_acid_type);v()}});$("#sparge_acid_perc").on("change",function(B){dataRecord.sparge_acid_perc=parseFloat(B.args.value);v()});$("#locked").on("checked",function(B){dataRecord.locked=1;setReadonly(true)});$("#locked").on("unchecked",function(B){dataRecord.locked=0;setReadonly(false)})}$("#styleSelect").jqxDropDownList({placeHolder:"Kies bierstijl:",theme:theme,source:styleslist,displayMember:"name",width:180,height:23,dropDownVerticalAlignment:"top",dropDownWidth:500,dropDownHeight:350,renderer:function(C,B,E){var D=styleslist.records[C];return D.style_guide+" "+D.style_letter+" "+D.name}});$("#styleSelect").on("select",function(D){if(D.args){var C,B=D.args.index;C=styleslist.records[B];$("#st_name").val(C.name);$("#st_category").val(C.category);$("#st_category_number").val(C.category_number);$("#st_letter").val(C.style_letter);$("#st_guide").val(C.style_guide);$("#st_type").val(StyleTypeData[C.type].nl);$("#st_og_min").val(C.og_min);$("#st_og_max").val(C.og_max);$("#st_fg_min").val(C.fg_min);$("#st_fg_max").val(C.fg_max);$("#st_ibu_min").val(C.ibu_min);$("#st_ibu_max").val(C.ibu_max);$("#st_color_min").val(C.color_min);$("#st_color_max").val(C.color_max);$("#st_carb_min").val(C.carb_min);$("#st_carb_max").val(C.carb_max);$("#st_abv_min").val(C.abv_min);$("#st_abv_max").val(C.abv_max)}});function d(B){var D={record:my_record,uuid:dataRecord.uuid,name:$("#name").val(),locked:dataRecord.locked,notes:$("#notes").val(),st_name:$("#st_name").val(),st_letter:$("#st_letter").val(),st_guide:$("#st_guide").val(),st_type:dataRecord.st_type,st_category:$("#st_category").val(),st_category_number:parseFloat($("#st_category_number").jqxNumberInput("decimal")),st_og_min:parseFloat($("#st_og_min").jqxNumberInput("decimal")),st_og_max:parseFloat($("#st_og_max").jqxNumberInput("decimal")),st_fg_min:parseFloat($("#st_fg_min").jqxNumberInput("decimal")),st_fg_max:parseFloat($("#st_fg_max").jqxNumberInput("decimal")),st_ibu_min:parseFloat($("#st_ibu_min").jqxNumberInput("decimal")),st_ibu_max:parseFloat($("#st_ibu_max").jqxNumberInput("decimal")),st_color_min:parseFloat($("#st_color_min").jqxNumberInput("decimal")),st_color_max:parseFloat($("#st_color_max").jqxNumberInput("decimal")),st_carb_min:parseFloat($("#st_carb_min").jqxNumberInput("decimal")),st_carb_max:parseFloat($("#st_carb_max").jqxNumberInput("decimal")),st_abv_min:parseFloat($("#st_abv_min").jqxNumberInput("decimal")),st_abv_max:parseFloat($("#st_abv_max").jqxNumberInput("decimal")),type:$("#type").val(),batch_size:parseFloat($("#batch_size").jqxNumberInput("decimal")),boil_size:parseFloat($("#boil_size").jqxNumberInput("decimal")),boil_time:parseFloat($("#boil_time").jqxNumberInput("decimal")),efficiency:parseFloat($("#efficiency").jqxNumberInput("decimal")),est_og:parseFloat($("#est_og").jqxNumberInput("decimal")),est_fg:parseFloat($("#est_fg").jqxNumberInput("decimal")),est_abv:parseFloat($("#est_abv").jqxNumberInput("decimal")),est_color:parseFloat($("#est_color").jqxNumberInput("decimal")),color_method:$("#color_method").val(),est_ibu:parseFloat($("#est_ibu").jqxNumberInput("decimal")),ibu_method:$("#ibu_method").val(),est_carb:parseFloat($("#est_carb").jqxNumberInput("decimal")),mash_name:$("#mash_name").val(),mash_ph:parseFloat($("#mash_ph").jqxNumberInput("decimal")),sparge_temp:parseFloat($("#sparge_temp").jqxNumberInput("decimal")),sparge_ph:parseFloat($("#sparge_ph").jqxNumberInput("decimal")),sparge_volume:parseFloat($("#sparge_volume").jqxNumberInput("decimal")),sparge_source:$("#sparge_source").val(),sparge_acid_type:$("#sparge_acid_type").val(),sparge_acid_perc:parseFloat($("#sparge_acid_perc").jqxNumberInput("decimal")),sparge_acid_amount:dataRecord.sparge_acid_amount,calc_acid:dataRecord.calc_acid,w1_name:$("#w1_name").val(),w1_amount:parseFloat($("#w1_amount").jqxNumberInput("decimal")),w1_calcium:parseFloat($("#w1_calcium").jqxNumberInput("decimal")),w1_sulfate:parseFloat($("#w1_sulfate").jqxNumberInput("decimal")),w1_chloride:parseFloat($("#w1_chloride").jqxNumberInput("decimal")),w1_sodium:parseFloat($("#w1_sodium").jqxNumberInput("decimal")),w1_magnesium:parseFloat($("#w1_magnesium").jqxNumberInput("decimal")),w1_total_alkalinity:parseFloat($("#w1_total_alkalinity").jqxNumberInput("decimal")),w1_ph:parseFloat($("#w1_ph").jqxNumberInput("decimal")),w1_cost:dataRecord.w1_cost,w2_name:$("#w2_name").val(),w2_amount:parseFloat($("#w2_amount").jqxNumberInput("decimal")),w2_calcium:parseFloat($("#w2_calcium").jqxNumberInput("decimal")),w2_sulfate:parseFloat($("#w2_sulfate").jqxNumberInput("decimal")),w2_chloride:parseFloat($("#w2_chloride").jqxNumberInput("decimal")),w2_sodium:parseFloat($("#w2_sodium").jqxNumberInput("decimal")),w2_magnesium:parseFloat($("#w2_magnesium").jqxNumberInput("decimal")),w2_total_alkalinity:parseFloat($("#w2_total_alkalinity").jqxNumberInput("decimal")),w2_ph:parseFloat($("#w2_ph").jqxNumberInput("decimal")),w2_cost:dataRecord.w2_cost,wg_amount:parseFloat($("#wg_amount").jqxNumberInput("decimal")),wg_calcium:parseFloat($("#wg_calcium").jqxNumberInput("decimal")),wg_sulfate:parseFloat($("#wg_sulfate").jqxNumberInput("decimal")),wg_chloride:parseFloat($("#wg_chloride").jqxNumberInput("decimal")),wg_sodium:parseFloat($("#wg_sodium").jqxNumberInput("decimal")),wg_magnesium:parseFloat($("#wg_magnesium").jqxNumberInput("decimal")),wg_total_alkalinity:parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal")),wg_ph:parseFloat($("#wg_ph").jqxNumberInput("decimal")),wb_calcium:parseFloat($("#wb_calcium").jqxNumberInput("decimal")),wb_sulfate:parseFloat($("#wb_sulfate").jqxNumberInput("decimal")),wb_chloride:parseFloat($("#wb_chloride").jqxNumberInput("decimal")),wb_sodium:parseFloat($("#wb_sodium").jqxNumberInput("decimal")),wb_magnesium:parseFloat($("#wb_magnesium").jqxNumberInput("decimal")),wb_total_alkalinity:parseFloat($("#wb_total_alkalinity").jqxNumberInput("decimal")),wb_ph:parseFloat($("#wb_ph").jqxNumberInput("decimal")),wa_acid_name:$("#wa_acid_name").val(),wa_acid_perc:parseFloat($("#wa_acid_perc").jqxNumberInput("decimal")),wa_base_name:$("#wa_base_name").val(),fermentables:$("#fermentableGrid").jqxGrid("getrows"),hops:$("#hopGrid").jqxGrid("getrows"),miscs:$("#miscGrid").jqxGrid("getrows"),yeasts:$("#yeastGrid").jqxGrid("getrows"),mashs:$("#mashGrid").jqxGrid("getrows")},C="update=true&"+$.param(D);$.ajax({dataType:"json",url:f,cache:false,async:false,data:C,type:"POST",success:function(F,E,G){console.log("saveRecord("+B+") success");if(B){window.location.href=my_return}else{window.location.href="rec_export.php?record="+my_record+"&return="+my_return+"&name="+dataRecord.name}},error:function(E,G,F){console.log("saveRecord() "+G)}})}y.dataBind();$("#name").jqxTooltip({content:"De naam voor dit recept."});$("#name").jqxInput({theme:theme,width:640,height:23});$("#locked").jqxCheckBox({theme:theme,width:120,height:23});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit recept."});$("#notes").jqxInput({theme:theme,width:960,height:200});$("#type").jqxTooltip({content:"Het brouw type van dit recept."});$("#type").jqxDropDownList({theme:theme,source:RecipeTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#efficiency").jqxTooltip({content:"Het rendement van maischen en koken."});$("#efficiency").jqxNumberInput(Perc1dec);$("#batch_size").jqxTooltip({content:"Het volume van het gekoelde wort na het koken."});$("#batch_size").jqxNumberInput(Spin1dec);$("#batch_size").jqxNumberInput({min:4});$("#boil_size").jqxTooltip({content:"Het volume van het wort voor het koken."});$("#boil_size").jqxNumberInput({inputMode:"simple",theme:theme,width:90,height:23,decimalDigits:2,readOnly:true});$("#boil_time").jqxTooltip({content:"De kooktijd in minuten."});$("#boil_time").jqxNumberInput(PosInt);$("#boil_time").jqxNumberInput({min:4,max:360});$("#st_name").jqxTooltip({content:"De bierstijl naam voor dit recept."});$("#st_name").jqxInput({theme:theme,width:250,height:23});$("#st_letter").jqxTooltip({content:"De bierstijl letter voor dit recept."});$("#st_letter").jqxInput({theme:theme,width:90,height:23});$("#st_guide").jqxTooltip({content:"De bierstijl gids voor dit recept."});$("#st_guide").jqxInput({theme:theme,width:250,height:23});$("#st_category").jqxTooltip({content:"De Amerikaanse bierstijl categorie."});$("#st_category").jqxInput({theme:theme,width:250,height:23});$("#st_category_number").jqxTooltip({content:"De Amerikaanse bierstijl categorie sub nummer."});$("#st_category_number").jqxNumberInput(Smal0dec);$("#st_type").jqxTooltip({content:"Het bierstijl type."});$("#st_type").jqxInput({theme:theme,width:250,height:23});$("#est_og").jqxTooltip({content:"Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend."});$("#est_og").jqxNumberInput(SGopts);$("#st_og_min").jqxTooltip({content:"Het minimum begin SG voor deze bierstijl."});$("#st_og_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_og_max").jqxTooltip({content:"Het maximum begin SG voor deze bierstijl."});$("#st_og_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#est_fg").jqxTooltip({content:"Het eind SG. Dit wordt automatisch berekend."});$("#est_fg").jqxNumberInput(Show3dec);$("#st_fg_min").jqxTooltip({content:"Het minimum eind SG voor deze bierstijl."});$("#st_fg_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_fg_max").jqxTooltip({content:"Het maximum eind SG voor deze bierstijl."});$("#st_fg_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#est_abv").jqxTooltip({content:"Alcohol volume %. Dit wordt automatisch berekend."});$("#est_abv").jqxNumberInput(Smal1dec);$("#st_abv_min").jqxTooltip({content:"Het minimum alcohol volume % voor deze bierstijl."});$("#st_abv_min").jqxNumberInput(Smal1dec);$("#st_abv_max").jqxTooltip({content:"Het maximum alcohol volume % voor deze bierstijl."});$("#st_abv_max").jqxNumberInput(Smal1dec);$("#est_color").jqxTooltip({content:"De kleur in EBC. Dit wordt automatisch berekend."});$("#est_color").jqxNumberInput(Show0dec);$("#st_color_min").jqxTooltip({content:"De minimum kleur voor deze bierstijl."});$("#st_color_min").jqxNumberInput(Smal0dec);$("#st_color_max").jqxTooltip({content:"De maximum kleur voor deze bierstijl."});$("#st_color_max").jqxNumberInput(Smal0dec);$("#color_method").jqxDropDownList({theme:theme,source:ColorMethodAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#est_ibu").jqxTooltip({content:"De bitterheid in IBU. Dit wordt automatisch berekend."});$("#est_ibu").jqxNumberInput(Show0dec);$("#st_ibu_min").jqxTooltip({content:"De minimum bitterheid voor deze bierstijl."});$("#st_ibu_min").jqxNumberInput(Smal0dec);$("#st_ibu_max").jqxTooltip({content:"De maximum bitterheid voor deze bierstijl."});$("#st_ibu_max").jqxNumberInput(Smal0dec);$("#ibu_method").jqxDropDownList({theme:theme,source:IBUmethodAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#kcal").jqxTooltip({content:"Energie-inhoud in kcal/liter."});$("#kcal").jqxNumberInput(Smal0dec);$("#est_carb").jqxTooltip({content:"Koolzuur volume. Dit wordt automatisch berekend."});$("#est_carb").jqxNumberInput(Smal1dec);$("#st_carb_min").jqxTooltip({content:"Het minimum koolzuur volume voor deze bierstijl."});$("#st_carb_min").jqxNumberInput(Smal1dec);$("#st_carb_max").jqxTooltip({content:"Het maximum koolzuur volume voor deze bierstijl."});$("#st_carb_max").jqxNumberInput(Smal1dec);$("#est_color2").jqxTooltip({content:"De kleur in EBC. Dit wordt automatisch berekend."});$("#est_color2").jqxNumberInput(Show0dec);$("#est_og2").jqxTooltip({content:"Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend."});$("#est_og2").jqxNumberInput(Show3dec);$("#perc_malts").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:120,animationDuration:0,colorRanges:[{stop:90,color:"#008C00"},{stop:100,color:"#EB7331"},{stop:120,color:"#FF0000"}],renderText:function(B){return(Math.round(parseInt(B)*1.2))+"%"}});$("#perc_sugars").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:50,animationDuration:0,colorRanges:[{stop:20,color:"#008C00"},{stop:50,color:"#FF0000"}],renderText:function(B){return(Math.round(parseInt(B)*5)/10)+"%"}});$("#perc_cara").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:50,animationDuration:0,colorRanges:[{stop:25,color:"#008C00"},{stop:50,color:"#FF0000"}],renderText:function(B){return(Math.round(parseInt(B)*5)/10)+"%"}});$("#ferm_lintner").jqxProgressBar({width:300,height:23,theme:theme,showText:true,max:200,animationDuration:0,colorRanges:[{stop:30,color:"#FF0000"},{stop:40,color:"#EB7331"},{stop:200,color:"#008C00"}],renderText:function(B){return(parseInt(B)*2)+" lintner"}});$("#popupFermentable").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#FermentableReady"),modalOpacity:0.4});$("#FermentableReady").jqxButton({template:"success",width:"90px",theme:theme});$("#FermentableReady").click(function(){var C,B=$("#fermentableGrid").jqxGrid("getrowid",u);console.log("FermentableReady row:"+u+" ID:"+B);C={f_name:e.f_name,f_origin:e.f_origin,f_supplier:e.f_supplier,f_amount:e.f_amount,f_cost:e.f_cost,f_type:e.f_type,f_yield:e.f_yield,f_color:e.f_color,f_coarse_fine_diff:e.f_coarse_fine_diff,f_moisture:e.f_moisture,f_diastatic_power:e.f_diastatic_power,f_protein:e.f_protein,f_max_in_batch:e.f_max_in_batch,f_graintype:e.f_graintype,f_added:e.f_added,f_dissolved_protein:e.f_dissolved_protein,f_recommend_mash:e.f_recommend_mash,f_add_after_boil:e.f_add_after_boil,f_adjust_to_total_100:e.f_adjust_to_total_100,f_percentage:e.f_percentage,f_di_ph:e.f_di_ph,f_acid_to_ph_57:e.f_acid_to_ph_57,f_inventory:e.f_inventory,f_avail:e.f_avail};$("#fermentableGrid").jqxGrid("updaterow",B,C);calcPercentages();calcFermentables();calcIBUs();calcMash()});$("#wf_name").jqxInput({theme:theme,width:320,height:23});$("#wf_instock").jqxCheckBox({theme:theme,height:23});$("#wf_instock").on("change",function(B){fermentableinstock=B.args.checked;fermentablelist.dataBind()});$("#wf_select").jqxDropDownList({placeHolder:"Kies mout:",theme:theme,source:fermentablelist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(C,B,E){var D=fermentablelist.records[C];return D.supplier+" / "+D.name+" ("+D.color+" EBC)"}});$("#wf_select").on("select",function(D){if(D.args){var C,B=D.args.index;C=fermentablelist.records[B];$("#wf_name").val(C.name);e.f_name=C.name;e.f_origin=C.origin;e.f_supplier=C.supplier;e.f_type=C.type;e.f_cost=C.cost;e.f_yield=C.yield;e.f_color=C.color;e.f_coarse_fine_diff=C.coarse_fine_diff;e.f_moisture=C.moisture;e.f_diastatic_power=C.diastatic_power;e.f_protein=C.protein;e.f_max_in_batch=C.max_in_batch;e.f_graintype=C.graintype;e.f_dissolved_protein=C.dissolved_protein;e.f_recommend_mash=C.recommend_mash;e.f_add_after_boil=C.add_after_boil;e.f_di_ph=C.di_ph;e.f_acid_to_ph_57=C.acid_to_ph_57;e.f_inventory=C.inventory}});$("#wf_amount").jqxNumberInput(Spin3dec);$("#wf_amount").on("change",function(B){console.log("amount changed: "+B.args.value);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_amount",B.args.value);e.f_amount=B.args.value;if(!h){calcPercentages();calcFermentables();calcMash()}});$("#wf_percentage").jqxNumberInput(Perc1dec);$("#wf_percentage").on("change",function(C){var M,H,I,B,J,L,K,G,F,E,D=Round(e.f_percentage,1);E=C.args.value;console.log("percentage changed: "+E+" old: "+D);e.f_percent=E;J=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if((D!=E)&&(J>1)){L=$("#fermentableGrid").jqxGrid("getrowdata",u);if(L.f_adjust_to_total_100){$("#wf_percentage").val(D)}else{K=E-D;G=0;for(F=0;F<J;F++){L=$("#fermentableGrid").jqxGrid("getrowdata",F);if(L.f_added<4){G+=Round(L.f_amount,3)}}G=Round(G,3);if(h){I=Math.round(G*K*10)/1000;L=$("#fermentableGrid").jqxGrid("getrowdata",u);B=Round((L.f_amount+I),3);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_amount",B);$("#wf_amount").val(B);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_percentage",L.f_percentage+K);for(F=0;F<J;F++){L=$("#fermentableGrid").jqxGrid("getrowdata",F);if(L.f_adjust_to_total_100){B=L.f_amount-I;$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_percentage",L.f_percentage-K);$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_amount",B)}}calcFermentables();calcMash()}else{H=G*K/100;for(F=0;F<J;F++){L=$("#fermentableGrid").jqxGrid("getrowdata",F);if(L.f_added<4){if(F==u){B=Math.round((L.f_amount+H)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_amount",B);$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_percentage",E)}else{B=Round((L.f_amount-(H/(J-1))),3);M=Round((B/G)*100,1);$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_amount",B);$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_percentage",M)}}else{$("#fermentableGrid").jqxGrid("setcellvalue",F,"f_percentage",0)}}calcFermentables();calcMash()}}}});$("#wf_max_in_batch").jqxNumberInput(Show1dec);$("#wf_adjust_to_total_100").jqxCheckBox({theme:theme,width:120,height:23});$("#wf_adjust_to_total_100").on("checked",function(B){if(e.f_adjust_to_total_100==0){if(h){rowscount=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(i=0;i<rowscount;i++){if(i!=u){$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_adjust_to_total_100",0)}}}$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",1);calcFermentables()}});$("#wf_adjust_to_total_100").on("unchecked",function(B){if(e.f_adjust_to_total_100!=0){$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",0);calcFermentables()}});$("#wf_added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wf_added").on("select",function(C){if(C.args){var B=C.args.index;$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_added",B);calcFermentables();calcIBUs();calcMash()}});$("#est_ibu2").jqxTooltip({content:"De bitterheid in IBU. Dit wordt automatisch berekend."});$("#est_ibu2").jqxNumberInput(Smal0dec);$("#hop_flavour").jqxProgressBar({width:300,height:23,theme:theme,showText:true,animationDuration:0,colorRanges:[{stop:20,color:"#004D00"},{stop:40,color:"#008C00"},{stop:60,color:"#00BF00"},{stop:80,color:"#00FF00"},{stop:100,color:"#80FF80"}],renderText:function(C){var B=parseInt(C);if(B<20){return"Weinig"}else{if(B<40){return"Matig"}else{if(B<60){return"Redelijk"}else{if(B<80){return"Veel"}else{return"Zeer veel"}}}}}});$("#hop_aroma").jqxProgressBar({width:300,height:23,theme:theme,showText:true,animationDuration:0,colorRanges:[{stop:20,color:"#004D00"},{stop:40,color:"#008C00"},{stop:60,color:"#00BF00"},{stop:80,color:"#00FF00"},{stop:100,color:"#80FF80"}],renderText:function(C){var B=parseInt(C);if(B<20){return"Weinig"}else{if(B<40){return"Matig"}else{if(B<60){return"Redelijk"}else{if(B<80){return"Veel"}else{return"Zeer veel"}}}}}});$("#popupHop").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#HopReady"),modalOpacity:0.4});$("#HopReady").jqxButton({template:"success",width:"90px",theme:theme});$("#HopReady").click(function(){var C,B=$("#hopGrid").jqxGrid("getrowid",o);console.log("HopReady row:"+o+" ID:"+B);C={h_name:$("#wh_name").val(),h_origin:t.h_origin,h_amount:parseFloat($("#wh_amount").jqxNumberInput("decimal"))/1000,h_cost:t.h_cost,h_type:t.h_type,h_form:t.h_form,h_useat:$("#wh_useat").val(),h_time:t.h_time,h_alpha:t.h_alpha,h_beta:t.h_beta,h_hsi:t.h_hsi,h_humulene:t.h_humulene,h_caryophyllene:t.h_caryophyllene,h_cohumulone:t.h_cohumulone,h_myrcene:t.h_myrcene,h_total_oil:t.h_total_oil,h_inventory:t.h_inventory,h_avail:t.h_avail};$("#hopGrid").jqxGrid("updaterow",B,C);calcIBUs()});$("#wh_name").jqxInput({theme:theme,width:320,height:23});$("#wh_instock").jqxCheckBox({theme:theme,height:23});$("#wh_instock").on("change",function(B){hopinstock=B.args.checked;hoplist.dataBind()});$("#wh_select").jqxDropDownList({placeHolder:"Kies hop:",theme:theme,source:hoplist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(C,B,E){var D=hoplist.records[C];return D.origin+" / "+D.name+" ("+D.alpha+" % &alpha;)"}});$("#wh_select").on("select",function(D){if(D.args){var C,B=D.args.index;C=hoplist.records[B];$("#wh_name").val(C.name);t.h_name=C.name;t.h_origin=C.origin;t.h_cost=C.cost;t.h_type=C.type;t.h_form=C.form;t.h_alpha=C.alpha;t.h_beta=C.beta;t.h_hsi=C.hsi;t.h_humulene=C.humulene;t.h_caryophyllene=C.caryophyllene;t.h_cohumulone=C.cohumulone;t.h_myrcene=C.myrcene;t.h_total_oil=C.total_oil;t.h_inventory=C.inventory}});$("#wh_amount").jqxNumberInput(Spin1dec);$("#wh_amount").on("change",function(C){var D,B=parseFloat(C.args.value)/1000;D=toIBU(t.h_useat,t.h_form,preboil_sg,parseFloat($("#batch_size").jqxNumberInput("decimal")),B,parseFloat(t.h_time),parseFloat(t.h_alpha),$("#ibu_method").val());t.h_amount=B;console.log("amount changed: "+C.args.value+" time:"+t.h_time+" alpha:"+t.h_alpha+" IBU:"+D);$("#wh_ibu").val(D)});$("#wh_ibu").jqxNumberInput(Show1dec);$("#wh_time").jqxNumberInput(PosInt);$("#wh_time").on("change",function(B){var D,C=parseFloat(B.args.value);if(t.h_useat==2){if(C>parseFloat($("#boil_time").jqxNumberInput("decimal"))){C=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wh_time").val(C)}t.h_time=C}else{if(t.h_useat==4){if(C>120){C=120;$("#wh_time").val(C)}t.h_time=C}else{if(t.h_useat==5){if(C>21){C=21;$("#wh_time").val(C)}t.h_time=C*1440}}}D=toIBU(t.h_useat,t.h_form,preboil_sg,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(t.h_amount),parseFloat(t.h_time),parseFloat(t.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(D)});$("#wh_useat").jqxDropDownList({theme:theme,source:HopUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wh_useat").on("select",function(C){if(C.args){var B=C.args.index;t.h_useat=B;if((B==0)||(B==1)){t.h_time=parseFloat(dataRecord.boil_time);$("#wh_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wh_time").val(t.h_time)}else{if(B==3){t.h_time=0;$("#wh_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wh_time").val(0)}else{$("#wh_time").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}}if(B==5){$("#wh_pmpt_time").html("Tijd in dagen")}else{$("#wh_pmpt_time").html("Tijd in minuten")}}});$("#popupMisc").jqxWindow({width:800,height:275,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#MiscReady"),modalOpacity:0.4});$("#MiscReady").jqxButton({template:"success",width:"90px",theme:theme});$("#MiscReady").click(function(){var C,B=$("#miscGrid").jqxGrid("getrowid",q);console.log("MiscReady row:"+q+" ID:"+B);C={m_name:p.m_name,m_amount:p.m_amount,m_cost:p.m_cost,m_type:p.m_type,m_use_use:p.m_use_use,m_time:p.m_time,m_amount_is_weight:p.m_amount_is_weight,m_inventory:p.m_inventory,m_avail:p.m_avail};$("#miscGrid").jqxGrid("updaterow",B,C)});$("#wm_name").jqxInput({theme:theme,width:320,height:23});$("#wm_instock").jqxCheckBox({theme:theme,height:23});$("#wm_instock").on("change",function(B){miscinstock=B.args.checked;misclist.dataBind()});$("#wm_select").jqxDropDownList({placeHolder:"Kies ingredi&euml;nt:",theme:theme,source:misclist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500});$("#wm_select").on("select",function(D){if(D.args){var C,B=D.args.index;C=misclist.records[B];$("#wm_name").val(C.name);p.m_name=C.name;p.m_cost=C.cost;p.m_type=C.type;p.m_use_use=C.use_use;p.m_amount_is_weight=C.amount_is_weight;p.m_inventory=C.inventory}});$("#wm_amount").jqxNumberInput(Spin1dec);$("#wm_amount").on("change",function(B){console.log("amount changed: "+B.args.value);p.m_amount=parseFloat(B.args.value)/1000});$("#wm_time").jqxNumberInput(PosInt);$("#wm_time").on("change",function(B){console.log("time changed: "+B.args.value);var C=parseFloat(B.args.value);if(p.m_use_use==2){if(C>parseFloat($("#boil_time").jqxNumberInput("decimal"))){C=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wm_time").val(C)}p.m_time=C}else{if((p.m_use_use==3)||(p.m_use_use==4)){if(C>21){C=21;$("#wm_time").val(C)}p.m_time=C*1440}}});$("#wm_use_use").jqxDropDownList({theme:theme,source:MiscUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wm_use_use").on("select",function(C){if(C.args){var B=C.args.index;p.m_use_use=B;if((B==2)||(B==3)||(B==4)){$("#wm_time").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}else{p.m_time=0;$("#wm_time").jqxNumberInput({spinButtons:false,readOnly:true,width:90});$("#wm_time").val(0)}}});$("#est_fg2").jqxTooltip({content:"Het eind SG. Dit wordt automatisch berekend."});$("#est_fg2").jqxNumberInput(Show3dec);$("#est_abv2").jqxTooltip({content:"Alcohol volume %. Dit wordt automatisch berekend."});$("#est_abv2").jqxNumberInput(Smal1dec);$("#popupYeast").jqxWindow({width:800,height:300,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#YeastReady"),modalOpacity:0.4});$("#YeastReady").jqxButton({template:"success",width:"90px",theme:theme});$("#YeastReady").click(function(){var C,B=$("#yeastGrid").jqxGrid("getrowid",c);console.log("YeastReady row:"+c+" ID:"+B);C={y_name:g.y_name,y_laboratory:g.y_laboratory,y_product_id:g.y_product_id,y_amount:g.y_amount,y_cost:g.y_cost,y_type:g.y_type,y_form:g.y_form,y_flocculation:g.y_flocculation,y_min_temperature:g.y_min_temperature,y_max_temperature:g.y_max_temperature,y_attenuation:g.y_attenuation,y_use:g.y_use,y_cells:g.y_cells,y_tolerance:g.y_tolerance,y_inventory:g.y_inventory,y_avail:g.y_avail};$("#yeastGrid").jqxGrid("updaterow",B,C);calcFermentables()});$("#wy_name").jqxInput({theme:theme,width:320,height:23});$("#wy_laboratory").jqxInput({theme:theme,width:320,height:23});$("#wy_product_id").jqxInput({theme:theme,width:320,height:23});$("#wy_instock").jqxCheckBox({theme:theme,height:23});$("#wy_instock").on("change",function(B){yeastinstock=B.args.checked;yeastlist.dataBind()});$("#wy_select").jqxDropDownList({placeHolder:"Kies gist:",theme:theme,source:yeastlist,displayMember:"name",width:150,height:23,dropDownWidth:500,dropDownHeight:500,renderer:function(C,B,E){var D=yeastlist.records[C];return D.laboratory+" "+D.product_id+" "+D.name}});$("#wy_select").on("select",function(D){if(D.args){var C,B=D.args.index;C=yeastlist.records[B];$("#wy_name").val(C.name);$("#wy_laboratory").val(C.laboratory);$("#wy_product_id").val(C.product_id);g.y_name=C.name;g.y_cost=C.cost;g.y_type=C.type;g.y_form=C.form;g.y_laboratory=C.laboratory;g.y_product_id=C.product_id;g.y_min_temperature=C.min_temperature;g.y_max_temperature=C.max_temperature;g.y_flocculation=C.flocculation;g.y_attenuation=C.attenuation;g.y_cells=C.cells;g.y_inventory=C.inventory;if(g.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):")}else{if(g.y_form==1){$("#wy_pmpt_amount").html("Gewicht gram:")}else{$("#wy_pmpt_amount").html("Volume ml:")}}calcFermentables()}});$("#wy_amount").jqxNumberInput(Spin1dec);$("#wy_amount").on("change",function(C){console.log("amount changed: "+C.args.value);var B;if(g.y_form==0){B=parseFloat(C.args.value)}else{B=parseFloat(C.args.value)/1000}g.y_amount=B;calcFermentables()});$("#wy_use").jqxDropDownList({theme:theme,source:YeastUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wy_use").on("select",function(C){if(C.args){var B=C.args.index;g.y_use=B;calcFermentabes()}});$("#mash_name").jqxInput({theme:theme,width:320,height:23});$("#mash_select").jqxDropDownList({placeHolder:"Kies schema:",theme:theme,source:mashlist,displayMember:"name",width:250,height:23,dropDownWidth:500,dropDownHeight:500,dropDownHorizontalAlignment:"right"});$("#mash_select").on("select",function(F){if(F.args){var H,E,D,I,G,B,C=F.args.index;B=new Array();G=$("#mashGrid").jqxGrid("getdisplayrows");for(D=0;D<G.length;D++){I=G[D];B.push(I.uid)}$("#mashGrid").jqxGrid("deleterow",B);E=mashlist.records[C];$("#mash_name").val(E.name);for(D=0;D<E.steps.length;D++){H=E.steps[D];I={};I.step_name=H.step_name;I.step_type=H.step_type;if(mash_infuse==0&&dataRecord.w1_amount>0){mash_infuse=dataRecord.w1_amount}if(D==0){I.step_infuse_amount=mash_infuse}else{I.step_infuse_amount=0}I.step_temp=H.step_temp;if(mashkg>0){I.step_thickness=parseFloat(mash_infuse/mashkg)}else{I.step_thickness=0}I.end_temp=H.end_temp;I.step_time=H.step_time;I.ramp_time=H.ramp_time;$("#mashGrid").jqxGrid("addrow",null,I)}}});$("#popupMash").jqxWindow({width:800,height:350,position:{x:230,y:100},resizable:false,theme:theme,isModal:true,autoOpen:false,cancelButton:$("#MashReady"),modalOpacity:0.4});$("#MashReady").jqxButton({template:"success",width:"90px",theme:theme});$("#MashReady").click(function(){calcMash()});$("#wstep_name").jqxInput({theme:theme,width:320,height:23});$("#wstep_name").on("change",function(B){var C=$("#mashGrid").jqxGrid("getrowdata",l);C.step_name=B.args.value});$("#wstep_type").jqxDropDownList({theme:theme,source:MashStepTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#wstep_type").on("select",function(D){if(D.args){var G,E,C,F,B=D.args.index;G=$("#mashGrid").jqxGrid("getrowdata",l);G.step_type=B;if(B==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{G.step_infuse_amount=0;$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}mash_infuse=0;E=$("#mashGrid").jqxGrid("getrows");for(C=0;C<E.length;C++){F=E[C];if(F.step_type==0){mash_infuse+=parseFloat(F.step_infuse_amount)}}}});$("#wstep_temp").jqxNumberInput(Spin1dec);$("#wstep_temp").on("change",function(B){var C=$("#mashGrid").jqxGrid("getrowdata",l);C.step_temp=parseFloat(B.args.value)});$("#wend_temp").jqxNumberInput(Spin1dec);$("#wend_temp").on("change",function(B){var C=$("#mashGrid").jqxGrid("getrowdata",l);C.end_temp=parseFloat(B.args.value)});$("#wstep_time").jqxNumberInput(PosInt);$("#wstep_time").on("change",function(B){var C=$("#mashGrid").jqxGrid("getrowdata",l);C.step_time=parseFloat(B.args.value)});$("#wramp_time").jqxNumberInput(PosInt);$("#wramp_time").on("change",function(B){var C=$("#mashGrid").jqxGrid("getrowdata",l);C.ramp_time=parseFloat(B.args.value)});$("#wstep_infuse_amount").jqxNumberInput(Spin1dec);$("#wstep_infuse_amount").on("change",function(C){var B,D,E,F=$("#mashGrid").jqxGrid("getrowdata",l);F.step_infuse_amount=parseFloat(C.args.value);mash_infuse=0;D=$("#mashGrid").jqxGrid("getrows");for(B=0;B<D.length;B++){E=D[B];if(E.step_type==0){mash_infuse+=parseFloat(E.step_infuse_amount)}}if(dataRecord.w2_amount==0){dataRecord.w1_amount=mash_infuse;$("#w1_amount").val(mash_infuse)}else{dataRecord.w1_amount=(dataRecord.w1_amount/(dataRecord.w1_amount+dataRecord.w2_amount))*mash_infuse;dataRecord.w2_amount=(dataRecord.w2_amount/(dataRecord.w1_amount+dataRecord.w2_amount))*mash_infuse;$("#w1_amount").val(dataRecord.w1_amount);$("#w2_amount").val(dataRecord.w2_amount)}$("#wg_amount").val(mash_infuse)});$("#tgt_bu").jqxNumberInput(Show2wat);$("#tgt_cl_so4").jqxNumberInput(Show1wat);$("#got_cl_so4").jqxNumberInput(Show1wat);$("#w1_name").jqxDropDownList({placeHolder:"Kies hoofd water:",theme:theme,source:waterlist,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:400});$("#w1_name").on("select",function(D){if(D.args){var C,B=D.args.index;C=waterlist.records[B];dataRecord.w1_name=C.name;$("#w1_calcium").val(C.calcium);dataRecord.w1_calcium=C.calcium;$("#w1_sulfate").val(C.sulfate);dataRecord.w1_sulfate=C.sulfate;$("#w1_chloride").val(C.chloride);dataRecord.w1_chloride=C.chloride;$("#w1_sodium").val(C.sodium);dataRecord.w1_sodium=C.sodium;$("#w1_magnesium").val(C.magnesium);dataRecord.w1_magnesium=C.magnesium;$("#w1_total_alkalinity").val(C.total_alkalinity);dataRecord.w1_total_alkalinity=C.total_alkalinity;$("#w1_ph").val(C.ph);dataRecord.w1_ph=C.ph;$("#w1_cost").val(C.cost);dataRecord.w1_cost=C.cost;m()}});$("#w1_amount").jqxNumberInput(Show1wat);$("#w1_calcium").jqxNumberInput(Show1wat);$("#w1_magnesium").jqxNumberInput(Show1wat);$("#w1_sodium").jqxNumberInput(Show1wat);$("#w1_total_alkalinity").jqxNumberInput(Show1wat);$("#w1_chloride").jqxNumberInput(Show1wat);$("#w1_sulfate").jqxNumberInput(Show1wat);$("#w1_ph").jqxNumberInput(Show1wat);$("#w2_name").jqxDropDownList({placeHolder:"Kies meng water:",theme:theme,source:waterlist,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:400});$("#w2_name").on("select",function(D){if(D.args){var C,B=D.args.index;C=waterlist.records[B];dataRecord.w2_name=C.name;$("#w2_calcium").val(C.calcium);dataRecord.w2_calcium=C.calcium;$("#w2_sulfate").val(C.sulfate);dataRecord.w2_sulfate=C.sulfate;$("#w2_chloride").val(C.chloride);dataRecord.w2_chloride=C.chloride;$("#w2_sodium").val(C.sodium);dataRecord.w2_sodium=C.sodium;$("#w2_magnesium").val(C.magnesium);dataRecord.w2_magnesium=C.magnesium;$("#w2_total_alkalinity").val(C.total_alkalinity);dataRecord.w2_total_alkalinity=C.total_alkalinity;$("#w2_ph").val(C.ph);dataRecord.w2_ph=C.ph;$("#w2_cost").val(C.cost);dataRecord.w2_cost=C.cost;$("#w2_amount").jqxNumberInput({max:100000,readOnly:false});m()}});$("#w2_amount").jqxTooltip({content:"De verdeling van het hoofd en meng water. Het totale maisch water volume blijft gelijk."});$("#w2_amount").jqxNumberInput({inputMode:"simple",theme:theme,width:94,height:23,min:0,decimalDigits:1,spinButtons:true,readOnly:true});$("#w2_calcium").jqxNumberInput(Show1wat);$("#w2_magnesium").jqxNumberInput(Show1wat);$("#w2_sodium").jqxNumberInput(Show1wat);$("#w2_total_alkalinity").jqxNumberInput(Show1wat);$("#w2_chloride").jqxNumberInput(Show1wat);$("#w2_sulfate").jqxNumberInput(Show1wat);$("#w2_ph").jqxNumberInput(Show1wat);$("#wg_amount").jqxNumberInput(Show1wat);$("#wg_calcium").jqxNumberInput(Show1wat);$("#wg_magnesium").jqxNumberInput(Show1wat);$("#wg_sodium").jqxNumberInput(Show1wat);$("#wg_total_alkalinity").jqxNumberInput(Show1wat);$("#wg_chloride").jqxNumberInput(Show1wat);$("#wg_sulfate").jqxNumberInput(Show1wat);$("#wg_ph").jqxNumberInput(Show1wat);$("#wb_calcium").jqxTooltip({content:"De ideale hoeveelheid Calcium is tussen 40 en 150."});$("#wb_calcium").jqxNumberInput(Show1wat);$("#wb_magnesium").jqxTooltip({content:"De ideale hoeveelheid Magnesium is lager dan 30."});$("#wb_magnesium").jqxNumberInput(Show1wat);$("#wb_sodium").jqxTooltip({content:"De ideale hoeveelheid Natrium is lager dan 150."});$("#wb_sodium").jqxNumberInput(Show1wat);$("#wb_chloride").jqxTooltip({content:"De ideale hoeveelheid Chloride is tussen 50 en 100."});$("#wb_chloride").jqxNumberInput(Show1wat);$("#wb_sulfate").jqxTooltip({content:"De ideale hoeveelheid Sulfaat is tussen 50 en 350."});$("#wb_sulfate").jqxNumberInput(Show1wat);$("#wb_total_alkalinity").jqxNumberInput(Show1wat);$("#wb_ph").jqxNumberInput(Show1wat);$("#pr_name").jqxDropDownList({placeHolder:"Kies doel profiel:",theme:theme,source:waterprofiles,displayMember:"name",width:250,height:27,dropDownWidth:400,dropDownHeight:300});$("#pr_name").on("select",function(D){if(D.args){var C,B=D.args.index;C=waterprofiles.records[B];$("#pr_calcium").val(C.calcium);$("#pr_sulfate").val(C.sulfate);$("#pr_chloride").val(C.chloride);$("#pr_sodium").val(C.sodium);$("#pr_magnesium").val(C.magnesium);$("#pr_total_alkalinity").val(C.total_alkalinity)}});$("#pr_calcium").jqxNumberInput(Show1wat);$("#pr_magnesium").jqxNumberInput(Show1wat);$("#pr_sodium").jqxNumberInput(Show1wat);$("#pr_total_alkalinity").jqxNumberInput(Show1wat);$("#pr_chloride").jqxNumberInput(Show1wat);$("#pr_sulfate").jqxNumberInput(Show1wat);$("#wa_cacl2").jqxTooltip({content:"Voor het maken van een ander waterprofiel. Voegt calcium en chloride toe. Voor het verbeteren van zoetere bieren."});$("#wa_cacl2").jqxNumberInput(Spin1dec);$("#wa_caso4").jqxTooltip({content:"Gips. Voor het maken van een ander waterprofiel. Voegt calcium en sulfaat toe. Voor het verbeteren van bittere bieren."});$("#wa_caso4").jqxNumberInput(Spin1dec);$("#wa_mgso4").jqxTooltip({content:"Epsom zout. Voor het maken van een ander waterprofiel. Voegt magnesium en sulfaat toe. Gebruik spaarzaam!"});$("#wa_mgso4").jqxNumberInput(Spin1dec);$("#wa_nacl").jqxTooltip({content:"Keukenzout. Voor het maken van een ander waterprofiel. Voegt natrium en chloride toe. Voor het accentueren van zoetheid. Bij hoge dosering wordt het bier ziltig."});$("#wa_nacl").jqxNumberInput(Spin1dec);$("#mash_ph").jqxTooltip({content:"Maisch pH tussen 5.2 en 5.6. Gebruik 5.2 voor lichte en 5.5 voor donkere bieren."});$("#mash_ph").jqxNumberInput(SpinpH);$("#calc_acid").jqxCheckBox({theme:theme,width:120,height:23});$("#wa_base_name").jqxDropDownList({theme:theme,source:BaseTypeAdapter,valueMember:"id",displayMember:"nl",width:170,height:23,autoDropDownHeight:true});$("#wa_base").jqxNumberInput(Spin2dec);$("#wa_base").jqxNumberInput({symbol:" gr",symbolPosition:"right"});$("#wa_acid_name").jqxDropDownList({theme:theme,source:AcidTypeAdapter,valueMember:"id",displayMember:"nl",width:170,height:23,autoDropDownHeight:true});$("#wa_acid").jqxNumberInput(Spin2dec);$("#wa_acid").jqxNumberInput({symbol:" ml",symbolPosition:"right"});$("#wa_acid_perc").jqxNumberInput(Perc0);$("#wa_acid_perc").jqxNumberInput({width:70,symbol:"%",symbolPosition:"right"});$("#sparge_temp").jqxNumberInput(Spin1dec);$("#sparge_volume").jqxNumberInput(Spin1dec);$("#sparge_ph").jqxNumberInput(SpinpH);$("#sparge_source").jqxDropDownList({theme:theme,source:SpargeSourceAdapter,valueMember:"id",displayMember:"nl",width:110,height:23,autoDropDownHeight:true});$("#sparge_acid_amount").jqxNumberInput(Spin2dec);$("#sparge_acid_amount").jqxNumberInput({spinButtons:false,readOnly:true,symbol:" ml",symbolPosition:"right"});$("#sparge_acid_type").jqxDropDownList({theme:theme,source:AcidTypeAdapter,valueMember:"id",displayMember:"nl",width:110,height:23,autoDropDownHeight:true});$("#sparge_acid_perc").jqxNumberInput(Perc0);$("#sparge_acid_perc").jqxNumberInput({symbol:"%",symbolPosition:"right"});$("#jqxTabs").jqxTabs({theme:theme,width:1280,height:660,autoHeight:false,position:"top"});$("#Export").jqxButton({template:"info",width:"80px",theme:theme});$("#Export").bind("click",function(){d(0)});$("#Delete").jqxButton({template:"danger",width:"80px",theme:theme});$("#Delete").bind("click",function(){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var B="delete=true&"+$.param({record:my_record});$.ajax({dataType:"json",url:f,cache:false,data:B,type:"POST",success:function(D,C,E){window.location.href=my_return},error:function(C,E,D){}})})});$("#Cancel").jqxButton({template:"primary",width:"80px",theme:theme});$("#Cancel").bind("click",function(){window.location.href=my_return});$("#Save").jqxButton({template:"success",width:"80px",theme:theme});$("#Save").bind("click",function(){d(1)});createDelElements()});
\ No newline at end of file
--- a/www/js/rec_export-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a=0;$("#name").html(my_name);$("#jqxRadioButton1").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton2").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton3").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton4").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton5").jqxRadioButton({theme:theme,width:250,height:23});$("#jqxRadioButton1").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=1});$("#jqxRadioButton2").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=2});$("#jqxRadioButton3").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=3});$("#jqxRadioButton4").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=4});$("#jqxRadioButton5").on("checked",function(b){$("#Start").jqxButton({disabled:false});a=5});$("#Start").jqxButton({template:"success",width:"100px",theme:theme,disabled:true});$("#Start").click(function(){if(a==1){window.open("rec_beerxml.php?record="+my_record)}else{if(a==2){window.open("rec_duplicate.php?record="+my_record)}else{if(a==3){window.open("rec_toproduct.php?record="+my_record)}else{if(a==4){window.open("rec_print.php?record="+my_record)}else{if(a==5){window.open("rec_forum.php?record="+my_record)}}}}}window.location.href="rec_edit.php?record="+my_record+"&return="+my_return})});
\ No newline at end of file
--- a/www/js/rec_import-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){$("#jqxFileUpload").jqxFileUpload({width:300,browseTemplate:"success",cancelTemplate:"inverse",uploadTemplate:"primary",theme:theme,multipleFilesUpload:false,accept:"application/xml",uploadUrl:"upl_recipe.php",fileInputName:"fileToUpload"});$("#eventsPanel").jqxPanel({width:800,height:200,theme:theme});$("#jqxFileUpload").on("select",function(c){var b=c.args,d=b.file,a=b.size;$("#eventsPanel").jqxPanel("clearcontent");$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> "+d+"  size: "+a+"<br />")});$("#jqxFileUpload").on("uploadEnd",function(c){var b=c.args,d=b.file,a=b.response;$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> ontvangen "+d+"<br />"+a+"<br />")})});
\ No newline at end of file
--- a/www/js/rec_main-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"name",type:"string"},{name:"est_og",type:"float"},{name:"est_color",type:"float"},{name:"est_ibu",type:"float"},{name:"est_abv",type:"float"},],id:"record",url:"includes/db_recipes.php"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,groupable:true,theme:theme,showstatusbar:true,renderstatusbar:function(e){var d,c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");d=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:100,height:20});d.click(function(f){window.location.href="rec_new.php?return=rec_main.php"})},filterable:true,filtermode:"excel",columns:[{text:"Stijlgids",datafield:"st_guide",width:120},{text:"Letter",datafield:"st_letter",width:60},{text:"Stijl",datafield:"st_name",width:160},{text:"Naam",datafield:"name"},{text:"OG",datafield:"est_og",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"EBC",datafield:"est_color",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"IBU",datafield:"est_ibu",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"ABV",datafield:"est_abv",width:60,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"",datafield:"Edit",width:120,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(d){var c=b.records[d];window.location.href="rec_edit.php?record="+c.record+"&return=rec_main.php"}}],groups:["st_guide","st_letter"]})});
\ No newline at end of file
--- a/www/js/rec_new-min.js	Fri Oct 18 13:09:37 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$(document).ready(function(){var a=2,b=0,c=(function(){var d=function(){$("#name").on("change",function(e){c.validate(true)});$("#type").on("change",function(e){c.validate(true)});$("#boil_time").on("change",function(e){c.validate(true)});$("#est_og").on("change",function(e){c.validate(true)});$("#efficiency").on("change",function(e){c.validate(true)});$("#styleSelect").on("change",function(e){c.validate(true)});$("#nextButtonCompleted").click(function(){console.log("insert start");var f={record:-1,locked:0,name:$("#name").val(),notes:$("#notes").val(),st_name:$("#st_name").val(),st_letter:$("#st_style_letter").val(),st_guide:$("#st_style_guide").val(),st_category:$("#st_category").val(),st_category_number:parseFloat($("#st_category_number").jqxNumberInput("decimal")),st_type:b,st_og_min:parseFloat($("#st_og_min").jqxNumberInput("decimal")),st_og_max:parseFloat($("#st_og_max").jqxNumberInput("decimal")),st_fg_min:parseFloat($("#st_fg_min").jqxNumberInput("decimal")),st_fg_max:parseFloat($("#st_fg_max").jqxNumberInput("decimal")),st_ibu_min:parseFloat($("#st_ibu_min").jqxNumberInput("decimal")),st_ibu_max:parseFloat($("#st_ibu_max").jqxNumberInput("decimal")),st_color_min:parseFloat($("#st_color_min").jqxNumberInput("decimal")),st_color_max:parseFloat($("#st_color_max").jqxNumberInput("decimal")),st_carb_min:parseFloat($("#st_carb_min").jqxNumberInput("decimal")),st_carb_max:parseFloat($("#st_carb_max").jqxNumberInput("decimal")),st_abv_min:parseFloat($("#st_abv_min").jqxNumberInput("decimal")),st_abv_max:parseFloat($("#st_abv_max").jqxNumberInput("decimal")),type:a,batch_size:20,boil_size:22,boil_time:parseFloat($("#boil_time").jqxNumberInput("decimal")),efficiency:parseFloat($("#efficiency").jqxNumberInput("decimal")),est_og:parseFloat($("#est_og").jqxNumberInput("decimal")),est_fg:1,est_color:0,est_abv:0,est_carb:0,color_method:0,est_ibu:0,ibu_method:0,mash_name:"",mash_ph:5.4,sparge_temp:85,sparge_volume:12,sparge_ph:5.8,sparge_source:0,sparge_acid_type:0,sparge_acid_perc:80,sparge_acid_amount:0,calc_acid:true,w1_name:"Tap water",w1_amount:15,w1_calcium:0,w1_sulfate:0,w1_chloride:0,w1_sodium:0,w1_magnesium:0,w1_total_alkalinity:0,w1_ph:7,w1_cost:0,wa_acid_name:0,wa_acid_perc:80,wa_base_name:0},e="insert=true&return="+my_return+"&"+$.param(f);$.ajax({dataType:"json",url:"includes/db_recipes.php",cache:false,data:e,type:"POST",success:function(h,g,i){window.location.href=my_return},error:function(g,i,h){}})});$(".nextButton").click(function(){c.validate(true);$("#jqxTabs").jqxTabs("next")});$(".backButton").click(function(){c.validate(true);$("#jqxTabs").jqxTabs("previous")})};return{init:function(){$("#jqxTabs").jqxTabs({theme:theme,height:630,width:1280,autoHeight:false,position:"top",keyboardNavigation:false});$("#nextButtonBase").jqxButton({theme:theme,width:150});$("#nextButtonStyle").jqxButton({theme:theme,width:150});$("#backButtonStyle").jqxButton({theme:theme,template:"success",width:150});$("#nextButtonCompleted").jqxButton({theme:theme,template:"success",width:150});$("#backButtonCompleted").jqxButton({theme:theme,template:"success",width:150});d();this.validate();this.showHint("Vul de nodige gegevens in.")},validate:function(e){if(!this.firstTab(e)){$("#jqxTabs").jqxTabs("disableAt",1);$("#jqxTabs").jqxTabs("disableAt",2);return}else{$("#jqxTabs").jqxTabs("enableAt",1)}if(!this.secondTab(e)){$("#jqxTabs").jqxTabs("disableAt",2);return}else{$("#jqxTabs").jqxTabs("enableAt",2)}},showHint:function(f,e){if(typeof e==="undefined"){e=".hint"}if(f===""){f="Ok, je mag doorgaan."}$(e).html("<strong>"+f+"</strong>")},firstTab:function(h){var g=$("#name").val(),j=$("#type").val(),e=parseFloat($("#boil_time").jqxNumberInput("decimal")),f=parseFloat($("#est_og").jqxNumberInput("decimal")),i=parseFloat($("#efficiency").jqxNumberInput("decimal")),k="";if(g.length<3){k+="Je moet een recept naam invullen. <br />"}if(j.length<1){k+="Je moet een brouw type kiezen. <br />"}if((e<4)||(e>360)){k+="De kooktijd moet tussen 4 en 360 minuten zijn. <br />"}if((f<1.01)||(f>1.2)){k+="Het OG moet tussen 1.010 en 1.200 zijn. <br />"}if((i<35)||(i>95)){k+="Het brouwzaal rendement moet tussen 35 en 95 zijn. <br />"}if(k!==""){if(h){this.showHint(k,"#hintBase")}return false}this.showHint("Ok, je mag doorgaan.","#hintBase");$("#nextButtonBase").jqxButton({template:"success"});return true},secondTab:function(f){var e=$("#styleSelect").val(),g="";if(e.length<3){g+="Je moet een bierstijl kiezen. <br />"}if(g!==""){if(f){this.showHint(g,"#hintStyle")}return false}this.showHint("Ok, je mag doorgaan.","#hintStyle");$("#nextButtonStyle").jqxButton({template:"success"});return true}}}());$("#name").jqxTooltip({content:"De naam voor dit recept."});$("#name").jqxInput({theme:theme,width:640,height:23});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit recept."});$("#notes").jqxInput({theme:theme,width:960,height:200});$("#type").jqxDropDownList({theme:theme,source:RecipeTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#type").jqxDropDownList("selectItem",2);$("#type").on("select",function(d){if(d.args){a=d.args.index}});$("#boil_time").jqxNumberInput(PosInt);$("#boil_time").jqxNumberInput({min:4,max:360});$("#efficiency").jqxNumberInput(Perc0);$("#est_og").jqxNumberInput(SGopts);$("#boil_time").val(90);$("#efficiency").val(75);$("#est_og").val(1.052);$("#st_name").jqxInput({theme:theme,width:250,height:23});$("#st_category").jqxInput({theme:theme,width:250,height:23});$("#st_category_number").jqxInput({theme:theme,width:70,height:23});$("#st_style_letter").jqxInput({theme:theme,width:250,height:23});$("#st_style_guide").jqxInput({theme:theme,width:250,height:23});$("#st_notes").jqxInput({theme:theme,width:800,height:100});$("#st_type").jqxInput({theme:theme,width:250,height:23});$("#st_og_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_og_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_fg_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_fg_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:3,readOnly:true});$("#st_ibu_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true});$("#st_ibu_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true});$("#st_color_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true});$("#st_color_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true});$("#st_carb_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true});$("#st_carb_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true});$("#st_abv_min").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true});$("#st_abv_max").jqxNumberInput({inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true});$("#st_profile").jqxInput({theme:theme,width:800,height:48});$("#st_ingredients").jqxInput({theme:theme,width:800,height:23});$("#st_examples").jqxInput({theme:theme,width:800,height:48});$("#styleSelect").jqxDropDownList({placeHolder:"Kies bierstijl:",theme:theme,source:styleslist,displayMember:"name",width:250,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(e,d,g){var f=styleslist.records[e];return f.style_guide+" "+f.style_letter+" "+f.name}});$("#styleSelect").on("select",function(f){if(f.args){var e,d=f.args.index;e=styleslist.records[d];$("#st_name").val(e.name);$("#st_category").val(e.category);$("#st_category_number").val(e.category_number);$("#st_style_letter").val(e.style_letter);$("#st_style_guide").val(e.style_guide);b=e.type;$("#st_type").val(StyleTypeData[e.type].nl);$("#st_og_min").val(e.og_min);$("#st_og_max").val(e.og_max);$("#st_fg_min").val(e.fg_min);$("#st_fg_max").val(e.fg_max);$("#st_ibu_min").val(e.ibu_min);$("#st_ibu_max").val(e.ibu_max);$("#st_color_min").val(e.color_min);$("#st_color_max").val(e.color_max);$("#st_carb_min").val(e.carb_min);$("#st_carb_max").val(e.carb_max);$("#st_abv_min").val(e.abv_min);$("#st_abv_max").val(e.abv_max);$("#st_notes").val(e.notes);$("#st_profile").val(e.profile);$("#st_ingredients").val(e.ingredients);$("#st_examples").val(e.examples)}});c.init()});
\ No newline at end of file

mercurial