Switched to compressed javascript and css files using the yui-compressor

Thu, 05 Sep 2019 20:14:16 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 05 Sep 2019 20:14:16 +0200
changeset 463
0efdafd23753
parent 462
c91175610f8a
child 464
fbd2a7cecaaa

Switched to compressed javascript and css files using the yui-compressor

www/Makefile file | annotate | diff | comparison | revisions
www/css/style-min.css file | annotate | diff | comparison | revisions
www/css/style.css 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/global.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/jquery-1.11.1.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_fermentation-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_edit-min.js file | annotate | diff | comparison | revisions
www/js/prod_edit.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_water-min.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	Thu Sep 05 14:43:04 2019 +0200
+++ b/www/Makefile	Thu Sep 05 20:14:16 2019 +0200
@@ -25,17 +25,47 @@
 		  jqwidgets/styles/images/* jqwidgets/globalization/* js/* \
 		  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)
+
+
 
 #############################################################################
 
 .c.o:
 		${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<
 
-all:
+all:		minify-css minify-js
 
 clean:
 		rm -f version.php
 
+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 \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/css/style-min.css	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+body{background:#ccc;font-family:Verdana,Arial,sans-serif;margin:0}#MainPanel,#fermenter{width:1278px;height:628px;border:2px solid #4297d7;background:#252526;float:left;color:#eee}#water_totals{width:960px;background:#353536;margin-top:15px;border:1px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#propagator{width:800px;background:#353536;margin-top:15px;border:1px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#export_table,#about_table{width:960px;background:#353536;margin:150px;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#node_table{width:600px;background:#353536;margin:50px;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#fermenter_table{width:960px;height:210px;background:#252526;margin:5px;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}.ebccolor{float:left;margin-left:10px;width:75px;height:23px;border:1px solid #59b4d4;border-radius:6px;moz-border-radius:6px;webkit-border-radius:6px;background:#212121}#fermenter_thermometers{width:960px;height:390px;float:left;background-color:#252526;margin:5px;margin-top:3px;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#fermenter_panel_top{width:290px;height:100px;float:right;margin:5px;background-color:#252526;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#fermenter_doorled,#fermenter_lightled,#fermenter_alarmled,#fermenter_powerled{width:50px;height:30px;float:left;text-align:center;margin-top:15px;margin-left:20px}#fermenter_panel_display{width:290px;height:98px;float:right;margin:5px;margin-top:3px;background-color:#252526;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#fermenter_display{width:145px;height:98px;float:left;text-align:center}#fermenter_panel_control{width:290px;height:150px;float:right;margin:5px;margin-top:3px;background-color:#252526;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}#fermenter_led1,#fermenter_led2,#fermenter_led3{width:96px;height:30px;float:left;text-align:center;margin-top:13px}#fermenter_toggle1{float:left;margin-left:29px;margin-top:20px}#fermenter_toggle2,#fermenter_toggle3{float:left;margin-left:60px;margin-top:20px}#fermenter_panel_buttons{width:290px;height:227px;float:right;margin:5px;margin-top:3px;background-color:#252526;border:2px solid;border-color:#59b4d4;border-radius:5px 5px 5px 5px}.LEDred_on{margin:5px auto;width:18px;height:18px;background-color:#F40;border-radius:50%;box-shadow:#000 0 0 4px 1px,inset #C33 0 -1px 5px,#f44 0 2px 12px}.LEDred_off{margin:5px auto;width:18px;height:18px;background-color:#820;border-radius:50%;box-shadow:#400 0 0 1px 1px}.LEDyellow_on{margin:5px auto;width:18px;height:18px;background-color:#FF0;border-radius:50%;box-shadow:#000 0 0 4px 1px,inset #860 0 -1px 5px,#DD0 0 2px 12px}.LEDyellow_off{margin:5px auto;width:18px;height:18px;background-color:#A90;border-radius:50%;box-shadow:#440 0 0 1px 1px}.LEDgreen_on{margin:5px auto;width:18px;height:18px;background-color:#5E0;border-radius:50%;box-shadow:#000 0 0 4px 1px,inset #270 0 -1px 5px,#5D0 0 2px 12px}.LEDgreen_off{margin:5px auto;width:18px;height:18px;background-color:#270;border-radius:50%;box-shadow:#250 0 0 1px 1px}.LEDblue_on{margin:5px auto;width:18px;height:18px;background-color:#4AF;border-radius:50%;box-shadow:#000 0 0 4px 1px,inset #247 0 -1px 5px,#48F 0 2px 12px}.LEDblue_off{margin:5px auto;width:18px;height:18px;background-color:#137;border-radius:50%;box-shadow:#024 0 0 1px 1px}#hintBase,#hintStyle,#hintEq{float:left;margin-top:30px;margin-right:20px;padding:5px;width:600px;color:yellow}#section{margin:5px}#baseButtonsWrapper{float:right;margin-top:30px;margin-right:10px;width:160px}#styleButtonsWrapper{float:right;margin-top:30px;margin-right:10px;width:320px}#eqButtonsWrapper{float:right;margin-top:30px;margin-right:10px;width:320px}#completedButtonsWrapper{float:right;margin-right:10px;width:320px;margin-top:160px}.nextButton{float:right;margin-left:0}.backButton{float:left;margin-left:10px}
\ No newline at end of file
--- a/www/css/style.css	Thu Sep 05 14:43:04 2019 +0200
+++ b/www/css/style.css	Thu Sep 05 20:14:16 2019 +0200
@@ -1,4 +1,4 @@
-/*
+/* local style for bms web
  */
 
 body {
--- a/www/includes/global.inc.php	Thu Sep 05 14:43:04 2019 +0200
+++ b/www/includes/global.inc.php	Thu Sep 05 20:14:16 2019 +0200
@@ -117,7 +117,7 @@
  <head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title>BMS v<?php echo $my_version;?> - <?php echo $title;?></title>
-  <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />
+  <link type="text/css" href="css/style-min.css" rel="stylesheet" media="all" />
   <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />
   <link type="text/css" href="jqwidgets/styles/jqx.<?php echo $my_style; ?>.css" rel="stylesheet" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -182,7 +182,7 @@
   <script src="js/global.js"></script>
 <?php
 if (strlen($loadjs))
-    echo  '  <script src="js/'.$loadjs.'.js"></script>'.PHP_EOL;
+    echo  '  <script src="js/'.$loadjs.'-min.js"></script>'.PHP_EOL;
 ?>
  </head>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/global-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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"}];var StageSource={localdata:StageData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var StageAdapter=new $.jqx.dataAdapter(StageSource);var 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}];var MaterialSource={localdata:MaterialData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"sh"}]};var MaterialAdapter=new $.jqx.dataAdapter(MaterialSource);var 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"}];var FermentableTypeSource={localdata:FermentableTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var FermentableTypeAdapter=new $.jqx.dataAdapter(FermentableTypeSource);var 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"}];var GrainTypeSource={localdata:GrainTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var GrainTypeAdapter=new $.jqx.dataAdapter(GrainTypeSource);var 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"}];var AddedSource={localdata:AddedData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var AddedAdapter=new $.jqx.dataAdapter(AddedSource);var HopTypeData=[{id:0,en:"Bittering",nl:"Bitterhop"},{id:1,en:"Aroma",nl:"Aromahop"},{id:2,en:"Both",nl:"Beide"}];var HopTypeSource={localdata:HopTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var HopTypeAdapter=new $.jqx.dataAdapter(HopTypeSource);var 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"}];var HopFormSource={localdata:HopFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var HopFormAdapter=new $.jqx.dataAdapter(HopFormSource);var HopUseData=[{id:0,en:"Mash",nl:"Maischhop"},{id:1,en:"First wort",nl:"First wort hop"},{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"}];var HopUseSource={localdata:HopUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var HopUseAdapter=new $.jqx.dataAdapter(HopUseSource);var 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"}];var YeastTypeSource={localdata:YeastTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var YeastTypeAdapter=new $.jqx.dataAdapter(YeastTypeSource);var YeastFormData=[{id:0,en:"Liquid",nl:"Vloeibaar",cells:100000000000},{id:1,en:"Dry",nl:"Korrel",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}];var YeastFormSource={localdata:YeastFormData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]};var YeastFormAdapter=new $.jqx.dataAdapter(YeastFormSource);var 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"}];var YeastUseSource={localdata:YeastUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"},{name:"cells"}]};var YeastUseAdapter=new $.jqx.dataAdapter(YeastUseSource);var 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"}];var FlocculationSource={localdata:FlocculationData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var FlocculationAdapter=new $.jqx.dataAdapter(FlocculationSource);var StarterTypeData=[{id:0,en:"Stirred",nl:"Geroerd"},{id:1,en:"Shaken",nl:"Geschud"},{id:2,en:"Simple",nl:"Simpel"}];var StarterTypeSource={localdata:StarterTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var StarterTypeAdapter=new $.jqx.dataAdapter(StarterTypeSource);var 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:"Overig"}];var MiscTypeSource={localdata:MiscTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var MiscTypeAdapter=new $.jqx.dataAdapter(MiscTypeSource);var 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"}];var MiscUseSource={localdata:MiscUseData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var MiscUseAdapter=new $.jqx.dataAdapter(MiscUseSource);var 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"}];var StyleTypeSource={localdata:StyleTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var StyleTypeAdapter=new $.jqx.dataAdapter(StyleTypeSource);var MashStepTypeData=[{id:0,en:"Infusion",nl:"Infusie"},{id:1,en:"Temperature",nl:"Verwarming"},{id:2,en:"Decoction",nl:"Decoctie"}];var MashStepTypeSource={localdata:MashStepTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var MashStepTypeAdapter=new $.jqx.dataAdapter(MashStepTypeSource);var RecipeTypeData=[{id:0,en:"Extract",nl:"Extract"},{id:1,en:"Partial Mash",nl:"Deelmaisch"},{id:2,en:"All Grain",nl:"Mout"}];var RecipeTypeSource={localdata:RecipeTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var RecipeTypeAdapter=new $.jqx.dataAdapter(RecipeTypeSource);var IBUmethodData=[{id:0,en:"Tinseth",nl:"Tinseth"},{id:1,en:"Rager",nl:"Rager"},{id:2,en:"Daniels",nl:"Daniels"}];var IBUmethodSource={localdata:IBUmethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var IBUmethodAdapter=new $.jqx.dataAdapter(IBUmethodSource);var 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"}];var ColorMethodSource={localdata:ColorMethodData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var ColorMethodAdapter=new $.jqx.dataAdapter(ColorMethodSource);var 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"}];var CoolingTypeSource={localdata:CoolingTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var CoolingTypeAdapter=new $.jqx.dataAdapter(CoolingTypeSource);var AerationTypeData=[{id:0,en:"None",nl:"Geen"},{id:1,en:"Air",nl:"Lucht"},{id:2,en:"Oxygen",nl:"Zuurstof"}];var AerationTypeSource={localdata:AerationTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var AerationTypeAdapter=new $.jqx.dataAdapter(AerationTypeSource);var 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"}];var AcidTypeSource={localdata:AcidTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var AcidTypeAdapter=new $.jqx.dataAdapter(AcidTypeSource);var 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"}];var BaseTypeSource={localdata:BaseTypeData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var BaseTypeAdapter=new $.jqx.dataAdapter(BaseTypeSource);var SpargeSourceData=[{id:0,en:"Source 1",nl:"Bron 1"},{id:1,en:"Source 2",nl:"Bron 2"},{id:2,en:"Mixed",nl:"Gemengd"}];var SpargeSourceSource={localdata:SpargeSourceData,datatype:"array",datafields:[{name:"id"},{name:"en"},{name:"nl"}]};var SpargeSourceAdapter=new $.jqx.dataAdapter(SpargeSourceSource);var Show1wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:1,readOnly:true};var Show2wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:2,readOnly:true};var Show3wat={inputMode:"simple",theme:theme,width:74,height:23,decimalDigits:3,readOnly:true};var Smal0dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:0,readOnly:true};var Smal1dec={inputMode:"simple",theme:theme,width:50,height:23,decimalDigits:1,readOnly:true};var Show0dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:0};var Show1dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:1};var Show2dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:2};var Show3dec={inputMode:"simple",theme:theme,width:90,height:23,readOnly:true,decimalDigits:3};var SGopts={inputMode:"simple",theme:theme,width:110,height:23,min:0.99,max:1.199,decimalDigits:3,spinButtons:true};var Spin1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:1,spinButtons:true};var Spin2dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:2,spinButtons:true};var Spin3dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:3,spinButtons:true};var SpinpH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:1,spinButtons:true};var Spin2pH={inputMode:"simple",theme:theme,width:110,height:23,min:1,max:14,decimalDigits:2,spinButtons:true};var YeastT={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:40,decimalDigits:1,spinButtons:true};var PosInt={inputMode:"simple",theme:theme,width:110,height:23,min:0,decimalDigits:0,spinButtons:true};var Perc1dec={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:1,spinButtons:true};var Perc0={inputMode:"simple",theme:theme,width:110,height:23,min:0,max:100,decimalDigits:0,spinButtons:true};var Dateopts={theme:theme,width:150,height:23,allowNullDate:true,todayString:"Vandaag",clearString:"Wissen",showFooter:true,formatString:"yyyy-MM-dd",enableBrowserBoundsDetection:true};var 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};var sugardensity=1.611;var stylesUrl="includes/db_profile_styles.php";var 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:stylesUrl};var styleslist=new $.jqx.dataAdapter(stylesSource);var equipmentUrl="includes/db_inventory_equipments.php";var 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:equipmentUrl};var equipmentlist=new $.jqx.dataAdapter(equipmentSource);var 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"};var fermentableinstock=false;var fermentablelist=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.inventory||!fermentableinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var fermentablesugars=new $.jqx.dataAdapter(fermentableInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.type==1||d.type==3){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var 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"};var hopinstock=false;var hoplist=new $.jqx.dataAdapter(hopInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.inventory||!hopinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var 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"};var miscinstock=false;var misclist=new $.jqx.dataAdapter(miscInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.inventory||!miscinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var 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"};var yeastinstock=false;var yeastlist=new $.jqx.dataAdapter(yeastInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.inventory||!yeastinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var 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"};var waterinstock=false;var waterlist=new $.jqx.dataAdapter(waterInvSource,{beforeLoadComplete:function(a){var c=new Array();for(var b=0;b<a.length;b++){var d=a[b];if(d.inventory||d.unlimited_stock||!waterinstock){c.push(d)}}return c},loadError:function(c,a,b){console.log(a+" "+b)},});var 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"};var waterprofiles=new $.jqx.dataAdapter(waterProfileSource);var mashProfileSource={datatype:"json",datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"steps",type:"array"}],url:"includes/db_profile_mash.php"};var mashlist=new $.jqx.dataAdapter(mashProfileSource);$(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}var K1s=0.384;var K1a=-0.177;var K1e=0.241;var K1g=0.247;var Ks=0.1415;var Ka1=0.058;var Ka2=0.078;var Ke=0.174;var Kg=0.109;function A(e,d,b,g,f){var c=d*1000;var 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=c*1000;var 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}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=parseFloat(r);var n=parseFloat(q);var f=parseFloat(m)/100;var o=parseFloat(s)*1000;var i=parseFloat(e);var j=1;var k=1;var v=0;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}if(h==1){k+=my_factor_plug/100}if(h==3){k+=my_factor_wethop/100}if(h==4){k+=my_factor_cryohop/100}if(c==0){var l=(f*o*1000)/n;var d=1.65*Math.pow(0.000125,g-1);var u=((1-Math.exp(-0.04*i))/4.15);var p=d*u;v=Round(p*l*j*k,1)}if(c==2){var b;var t;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){t=0}else{t=(g-1050)/200}v=Round(j*((o*(f*100)*b*0.1)/(n*(1+t))),1)}if(c==1){var t;var b=j*18.11+13.86*Math.tanh((i*31.32)/18.27);if(g<1050){t=0}else{t=(g-1050)/200}v=Round((o*(f*100)*b*0.1)/(n*(1+t)),1)}return v}function ebc_to_color(a){return srm_to_color(ebc_to_srm(a))}function srm_to_color(g){var c=Math.round(g*10);if(c<0){c=0}if(c>299){c=299}var 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];var 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];var 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];var b=e[c]*65536+d[c]*256+f[c];var 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=100*c/e;var d=plato_to_sg(a);for(var 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;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}var d=0.00825*g+0.00817*b-0.00684*c+0.00026*h-0.00356*i+0.00553*f+0.547;var a=Round(1+(1-d)*(j-1),4);console.log("estimate_fg("+f+","+i+","+b+","+h+","+c+","+g+","+j+") AttBeer:"+d+" fg:"+a);return a}function CalcFrac(f,e,d,b){var g=Math.pow(10,f-e);var a=Math.pow(10,f-d);var i=Math.pow(10,f-b);var l=1/(1+g+g*a+g*a*i);var k=l;var h=g*l;var c=g*a*l;var j=g*a*i*l;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/global.js	Thu Sep 05 14:43:04 2019 +0200
+++ b/www/js/global.js	Thu Sep 05 20:14:16 2019 +0200
@@ -871,7 +871,6 @@
 var i = Math.round(srm * 10);
 if(i<0)i=0;
 if(i>299)i=299;
-
 /* Table copied from Brouwhulp/BrewBuddy */
 var R=[
 250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,//0
@@ -883,13 +882,12 @@
 192,192,192,192,192,192,192,192,191,190,189,188,187,186,185,184,183,182,181,180,//12
 179,178,177,175,174,172,171,169,168,167,195,164,162,161,159,158,157,155,154,152,//14
 151,149,148,147,145,144,142,141,139,138,137,135,134,132,131,129,128,127,125,124,//16
-122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101, 99, 98, 97, 95,//18
- 94, 92, 91, 89, 88, 87, 85, 84, 82, 81, 79, 78, 77, 75, 74, 72, 71, 69, 68, 67,//20
- 65, 64, 62, 61, 59, 58, 57, 55, 54, 52, 51, 49, 48, 47, 45, 44, 43, 41, 39, 38,//22
- 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28,//24
- 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18,//26
- 17, 17, 16, 16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10,  9,  9,  8,  8];
-
+122,121,119,118,117,115,114,112,111,109,108,107,105,104,102,101,99,98,97,95,//18
+94,92,91,89,88,87,85,84,82,81,79,78,77,75,74,72,71,69,68,67,//20
+65,64,62,61,59,58,57,55,54,52,51,49,48,47,45,44,43,41,39,38,//22
+37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,//24
+27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,//26
+17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8];
 var G=[
 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,
@@ -897,40 +895,35 @@
 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];
-
+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];
 var B=[
 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];
-
+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];
 var color=R[i]*65536+G[i]*256+B[i];
 var result=color.toString(16).toUpperCase();
-if(result.length<6) {
-result='0'+result;
-}
-result='#'+result;
-return result;
+if(result.length<6)result='0'+result;
+return '#'+result;
 }
 
 
@@ -940,59 +933,46 @@
 function brix_to_sg(brix){if(my_brix_correction>0)return plato_to_sg(brix/my_brix_correction);else return plato_to_sg(brix);}
 function sg_to_brix(sg){return sg_to_plato(sg)*my_brix_correction;}
 
-
-
 function estimate_sg(sugars,batch_size){
-	var plato = 100 * sugars / batch_size;
-	var sg = plato_to_sg(plato);
-	for (var i = 0; i < 20; i++) {
-		if (sg > 0)
-			plato = 100 * sugars / (batch_size * sg);
-		sg = plato_to_sg(plato);
-	}
-	return Round(sg,4);
+var plato=100*sugars/batch_size;
+var sg=plato_to_sg(plato);
+for(var i=0;i<20;i++){if(sg>0)plato=100*sugars/(batch_size*sg);sg=plato_to_sg(plato);}
+return Round(sg,4);
 }
 
 
 
-function estimate_fg(percSugar, percCara, WGratio, TotTme, Temp, attenuation, og) {
+function estimate_fg(percSugar,percCara,WGratio,TotTme,Temp,attenuation,og){
 
-	var	BD;
+var BD;
 
-	if (percSugar > 40)
-		percSugar = 0;
-	if (percCara > 50)
-		percCara = 0;
-	if ((WGratio > 0) && (TotTme > 0)) {
-		BD = WGratio;
-		if (BD < 2)
-			BD = 2;
-		if (BD > 5.5)
-			BD = 5.5;
-		if (Temp < 60)
-			Temp = 60;
-		if (Temp > 72)
-			Temp = 72;
-	} else {
-		BD = 3.5;
-		Temp = 67;
-		TotTme = 75;
-	}
-	if (attenuation < 30)
-		attenuation = 77;
+if(percSugar>40)percSugar=0;
+if(percCara>50)percCara=0;
+if((WGratio>0)&&(TotTme>0)){
+BD=WGratio;
+if(BD<2)BD=2;
+if(BD>5.5)BD=5.5;
+if(Temp<60)Temp=60;
+if(Temp>72)Temp=72;
+}else{
+BD=3.5;
+Temp=67;
+TotTme=75;
+}
+if(attenuation<30)attenuation=77;
 
-	// 0.00825 Attenuation factor yeast
-	// 0.00817 Attenuation factor water/grain ration
-	// -0.00684 Attenuation factor mash temperature
-	// 0.00026 Attenuation factor total mash time  (at some places this is 0.0026 this is wrong!)
-	// -0.00356 Attenuation factor percentage crystal malt
-	// 0.00553 Attenuation factor percentage simple sugars
-	// 0.547 Attenuation factor constant
-	var AttBeer = 0.00825 * attenuation + 0.00817 * BD - 0.00684 * Temp + 0.00026 * TotTme - 0.00356 * percCara + 0.00553 * percSugar + 0.547;
-	var fg = Round(1 + (1 - AttBeer) * (og - 1),4);
+// 0.00825 Attenuation factor yeast
+// 0.00817 Attenuation factor water/grain ration
+// -0.00684 Attenuation factor mash temperature
+// 0.00026 Attenuation factor total mash time  (at some places this is 0.0026 this is wrong!)
+// -0.00356 Attenuation factor percentage crystal malt
+// 0.00553 Attenuation factor percentage simple sugars
+// 0.547 Attenuation factor constant
+var AttBeer=0.00825*attenuation+0.00817*BD-0.00684*Temp+0.00026*TotTme-0.00356*percCara+0.00553*percSugar+0.547;
+var fg=Round(1+(1-AttBeer)*(og-1),4);
 
-	console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg);
-	return fg;
+console.log("estimate_fg("+percSugar+","+percCara+","+BD+","+TotTme+","+Temp+","+attenuation+","+og+") AttBeer:"+AttBeer+" fg:"+fg);
+return fg;
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/import_ingredients-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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;var e=c.file;var 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;var e=c.file;var b=c.response;$("#eventsPanel").jqxPanel("append","<strong>"+d.type+":</strong> ontvangen "+e+"<br />"+b+"<br />")})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_equipments-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 c={};function b(){var j=$("#calc_boil_volume").val();var k=parseFloat($("#boil_size").jqxNumberInput("decimal"));var l=parseFloat($("#evap_rate").jqxNumberInput("decimal"));var g=parseFloat($("#boil_time").jqxNumberInput("decimal"));var h=parseFloat($("#top_up_kettle").jqxNumberInput("decimal"));if(j){var i=k-(l*g/60)+h;$("#batch_size").val(i)}}var a="includes/db_inventory_equipments.php";$("#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 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)},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)},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)},error:function(k,m,l){i(false)}})}};$("#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);var f=new $.jqx.dataAdapter(e);var d=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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){b()});$("#evap_rate").on("change",function(g){b()});$("#boil_time").on("change",function(g){b()});$("#top_up_kettle").on("change",function(g){b()});$("#calc_boil_volume").on("change",function(g){b()});$("#tun_material").on("change",function(g){c.tun_specific_heat=MaterialData[g.args.index].sh;$("#tun_specific_heat").val(c.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}});c=$("#jqxgrid").jqxGrid("getrowdata",d);$("#name").val(c.name);$("#boil_size").val(c.boil_size);$("#batch_size").val(c.batch_size);$("#tun_volume").val(c.tun_volume);$("#tun_weight").val(c.tun_weight);$("#tun_specific_heat").val(c.tun_specific_heat);$("#tun_material").val(c.tun_material);$("#tun_height").val(c.tun_height);$("#top_up_water").val(c.top_up_water);$("#trub_chiller_loss").val(c.trub_chiller_loss);$("#evap_rate").val(c.evap_rate);$("#boil_time").val(c.boil_time);$("#calc_boil_volume").val(c.calc_boil_volume);$("#top_up_kettle").val(c.top_up_kettle);$("#hop_utilization").val(c.hop_utilization);$("#notes").val(c.notes);$("#lauter_volume").val(c.lauter_volume);$("#lauter_height").val(c.lauter_height);$("#lauter_deadspace").val(c.lauter_deadspace);$("#kettle_volume").val(c.kettle_volume);$("#kettle_height").val(c.kettle_height);$("#mash_volume").val(c.mash_volume);$("#mash_max").val(c.mash_max);$("#efficiency").val(c.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 g=-1;if(d>=0){var g=$("#jqxgrid").jqxGrid("getrowid",d)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_fermentables-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};function d(h,g){$("#totval").val(h*g)}var a="includes/db_inventory_fermentables.php";var e={datatype:"json",cache:false,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:"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:"int"},{name:"always_on_stock",type:"int"},{name:"di_ph",type:"float"},{name:"acid_to_ph_57",type:"float"},{name:"graintype",type:"int"},{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)},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)},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)},error:function(k,m,l){i(false)}})}};$("#name").jqxInput({theme:theme,width:640,height:23});$("#type").jqxDropDownList({theme:theme,source:FermentableTypeAdapter,valueMember:"id",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:"id",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:"id",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);var f=new $.jqx.dataAdapter(e);var c=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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>");var 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(0);$("#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(0);$("#add_after_boil").val(0);$("#added").val(0);$("#inventory").val(0);$("#cost").val(0);$("#production_date").val("");$("#tht_date").val("");$("#popupWindow").jqxWindow("open")});j.click(function(l){var k="import_ingredients.php?select=fermentables";window.location.href=k})},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",cellsrenderer:function(h,g,k,j,i,l){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+FermentableTypeData[k].nl+"</span>"}},{text:"Graan type",datafield:"graintype",align:"center",cellsalign:"center",width:125,cellsrenderer:function(h,g,k,j,i,l){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+GrainTypeData[k].nl+"</span>"}},{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});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g=-1;if(c>=0){var g=$("#jqxgrid").jqxGrid("getrowid",c)}var 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);location.reload(true)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_hops-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};function d(h,g){$("#totval").val(h*(g/1000))}var a="includes/db_inventory_hops.php";var 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:"int"},{name:"form",type:"int"},{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)},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)},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)},error:function(k,m,l){i(false)}})}};$("#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:"id",displayMember:"nl",width:150,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:HopFormAdapter,valueMember:"id",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);var f=new $.jqx.dataAdapter(e);var c=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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>");var 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(0);$("#form").val(0);$("#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(l){var k="import_ingredients.php?select=hops";window.location.href=k})},filterable:true,filtermode:"excel",columns:[{text:"Herkomst",datafield:"origin",width:150},{text:"Hop Naam",datafield:"name",menu:false},{text:"Soort",datafield:"type",align:"left",menu:false,width:90,cellsrenderer:function(h,g,k,j,i,l){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopTypeData[k].nl+"</span>"}},{text:"Vorm",datafield:"form",align:"left",menu:false,width:90,cellsrenderer:function(h,g,k,j,i,l){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopFormData[k].nl+"</span>"}},{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");location.reload(true)});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var g=-1;if(c>=0){var g=$("#jqxgrid").jqxGrid("getrowid",c)}var 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);location.reload(true)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_miscs-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 c={};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 b="includes/db_inventory_miscs.php";var f={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"name",type:"string"},{name:"type",type:"int"},{name:"use_use",type:"int"},{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)},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)},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)},error:function(l,n,m){j(false)}})}};$("#name").jqxInput({theme:theme,width:640,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});$("#type").jqxDropDownList({theme:theme,source:MiscTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#use_use").jqxDropDownList({theme:theme,source:MiscUseAdapter,valueMember:"id",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);var g=new $.jqx.dataAdapter(f);var d=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:g,theme:theme,showstatusbar:true,renderstatusbar:function(j){var h=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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>");var 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(0);$("#use_use").val(0);$("#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(m){var l="import_ingredients.php?select=miscs";window.location.href=l})},filterable:true,filtermode:"excel",columns:[{text:"Ingredient naam",datafield:"name",menu:false},{text:"Type",datafield:"type",align:"left",width:120,cellsrenderer:function(i,h,l,k,j,m){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscTypeData[l].nl+"</span>"}},{text:"Gebruik",datafield:"use_use",align:"left",width:120,cellsrenderer:function(i,h,l,k,j,m){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscUseData[l].nl+"</span>"}},{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 h=-1;if(d>=0){h=$("#jqxgrid").jqxGrid("getrowid",d)}var 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);location.reload(true)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_suppliers-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 a="includes/db_inventory_suppliers.php";$("#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 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)},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)},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)},error:function(i,k,j){g(false)}})}};$("#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});var d=new $.jqx.dataAdapter(c);var b=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:d,theme:theme,showstatusbar:true,renderstatusbar:function(g){var e=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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 e=-1;if(b>=0){e=$("#jqxgrid").jqxGrid("getrowid",b)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_waters-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};var a="includes/db_inventory_water.php";$("#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 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)},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)},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)},error:function(j,l,k){h(false)}})}};$("#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});var e=new $.jqx.dataAdapter(d);var c=-1;$("#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>");var 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(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});var f=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(f.name);$("#unlimited_stock").val(f.unlimited_stock);$("#calcium").val(f.calcium);$("#bicarbonate").val(f.bicarbonate);$("#sulfate").val(f.sulfate);$("#chloride").val(f.chloride);$("#sodium").val(f.sodium);$("#magnesium").val(f.magnesium);$("#ph").val(f.ph);$("#notes").val(f.notes);$("#total_alkalinity").val(f.total_alkalinity);$("#inventory").val(f.inventory);$("#cost").val(f.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 f=-1;if(c>=0){var f=$("#jqxgrid").jqxGrid("getrowid",c)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/inv_yeasts-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};function d(){$("#totval").val(b.cost*b.inventory);if(b.form==0){$("#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==1){$("#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 a="includes/db_inventory_yeasts.php";var e={datatype:"json",cache:false,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:"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"}],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)},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)},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)},error:function(k,m,l){i(false)}})}};$("#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:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#form").jqxDropDownList({theme:theme,source:YeastFormAdapter,valueMember:"id",displayMember:"nl",selectedIndex:0,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});var f=new $.jqx.dataAdapter(e);var c=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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>");var 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(0);$("#form").val(0);$("#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);$("#popupWindow").jqxWindow("open")});j.click(function(l){var k="import_ingredients.php?select=yeasts";window.location.href=k})},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",menu:false,width:110,cellsrenderer:function(h,g,k,j,i,l){return"<div style='margin: 4px;' class='jqx-center-align'>"+YeastTypeData[k].nl+"</div>"}},{text:"Vorm",datafield:"form",align:"center",cellsalign:"center",menu:false,width:110,cellsrenderer:function(h,g,k,j,i,l){return"<div style='margin: 4px;' class='jqx-center-align'>"+YeastFormData[k].nl+"</div>"}},{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==0)&&(l>1)){i=f.formatNumber(l,"f0")+" pakken"}else{if(m.form==0){i=f.formatNumber(l,"f0")+" pak"}else{if(m.form==1){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:30}});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(b.min_temperature);$("#max_temperature").val(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==0){$("#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);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==0){b.inventory=parseFloat(g.args.value)}else{b.inventory=parseFloat(g.args.value)/1000}d()});$("#form").on("select",function(g){if(g.args){b.form=g.args.index;d()}});$("#popupWindow").jqxWindow({width:1050,height:575,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:parseInt($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseInt($("#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"))};$("#jqxgrid").jqxGrid("addrow",null,g);$("#popupWindow").jqxWindow("hide");location.reload(true)});$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var h=-1;if(c>=0){h=$("#jqxgrid").jqxGrid("getrowid",c)}if(b.form==0){var g=parseFloat($("#inventory").jqxNumberInput("decimal"))}else{var g=parseFloat($("#inventory").jqxNumberInput("decimal"))/1000}var i={record:h,name:$("#name").val(),type:$("#type").val(),form:$("#form").val(),laboratory:$("#laboratory").val(),product_id:$("#product_id").val(),min_temperature:parseInt($("#min_temperature").jqxNumberInput("decimal")),max_temperature:parseInt($("#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"))};if(c>=0){$("#jqxgrid").jqxGrid("updaterow",h,i)}else{$("#jqxgrid").jqxGrid("addrow",null,i);location.reload(true)}$("#popupWindow").jqxWindow("hide")});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/jquery-1.11.1-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,2 @@
+/* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/jquery-1.11.1.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("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()||.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)||"")?.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.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});
--- a/www/js/jquery-1.11.1.min.js	Thu Sep 05 14:43:04 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("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()||.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)||"")?.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.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});
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/log_brew-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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};var c=new $.jqx.dataAdapter(d,{autoBind:true,async:false,loadComplete:function(){$("#jqxLoader").jqxLoader("close")},loadError:function(g,e,f){}});var 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();var 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;var 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/log_fermentation-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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};var c=new $.jqx.dataAdapter(d,{autoBind:true,async:false,loadComplete:function(){$("#jqxLoader").jqxLoader("close")},loadError:function(g,e,f){}});var 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();var 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;var 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/mon_fermenter-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};var e={};var b="";var l=false;var k=false;var w=false;var n=false;var o=0;var t=12;var y=24;var 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"};var s=new $.jqx.dataAdapter(v,{beforeLoadComplete:function(z){var 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(var A=0;A<z.length;A++){var C=z[A];B.push(C)}return B},loadError:function(B,z,A){$("#err").text(z+" "+A)},});$("#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}});var 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"};var a=new $.jqx.dataAdapter(f,{beforeLoadComplete:function(z){var C=new Array();var B={};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(var A=0;A<z.length;A++){var D=z[A];C.push(D)}return C},loadError:function(B,z,A){$("#err").text(z+" "+A)},});$("#select_profile").jqxDropDownList({placeHolder:"Kies profiel:",theme:theme,source:a,displayMember:"name",width:150,height:24,dropDownWidth:500,autoDropDownHeight:true,});var 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"};var 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]}};$("#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);var m={height:68,width:35,onLabel:"AAN",offLabel:"UIT",theme:theme,thumbSize:"50%",orientation:"vertical"};$("#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});var x={inputMode:"simple",theme:theme,width:70,min:0,max:40,decimalDigits:1,spinButtons:true};$("#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")}})}var d="getfermenter.php?uuid='"+my_uuid+"'";var 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};var r=new $.jqx.dataAdapter(j,{loadComplete:function(A){c=r.records[0];var 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;var 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})}}});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;var 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;var B=a.records[z];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(var A=0;A<B.steps.length;A++){var 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(){var z="log_fermentation.php?code="+c.beercode+"&name="+c.beername;window.open(z)});$("#Camera").jqxButton({template:"primary",width:"150px",theme:theme});$("#Camera").click(function(){c.light_state=100;w=true;var z=c.webcam_url;window.open(z)});createAbortElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/mon_node-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(document).ready(function(){var a="getnode.php?uuid='"+my_uuid+"'";var 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};var c=new $.jqx.dataAdapter(b,{loadComplete:function(e){var d=c.records[0];var 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_archive_code-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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"};var 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(e){var d=b.records[e];var c="prod_edit.php?record="+d.record+"&select=archcode&return=prod_archive_code.php";window.location.href=c}}],})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_archive_date-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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"};var 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(e){var d=b.records[e];var c="prod_edit.php?record="+d.record+"&select=archdate&return=prod_archive_date.php";window.location.href=c}}],groups:["year"]})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_archive_name-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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"};var 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(e){var d=b.records[e];var c="prod_edit.php?record="+d.record+"&select=archname&return=prod_archive_name.php";window.location.href=c}}],})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_edit-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 k=false;var am=0;var a0=0;var a1=0;var I=0;var ad=0;var aE=77;var aq=0;var w=0.75;var ab=0;var p=1;var ac=1;var aj=1;var Q=1;var c=1;var aZ=0;var W=0;var D=0;var aV="";var ah="";var B=40.048;var ar=24.305;var ae=22.98976928;var q=35.453;var aJ=96.0626;var N=60.01684;var r=61.01684;var ao=172.171;var U=147.015;var g=100.087;var aL=246.475;var aG=84.007;var z=105.996;var b=58.443;var aK=74.06268;var u=0;var aM={};var C=1;var a=0;var e={};var ax=0;var aI={};var aF=0;var f={};var al=0;var E={};$("#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 H(){if(d.inventory_reduced>6){$("#ok_pmpt").hide();return}if(p&&ac&&aj&&Q&&c){$("#ok_supplies").html("<img src='images/dialog-ok-apply.png'>")}else{$("#ok_supplies").html("<img src='images/dialog-error.png'>")}}function aX(){console.log("calcPercentages()");var a6=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(a6>1){var a4=0;for(af=0;af<a6;af++){var a5=$("#fermentableGrid").jqxGrid("getrowdata",af);if(a5.f_added<4){a4+=Math.round(a5.f_amount*1000)/1000}}a4=Math.round(a4*1000)/1000;for(af=0;af<a6;af++){var a5=$("#fermentableGrid").jqxGrid("getrowdata",af);if(a5.f_added<4){var i=Math.round(a5.f_amount/a4*1000)/10;$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",i)}else{$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",0)}}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}}function V(){var bC=0;var bu=0;I=0;ad=0;aq=0;p=1;Q=1;var bs=0;var bk=0;var bt=0;var bD=0;var bc=0;var bn=0;var bg=0;var bl=false;var bq=0;var bb=0;var bx=0.925;var bp=0.95;var ba=0;if((bd=$("#mashGrid").jqxGrid("getrows"))){for(var br=0;br<bd.length;br++){var a9=bd[br];if(a9.step_type==0){bD+=parseFloat(a9.step_infuse_amount)}if(a9.step_temp<=75){var bj=a9.step_time+a9.ramp_time;bq+=bj;bb+=bj*a9.step_temp}}if(bq>5){bq-=5}bb=Round(bb/bq,2)}if(!(bd=$("#fermentableGrid").jqxGrid("getrows"))){return}var bh=0;for(var br=0;br<bd.length;br++){var a9=bd[br];if(a9.f_adjust_to_total_100){bl=true}if(a9.f_type==1&&a9.f_added<4){I+=a9.f_percentage}if(a9.f_graintype==2&&a9.f_added<4){ad+=a9.f_percentage}var bz=a9.f_amount*(a9.f_yield/100)*(1-a9.f_moisture/100);if(a9.f_added==0){if(bD>0){bD+=a9.f_amount*a9.f_moisture/100;bh+=bz}bz=parseFloat(d.efficiency)/100*bz;bu+=bz;aq+=parseFloat(a9.f_amount)}if(a9.f_added==0||a9.f_added==1){bC+=bz}if(a9.f_added==2||a9.f_added==3){var be=(a9.f_yield/100)*(1-a9.f_moisture/100);bk+=a9.f_amount*be;bt+=a9.f_amount;bs+=(be*sugardensity+(1-be)*1)*a9.f_amount}if(a9.f_added<4){bc+=a9.f_amount*ebc_to_srm(a9.f_color);bn+=a9.f_amount*a9.f_color*get_kt(a9.f_color);bg+=(a9.f_percentage/100)*a9.f_color}if(C){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}}C=0;$("#ferm_lintner").val(Math.round(parseFloat(ba/aq)));$("#mash_kg").val(aq);console.log("calcFermentables() supplies:"+p+" moutsuiker:"+bu+"/"+bC);k=bl;if(k){$("#wf_amount").jqxNumberInput({width:90,readOnly:true,spinButtons:false})}else{$("#wf_amount").jqxNumberInput({width:110,readOnly:false,spinButtons:true})}if(bD>0){var bf=bh/sugardensity+bD;bh=1000*bh/(bf*10);a1=Math.round(plato_to_sg(bh)*10000)/10000;$("#est_mash_sg").val(a1)}d.est_og=estimate_sg(bC+bk,parseFloat(d.batch_size));$("#est_og").val(d.est_og);$("#est_og2").val(d.est_og);var a4=d.est_og;a0=estimate_sg(bC,parseFloat(d.batch_size));$("#est_og3").val(a0);am=estimate_sg(bu,parseFloat(d.boil_size));$("#est_pre_sg").val(am);var a5=parseFloat(d.batch_size);if(d.brew_aboil_volume>0){a5=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=a5-d.brew_fermenter_tcloss+d.brew_fermenter_extrawater;$("#brew_fermenter_volume").val(d.brew_fermenter_volume);var by=(d.boil_size-D+(aq*my_grain_absorbtion)+d.eq_lauter_deadspace)*1.03;$("#brew_sparge_est").val(by);var bA=d.brew_aboil_sg;if(bA<1.002){bA=a0}var bi=d.brew_fermenter_extrawater;if(d.brew_fermenter_volume>0){var a7=sg_to_plato(bA)*d.brew_fermenter_volume*bA/100;a7+=bk;if((d.brew_fermenter_volume*bA+bt)>0){var bm=100*a7/(d.brew_fermenter_volume*bA+bt+bi);d.brew_fermenter_sg=Round(plato_to_sg(bm),4);$("#brew_fermenter_sg").val(d.brew_fermenter_sg);if(d.color_method==4){d.brew_fermenter_color=Math.round(((bm/8.6)*bg)+(d.boil_time/60))}else{if(d.color_method==3){d.brew_fermenter_color=Math.round((4.46*bx*bp)/(a5+bi)*bn)}else{var a6=bc/(a5+bi)*8.34436;d.brew_fermenter_color=kw_to_ebc(d.color_method,a6)}}$("#brew_fermenter_color").val(d.brew_fermenter_color);var bw=ebc_to_color(d.brew_fermenter_color);$("#bcolorf").show();document.getElementById("bcolorf").style.background=bw}}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){var bo=Math.round(((sg_to_plato(d.est_og)/8.6)*bg)+(d.boil_time/60))}else{if(d.color_method==3){var bo=Math.round((4.46*bx*bp)/parseFloat(d.batch_size)*bn)}else{var a6=bc/parseFloat(d.batch_size)*8.34436;var bo=kw_to_ebc(d.color_method,a6)}}d.est_color=bo;$("#est_color").val(bo);$("#est_color2").val(bo);var bw=ebc_to_color(bo);document.getElementById("bcolor").style.background=bw;document.getElementById("bcolor2").style.background=bw;pmalts=aq/d.eq_mash_max*100;$("#perc_malts").jqxProgressBar("val",pmalts);$("#perc_sugars").jqxProgressBar("val",I);$("#perc_cara").jqxProgressBar("val",ad);aW();aE=0;ab=0;var bd=$("#yeastGrid").jqxGrid("getrows");for(var br=0;br<bd.length;br++){var a9=bd[br];if(a9.y_use==0){if(parseFloat(a9.y_attenuation)>aE){aE=parseFloat(a9.y_attenuation)}if(a9.y_form==0){ab+=(parseFloat(a9.y_cells)/1000000000)*parseFloat(a9.y_amount)*(d.starter_viability/100)}else{ab+=(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)){Q=0}}H();if(aE==0){aE=77}if((aq>0)&&(D>0)&&(bq>0)&&(bb>0)){d.est_fg=estimate_fg(I,ad,D/aq,bq,bb,aE,d.est_og)}else{d.est_fg=estimate_fg(I,ad,0,0,0,aE,d.est_og)}$("#est_fg").val(d.est_fg);$("#est_fg2").val(d.est_fg);$("#est_fg3").val(d.est_fg);var bB=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)){aE=100*(d.brew_fermenter_sg-d.fg)/(d.brew_fermenter_sg-1);a4=d.brew_fermenter_sg;bB=d.fg}$("#yeast_cells").val(ab);$("#need_cells").val(v());var a8=1881.22*bB*(a4-bB)/(1.775-a4);var a7=3550*bB*(0.1808*a4+0.8192*bB-1.0004);$("#kcal").val(Math.round((a8+a7)/(12*0.0295735296)))}function aP(){if(!(rows=$("#mashGrid").jqxGrid("getrows"))){return}if(aq==0){return}var a4=0;for(var a5=0;a5<rows.length;a5++){var a6=$("#mashGrid").jqxGrid("getrowdata",a5);if(a6.step_type==0){a4+=a6.step_infuse_amount}$("#mashGrid").jqxGrid("setcellvalue",a5,"step_thickness",a4/aq)}}function ag(a5){console.log("calcFermentablesFromOG("+a5+")");var a4=parseFloat($("#efficiency").jqxNumberInput("decimal"));var bc=sg_to_plato(a5)*parseFloat($("#batch_size").jqxNumberInput("decimal"))*a5/100;var a9=0;var bb=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(var a6=0;a6<bb;a6++){var bd=$("#fermentableGrid").jqxGrid("getrowdata",a6);if(bd.f_added<4){var ba=bd.f_percentage/100*(bd.f_yield/100)*(1-bd.f_moisture/100);if(bd.f_added==0){ba=a4/100*ba}a9+=ba}}var a8=0;if(a9){a8=Math.round((bc/a9)*1000)/1000}if(a8){for(a6=0;a6<bb;a6++){var bd=$("#fermentableGrid").jqxGrid("getrowdata",a6);if(bd.f_added<4){var a7=Math.round(bd.f_percentage*10*a8)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",a6,"f_amount",a7)}}}}function v(){var a5=d.brew_fermenter_sg;if(a5<=1.0001&&d.fg>1){a5=d.fg}else{if(a5<=1.0001){a5=d.est_og}}var a4=sg_to_plato(a5);var a6=d.brew_fermenter_volume;if(a6<=0){a6=d.batch_size-d.eq_trub_chiller_loss}var i=w*a6*a4;return i}function L(a5,a7,a4,a6){var i;if(a4==1){i=0.15}else{if(a5>50){i=0.1}else{i=15.25/(6*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((a5-21)/6,2));if(i<0.1){i=0.1}}}return(i*a6*1000)/a7}function h(a5,a7,a4,a6){var i=0;if(a4==5){i=1.33}else{if(a5>20){i=0}else{if(a5>7.5){i=10.03/(4*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((a5-7.5)/4,2))}else{if(a4==2){i=1}else{if(a4==3){i=1.2}else{if(a4==4){i=1.2}}}}}}return(i*a6*1000)/a7}function au(){var a5=0;var a4=0;var a7={};W=aZ=0;if(!(a7=$("#hopGrid").jqxGrid("getrows"))){return}ac=1;for(var a6=0;a6<a7.length;a6++){var a8=a7[a6];a5+=toIBU(a8.h_useat,a8.h_form,am,parseFloat(d.batch_size),parseFloat(a8.h_amount),parseFloat(a8.h_time),parseFloat(a8.h_alpha),d.ibu_method);a4+=toIBU(a8.h_useat,a8.h_form,am,parseFloat(d.brew_fermenter_volume)+parseFloat(d.brew_fermenter_tcloss),parseFloat(a8.h_amount),parseFloat(a8.h_time),parseFloat(a8.h_alpha),d.ibu_method);aZ+=L(parseFloat(a8.h_time),parseFloat(d.batch_size),a8.h_useat,parseFloat(a8.h_amount));W+=h(parseFloat(a8.h_time),parseFloat(d.batch_size),a8.h_useat,parseFloat(a8.h_amount));if((((d.inventory_reduced<=2)&&(a8.h_useat<=4))||((d.inventory_reduced<=6)&&(a8.h_useat==5)))&&(a8.h_inventory<a8.h_amount)){ac=0}}a5=Math.round(a5*10)/10;a4=Math.round(a4*10)/10;aZ=Math.round(aZ*1000/5)/10;W=Math.round(W*1000/6)/10;if(aZ>100){aZ=100}if(W>100){W=100}console.log("calcIBUs(): "+a5+"  flavour: "+aZ+"  aroma: "+W+"  fermenter:"+a4+" supplies:"+ac);d.est_ibu=a5;$("#est_ibu").val(a5);$("#est_ibu2").val(a5);$("#hop_flavour").jqxProgressBar("val",aZ);$("#hop_aroma").jqxProgressBar("val",W);$("#brew_fermenter_ibu").val(a4);aW();H()}function P(a5,a6,a4){var i=a6/a4;if(i>3.5){return 0}if(a5==2){return 0.4}if(a5==1){return 0.62}if(i<=1.4){return 1.4}return 2.33-(0.67*i)}function aD(a5,ba,a4){var i=2.72715;var bb=a4/a5*1000;var a6=Math.round(bb*10)/10;var a7=(d.starter_sg-1)*a5*i;var a8=P(ba,a4,a7);var a9=Math.round(a7*a8*10)/10;var bc=parseFloat(a9)+a4;console.log("svol:"+a5+" start:"+a4+" irate:"+a6+" egrams:"+a7+" grate:"+a8+" ncells:"+a9);return{svol:a5,irate:a6,prate:Math.round(bb*10)/10,ncells:a9,totcells:bc,growf:Math.round(a9/a4*100)/100}}function G(ba,a4,bb){var a9=[20,40,60,80,100,150,200,250,375,500,625,750,875,1000,1250,1500,2000,2500,3000,4000,5000];var a5=a9.length;var a6=0;var a7=0;var bc={};if((parseFloat($("#prop1_volume").jqxNumberInput("decimal"))+parseFloat($("#prop2_volume").jqxNumberInput("decimal"))+parseFloat($("#prop3_volume").jqxNumberInput("decimal"))+parseFloat($("#prop4_volume").jqxNumberInput("decimal")))==0){for(var a8=1;a8<5;a8++){$("#prop"+a8+"_type").hide();$("#r"+a8+"_pmpt").show();$("#prop"+a8+"_type").val(ba);$("#prop"+a8+"_volume").hide();$("#prop"+a8+"_volume").val(0);$("#prop"+a8+"_irate").hide();$("#prop"+a8+"_ncells").hide();$("#prop"+a8+"_tcells").hide();$("#prop"+a8+"_growf").hide()}if(a4>bb){return}$("#prop1_type").show();$("#r1_pmpt").hide();$("#prop1_volume").show();$("#prop1_irate").show();$("#prop1_ncells").show();$("#prop1_tcells").show();$("#prop1_growf").show();for(var a8=a7;a8<=a5;a8++){a7=a8;a6=a9[a7];bc=aD(a6,ba,a4);if(bc.irate<25){a7=a8-1;a6=a9[a7];bc=aD(a6,ba,a4);break}if(bc.totcells>bb||a8==a5){break}}$("#prop1_volume").val(bc.svol/1000);$("#prop1_irate").val(bc.prate);$("#prop1_ncells").val(bc.ncells);$("#prop1_tcells").val(bc.totcells);$("#prop1_growf").val(bc.growf);if(bc.totcells>bb){return}$("#r2_pmpt").hide();$("#prop2_type").val(ba);$("#prop2_type").show();$("#prop2_volume").show();$("#prop2_irate").show();$("#prop2_ncells").show();$("#prop2_tcells").show();$("#prop2_growf").show();for(var a8=a7;a8<=a5;a8++){a7=a8;a6=a9[a7];bc=aD(a6,ba,$("#prop1_tcells").val());if(bc.irate<25){a7=a8-1;a6=a9[a7];bc=aD(a6,ba,$("#prop1_tcells").val());break}if(bc.totcells>bb||a8==a5){break}}$("#prop2_volume").val(bc.svol/1000);$("#prop2_irate").val(bc.prate);$("#prop2_ncells").val(bc.ncells);$("#prop2_tcells").val(bc.totcells);$("#prop2_growf").val(bc.growf);if(bc.totcells>bb){return}$("#r3_pmpt").hide();$("#prop3_type").val(ba);$("#prop3_type").show();$("#prop3_volume").show();$("#prop3_irate").show();$("#prop3_ncells").show();$("#prop3_tcells").show();$("#prop3_growf").show();for(var a8=a7;a8<=a5;a8++){a7=a8;a6=a9[a7];bc=aD(a6,ba,$("#prop2_tcells").val());if(bc.irate<25){a7=a8-1;a6=a9[a7];bc=aD(a6,ba,$("#prop2_tcells").val());break}if(bc.totcells>bb||a8==a5){break}}$("#prop3_volume").val(bc.svol/1000);$("#prop3_irate").val(bc.prate);$("#prop3_ncells").val(bc.ncells);$("#prop3_tcells").val(bc.totcells);$("#prop3_growf").val(bc.growf);if(bc.totcells>bb){return}$("#r4_pmpt").hide();$("#prop4_type").val(ba);$("#prop4_type").show();$("#prop4_volume").show();$("#prop4_irate").show();$("#prop4_ncells").show();$("#prop4_tcells").show();$("#prop4_growf").show();for(var a8=a7;a8<=a5;a8++){a7=a8;a6=a9[a7];bc=aD(a6,ba,$("#prop3_tcells").val());if(bc.totcells>bb||a8==a5){$("#prop4_volume").val(bc.svol/1000);$("#prop4_irate").val(bc.prate);$("#prop4_ncells").val(bc.ncells);$("#prop4_tcells").val(bc.totcells);$("#prop4_growf").val(bc.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();bc=aD($("#prop1_volume").val()*1000,d.prop1_type,a4);$("#prop1_irate").val(bc.prate);$("#prop1_ncells").val(bc.ncells);$("#prop1_tcells").val(bc.totcells);$("#prop1_growf").val(bc.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();bc=aD($("#prop2_volume").val()*1000,d.prop2_type,$("#prop1_tcells").val());$("#prop2_irate").val(bc.prate);$("#prop2_ncells").val(bc.ncells);$("#prop2_tcells").val(bc.totcells);$("#prop2_growf").val(bc.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();bc=aD($("#prop3_volume").val()*1000,d.prop3_type,$("#prop2_tcells").val());$("#prop3_irate").val(bc.prate);$("#prop3_ncells").val(bc.ncells);$("#prop3_tcells").val(bc.totcells);$("#prop3_growf").val(bc.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();bc=aD($("#prop4_volume").val()*1000,d.prop4_type,$("#prop3_tcells").val());$("#prop4_irate").val(bc.prate);$("#prop4_ncells").val(bc.ncells);$("#prop4_tcells").val(bc.totcells);$("#prop4_growf").val(bc.growf)}}}function Z(){var a7=d.brew_fermenter_sg;if(a7<=1.0001&&d.fg>1){a7=d.fg}else{if(a7<=1.0001){a7=d.est_og}}var a4=sg_to_plato(a7);var a9=d.brew_fermenter_volume;if(a9>0){if(d.brew_fermenter_extrawater>0){a9+=d.brew_fermenter_extrawater}}else{a9=d.batch_size-d.eq_trub_chiller_loss}$("#yeast_cells").val(ab);if(!(rows=$("#yeastGrid").jqxGrid("getrows"))){return}var bb=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(bb==0){return}for(var a5=0;a5<bb;a5++){var ba=$("#yeastGrid").jqxGrid("getrowdata",a5);if(ba.y_use==0){w=0.75;if(d.est_og>1.06){w=1}if(ba.y_type==0){w*=2}if(ba.y_form==1){}else{}}}var a8=w*a9*a4;console.log("calcYeast() pitchrate:"+w+" start:"+ab+" needed:"+a8+" volume:"+a9);$("#need_cells").val(a8);var a6=ab;if(d.starter_enable){G(d.starter_type,ab,a8);for(var a5=1;a5<5;a5++){$("#r"+a5+"_irate").html("");$("#r"+a5+"_growf").html("");$("#r"+a5+"_tcells").html("");if(parseFloat($("#prop"+a5+"_volume").val())>0){if((parseFloat($("#prop"+a5+"_irate").val())<25)||(parseFloat($("#prop"+a5+"_irate").val())>100)){$("#r"+a5+"_irate").html("<img src='images/dialog-error.png'>")}else{$("#r"+a5+"_irate").html("<img src='images/dialog-ok-apply.png'>")}if(parseFloat($("#prop"+a5+"_growf").val())<1){$("#r"+a5+"_growf").html("<img src='images/dialog-error.png'>")}if(($("#prop"+a5+"_type").val()>0)&&(parseFloat($("#prop"+a5+"_growf").val())>3)){$("#r"+a5+"_growf").html("<img src='images/dialog-error.png'>")}if(parseFloat($("#prop"+a5+"_tcells").val())>a8){$("#r"+a5+"_tcells").html("<img src='images/dialog-ok-apply.png'>")}a6=parseFloat($("#prop"+a5+"_tcells").val())}else{$("#r"+a5+"_irate").html("")}}}$("#plato_cells").val(parseFloat(a6/(a9*a4)))}function ak(a6){console.log("adjustHops("+a6+")");var a8=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(a8==0){return}for(var a5=0;a5<a8;a5++){var a7=$("#hopGrid").jqxGrid("getrowdata",a5);var a4=a7.h_amount*a6;$("#hopGrid").jqxGrid("setcellvalue",a5,"h_amount",a4)}}function aH(){aj=1;var a6=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(a6==0){return}for(var a4=0;a4<a6;a4++){var a5=$("#miscGrid").jqxGrid("getrowdata",a4);if((((d.inventory_reduced<=2)&&(a5.m_use_use<=2))||((d.inventory_reduced<=3)&&(a5.m_use_use==3))||((d.inventory_reduced<=5)&&(a5.m_use_use==4))||((d.inventory_reduced<=6)&&(a5.m_use_use==5)))&&(a5.m_inventory<a5.m_amount)){aj=0}}H()}function a3(a6){console.log("adjustMiscs("+a6+")");var a8=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(a8==0){return}for(var a5=0;a5<a8;a5++){var a7=$("#miscGrid").jqxGrid("getrowdata",a5);var a4=a7.m_amount*a6;$("#miscGrid").jqxGrid("setcellvalue",a5,"m_amount",a4);switch(a7.m_name){case"CaCl2":$("#wa_cacl2").val(a7.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(a7.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(a7.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(a7.m_amount*1000);break;case"Melkzuur":case"Zoutzuur":case"Fosforzuur":case"Zwavelzuur":$("#wa_acid").val(a7.m_amount*1000);break;case"NaHCO3":case"Na2CO3":case"CaCO3":case"Ca(OH)2":$("#wa_base").val(a7.m_amount*1000);break}}}function aQ(a6){console.log("adjustYeasts("+a6+")");var a8=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(a8==0){return}for(var a5=0;a5<a8;a5++){var a7=$("#yeastGrid").jqxGrid("getrowdata",a5);if(a7.y_form==1){var a4=a7.y_amount*a6;$("#yeastGrid").jqxGrid("setcellvalue",a5,"y_amount",a4)}}Z()}function aw(a6){console.log("adjustWaters("+a6+")");var a8=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(a8==0){return}D=0;for(var a5=0;a5<a8;a5++){var a7=$("#mashGrid").jqxGrid("getrowdata",a5);if(a7.step_type==0){var a4=Math.round(a7.step_infuse_amount*a6*10)/10;$("#mashGrid").jqxGrid("setcellvalue",a5,"step_infuse_amount",a4);D+=a4}}if(d.w2_amount==0){d.w1_amount=D;$("#w1_amount").val(D)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*D;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*D;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(D)}function a2(){if(parseFloat($("#brew_mash_sg").jqxNumberInput("decimal"))<1.002){return}var a4=sg_to_plato(a1);var i=sg_to_plato(parseFloat($("#brew_mash_sg").jqxNumberInput("decimal")));if(a4>0.5){$("#brew_mash_efficiency").val(100*i/a4)}else{$("#brew_mash_efficiency").val(0)}}function y(){var a5=0;var a8={};if(!(a8=$("#fermentableGrid").jqxGrid("getrows"))){return}for(var a7=0;a7<a8.length;a7++){var a9=a8[a7];if(a9.f_added==0){a5+=a9.f_amount*(a9.f_yield/100)*(1-a9.f_moisture/100)}}var a6=sg_to_plato(d.brew_preboil_sg)*(d.brew_preboil_volume/1.04)*d.brew_preboil_sg*10/1000;var a4=0;if(a5>0){a4=Math.round((a6/a5*100)*10)/10}if(a4<0){a4=0}$("#brew_preboil_efficiency").val(a4)}function T(){var a6=0;var a5=0;var a9={};if(!(a9=$("#fermentableGrid").jqxGrid("getrows"))){return}for(var a8=0;a8<a9.length;a8++){var ba=a9[a8];if(ba.f_added==0){a6+=ba.f_amount*(ba.f_yield/100)*(1-ba.f_moisture/100)}else{if(ba.f_added==1){a5+=ba.f_amount*(ba.f_yield/100)*(1-ba.f_moisture/100)}}}var a7=sg_to_plato(d.brew_aboil_sg)*(d.brew_aboil_volume/1.04)*d.brew_aboil_sg*10/1000;a7-=a5;var a4=0;if(a6>0){a4=Math.round((a7/a6*100)*10)/10}if(a4<0){a4=0}d.brew_aboil_efficiency=a4;$("#brew_aboil_efficiency").val(a4)}function S(){var i=(d.est_og-1)*1000;if(i>0){return d.est_ibu/i}else{return 0.5}}function l(){var i=S();return(-1.2*i+1.4)}function aC(a4,a8){var bb=$("#miscGrid").jqxGrid("getrows");if(a8==0){for(var a7=0;a7<bb.length;a7++){var ba=bb[a7];if(ba.m_name==a4){var a5=$("#miscGrid").jqxGrid("getrowid",a7);var a6=$("#miscGrid").jqxGrid("deleterow",a5)}}}else{var bc=false;for(var a7=0;a7<bb.length;a7++){var ba=bb[a7];if(ba.m_name==a4){bc=true;$("#miscGrid").jqxGrid("setcellvalue",a7,"m_amount",a8/1000);break}}if(!bc){var a9=new $.jqx.dataAdapter(miscInvSource,{loadComplete:function(){var be=a9.records;for(var bf=0;bf<be.length;bf++){var bd=be[bf];if(bd.name==a4){var bh={};bh.m_name=bd.name;bh.m_amount=a8/1000;bh.m_cost=bd.cost;bh.m_type=bd.type;bh.m_use_use=bd.use_use;bh.m_time=0;bh.m_amount_is_weight=bd.amount_is_weight;bh.m_inventory=bd.inventory;bh.m_avail=1;var bg=$("#miscGrid").jqxGrid("addrow",null,bh)}}}});a9.dataBind();return}}}function m(a4,i){if((i=="laag")||(i=="hoog")){$("#wr_"+a4).html("<img src='images/dialog-error.png'><span style='vertical-align: top; font-size: 10px; font-style: italic;'>"+i+"</span>")}else{$("#wr_"+a4).html("<img src='images/dialog-ok-apply.png'>")}}function aR(a6,a5,a4,i){if((a6+a5)>0){return((a6*a4)+(a5*i))/(a6+a5)}return 0}function at(a5,a4,i){return a5-(a4/1.4+i/1.7)}var aB=4.445e-7;var az=4.68e-11;function A(a4){var i=Math.pow(10,-a4);return 100*aB*az/(i*i+i*aB+aB*az)}function aA(a4){var i=Math.pow(10,-a4);return 100*aB*i/(i*i+i*aB+aB*az)}function ay(i){return(-2*A(i)-aA(i))}function K(a4){var a7=ay(4.3);var a5=ay(parseFloat($("#wg_ph").jqxNumberInput("decimal")));var i=ay(a4);var a9=-a7+a5;var a8=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))/50/a9;var a6=-i+a5;return a8*a6}function an(a4){var i=parseFloat($("#wg_calcium").jqxNumberInput("decimal"))/(B/2);var a5=parseFloat($("#wg_magnesium").jqxNumberInput("decimal"))/(ar/2);var a6=K(a4);return a6-(i/3.5+a5/7)}function M(a5){var ba=an(a5)*parseFloat($("#wg_amount").jqxNumberInput("decimal"));var a8=$("#fermentableGrid").jqxGrid("getrows");for(var a6=0;a6<a8.length;a6++){var a9=a8[a6];if(a9.f_added==0&&a9.f_graintype!=6){var a7=0;if((a9.f_di_ph!=5.7)&&((a9.f_acid_to_ph_57<-0.1)||(a9.f_acid_to_ph_57>0.1))){a7=a9.f_acid_to_ph_57/(a9.f_di_ph-5.7)}else{var a4=a9.f_color;switch(a9.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}}x=a7*(a5-a9.f_di_ph);ba+=x*a9.f_amount}}return ba}function aO(){var a7=0;var a5=5.4;var a4=0.001;var a6=0.1;var i=M(a5);while(((i<-a6)||(i>a6))&&(a7<2000)){a7++;if(i<-a6){a5-=a4}else{if(i>a6){a5+=a4}}i=M(a5)}console.log("MashpH() n: "+a7+" pH: "+a5);return a5}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 R(){console.log("calcWater()");var bm=0;var bB=0;var bc=0;var bn=0;var bd=0;var by=0;var be=0;var bw=0;var bg=0;var bp=0;var bI=0;var bG=0;var bC=0;if(d.w1_name==""){return}if(d.w2_name!=""){bm=d.w1_amount+d.w2_amount;bB=aR(d.w1_amount,d.w2_amount,d.w1_calcium,d.w2_calcium);bc=aR(d.w1_amount,d.w2_amount,d.w1_magnesium,d.w2_magnesium);bn=aR(d.w1_amount,d.w2_amount,d.w1_sodium,d.w2_sodium);be=aR(d.w1_amount,d.w2_amount,d.w1_chloride,d.w2_chloride);bw=aR(d.w1_amount,d.w2_amount,d.w1_sulfate,d.w2_sulfate);bd=aR(d.w1_amount,d.w2_amount,d.w1_total_alkalinity,d.w2_total_alkalinity);bg=-Math.log10(((Math.pow(10,-d.w1_ph)*d.w1_amount)+(Math.pow(10,-d.w2_ph)*d.w2_amount))/bm)}else{bm=d.w1_amount;bB=d.w1_calcium;bc=d.w1_magnesium;bn=d.w1_sodium;be=d.w1_chloride;bw=d.w1_sulfate;bd=d.w1_total_alkalinity;bg=d.w1_ph}$("#wg_amount").val(bm);var bD=bB;$("#wg_calcium").val(Math.round(bB*10)/10);var bF=bc;$("#wg_magnesium").val(Math.round(bc*10)/10);var bo=bn;$("#wg_sodium").val(Math.round(bn*10)/10);var bE=bd;$("#wg_total_alkalinity").val(Math.round(bd*10)/10);var ba=be;$("#wg_chloride").val(Math.round(be*10)/10);var bx=bw;$("#wg_sulfate").val(Math.round(bw*10)/10);var a7=bg;$("#wg_ph").val(Math.round(bg*10)/10);$("#wb_ph").val(Math.round(aO()*10)/10);$("#est_mash_ph").val(Math.round(aO()*10)/10);by=bd*1.22;var a5=by;bp=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*B/U+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*B/ao;bB+=1000*bp/bm;bp=parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*ar/aL;bc+=1000*bp/bm;bp=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ae/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ae/aG;bn+=1000*bp/bm;bp=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*aJ/ao+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*aJ/aL;bw+=1000*bp/bm;bp=2*parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*q/U+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*q/b;be+=1000*bp/bm;if($("#wa_acid_name").val()<0||$("#wa_acid_name").val()>3){$("#wa_acid_name").val(0);d.wa_acid_name=0}if(ah==""){ah=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(aV==""){aV=BaseTypeData[$("#wa_base_name").val()].nl}var bA=d.wa_acid_name;var bq=d.wa_base_name;var bi=t(bA);var a6=bi.pK1;var a4=bi.pK2;var i=bi.pK3;var bh=bi.MolWt;var a9=bi.AcidSG;var a8=bi.AcidPrc;if(d.calc_acid){bG=parseFloat(d.mash_ph);bC=M(bG);console.log("calc_acid tgt: "+bG+" protonDeficit: "+bC);if(bC>0){$("#wa_base").val(0);aC(aV,0);bI=CalcFrac(bG,a6,a4,i);Acid=bC/bI;Acid*=bh;Acidmg=Acid;Acid=Acid/a9;if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(a8)}Acid=Acid*a8/(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);console.log("Final ml: "+Acid);$("#wa_acid").val(Math.round(Acid*100)/100);aC(AcidTypeData[bA].nl,Math.round(Acid*100)/100);by=by-bC*bI/bm;bd=by*50/61}else{if(bC<0){$("#wa_acid").val(0);aC(ah,0);var bs=Math.pow(10,(bG-6.38));var bk=Math.pow(10,(bG-10.38));var bb=1/(1+bs+bs*bk);var bt=bb*bs;var bl=bt*bk;switch(bq){case 0:bp=-bC/(bb-bl);bp=bp*aG/1000;$("#wa_base").val(Math.round(bp*100)/100);aC("NaHCO3",Math.round(bp*100)/100);if(bm>0){bp=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ae/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ae/aG;bp=1000*bp/bm;bn=bo+bp;bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/aG;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 1:bp=-bC/(2*bb+bt);bp=bp*z/1000;$("#wa_base").val(Math.round(bp*100)/100);aC("Na2CO3",Math.round(bp*100)/100);if(bm>0){bp=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ae/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*ae/z;bp=1000*bp/bm;bn=bo+bp;bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/z;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 2:bp=-bC*(bb-bl);bp=bp*g/1000;bp=3*bp;$("#wa_base").val(Math.round(bp*100)/100);aC("CaCO3",Math.round(bp*100)/100);if(bm>0){bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*r/g;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*B/U+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*B/ao+parseFloat($("#wa_base").jqxNumberInput("decimal"))*B/g;bp=1000*bp/bm;bB=bD+bp;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 3:bp=-bC/19.3;$("#wa_base").val(Math.round(bp*100)/100);aC("Ca(OH)2",Math.round(bp*100)/100);if(bm>0){bp=-bC/bm;bd=bE+bp;by=bd*61/50;bp=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*B/U+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*B/ao+parseFloat($("#wa_base").jqxNumberInput("decimal"))*B/aK;bp=1000*bp/bm;bB=bD+bp;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium)}break}}}bg=bG;$("#wb_ph").val(Math.round(bg*10)/10);$("#est_mash_ph").val(Math.round(bg*10)/10)}else{console.log("calc_acid no");if(parseFloat($("#wa_base").jqxNumberInput("decimal"))>0){if(bm>0){switch(bq){case 0:bp=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ae/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*ae/aG;bp=1000*bp/bm;bn=bo+bp;bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/aG;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 1:bp=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*ae/b+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*ae/z;bp=1000*bp/bm;bn=bo+bp;bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))*r/z;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 2:bp=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*r/g;bp=1000*bp/bm;by=a5+bp;bd=by*50/61;bp=at(wb_total_alkalinity,wb_calcium,wb_magnesium);bp=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*B/U+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*B/ao+parseFloat($("#wa_base").jqxNumberInput("decimal"))*B/g;bp=1000*bp/bm;bB=bD+bp;break}}}bG=parseFloat(d.mash_ph);pHa=aO();if(parseFloat($("#wa_acid").jqxNumberInput("decimal"))>0){console.log("TpH: "+bG+" water: "+pHa);Acid=parseFloat($("#wa_acid").jqxNumberInput("decimal"));if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(a8)}Acid=Acid/a8*(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);Acid*=a9;Acid/=bh;Acidmg=Acid;bI=CalcFrac(pHa,a6,a4,i);bC=Acid*bI;var bz=0.001;var br=0.1;var bj=M(pHa);var bv=0;while(((bj<(bC-br))||(bj>(bC+br)))&&(bv<2000)){bv++;if(bj<(bC-br)){pHa-=bz}else{if(bj>(bC+br)){pHa+=bz}}bI=CalcFrac(pHa,a6,a4,i);bC=Acid*bI;bj=M(pHa)}console.log("n: "+bv+" pd: "+bj+" protonDeficit: "+bC+" frac: "+bI+" pHa: "+pHa);bp=a5-bC*bI/bm;by=bp;bd=bp*50/61;bg=pHa;$("#wb_ph").val(Math.round(bg*10)/10);$("#est_mash_ph").val(Math.round(bg*10)/10)}}if((bA==3)&&(bm>0)){bp=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*aJ/ao+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*aJ/aL+Acidmg/1000*aJ/(aJ+2);bp=1000*bp/bm;bw=bx+bp}else{if((bA==1)&&(bm>0)){bp=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*q/U+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*q/b+Acidmg/1000*q/(q+1);bp=1000*bp/bm;be=ba+bp}}$("#tgt_bu").val(Math.round(S()*100)/100);if(S()<0.32){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig en zoet</span>")}else{if(S()<0.43){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig, zoet</span>")}else{if(S()<0.52){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Evenwichtig</span>")}else{if(S()<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(l()*10)/10);if(bw>0){bp=be/bw}else{bp=10}$("#got_cl_so4").val(Math.round(bp*10)/10);var bH=0.8*l();var bu=1.2*l();var bf="normaal";if(bp<bH){bf="laag"}else{if(bp>bu){bf="hoog"}}m("cl_so4",bf);$("#wb_calcium").val(Math.round(bB*10)/10);$("#wb_magnesium").val(Math.round(bc*10)/10);$("#wb_sodium").val(Math.round(bn*10)/10);$("#wb_sulfate").val(Math.round(bw*10)/10);$("#wb_chloride").val(Math.round(be*10)/10);$("#wb_total_alkalinity").val(Math.round(bd*10)/10);if(bB<40){m("calcium","laag")}else{if(bB>150){m("calcium","hoog")}else{m("calcium","normaal")}}if(bc>=0&&bc<=30){m("magnesium","normaal")}else{m("magnesium","hoog")}if(bn<=150){m("sodium","normaal")}else{m("sodium","hoog")}if(be<=50){m("chloride","laag")}else{if(be<=100){m("chloride","normaal")}else{m("chloride","hoog")}}if(bw<=50){m("sulfate","laag")}else{if(bw<=350){m("sulfate","normaal")}else{m("sulfate","hoog")}}if(bg<5.2){m("ph","laag")}else{if(bg>5.6){m("ph","hoog")}else{m("ph","normaal")}}j();aH();H()}function j(){var a6=d.sparge_ph;var bk=d.w1_ph;var bi=d.w1_total_alkalinity;if(d.sparge_source==1){if(d.w2_ph>0){bk=d.w2_ph;bi=d.w2_total_alkalinity}else{d.sparge_source=0;$("#sparge_source").val(0)}}else{if(d.sparge_source==2){if(d.w2_ph>0){bk=parseFloat($("#wg_ph").jqxNumberInput("decimal"));bi=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))}else{d.sparge_source=0;$("#sparge_source").val(0)}}}var br=Math.pow(10,bk-6.38);var bq=Math.pow(10,bk-10.373);var bu=1+br+br*bq;var bo=1/bu;var bn=br/bu;var bm=br*bq/bu;var bp=Math.pow(10,4.3-6.38);var ba=Math.pow(10,4.3-10.373);var bz=1+bp+bp*ba;var bx=1/bz;var bh=bp/bz;var a4=bp*ba/bz;var a8=bi/50;var bc=(a8-1000*(Math.pow(10,-4.3)-Math.pow(10,-bk)))/((bx-bo)+(bm-a4));var bj=Math.pow(10,a6-6.38);var bv=Math.pow(10,a6-10.373);var bt=1+bj+bj*bv;var bw=1/bt;var a9=bj/bt;var bl=bj*bv/bt;var a5=bc*((bw-bo)+(bm-bl))+Math.pow(10,-a6)-Math.pow(10,-bk);a5+=0.01;if(d.sparge_acid_type<0||d.sparge_acid_type>3){d.sparge_acid_type=0;$("#sparge_acid_type").val(0)}var bb=d.sparge_acid_type;var bg=t(bb);var bf=bg.pK1;var be=bg.pK2;var bd=bg.pK3;var by=bg.MolWt;var a7=bg.AcidSG;var i=bg.AcidPrc;var bs=CalcFrac(a6,bf,be,bd);a5/=bs;a5*=by;a5=a5/a7;var bo=d.sparge_acid_perc;if(bo<=0.1){bo=i}a5=a5*i/(bo/100);a5*=d.sparge_volume;a5=Math.round(a5*100)/100;d.sparge_acid_amount=a5/1000;$("#sparge_acid_amount").val(a5)}function O(){if(d.brew_fermenter_sg<1.02){return}var a6=sg_to_brix(d.brew_fermenter_sg);if((d.primary_end_sg>0.99)&&(d.primary_end_sg<d.brew_fermenter_sg)){var a4=Round(100*(d.brew_fermenter_sg-d.primary_end_sg)/(d.brew_fermenter_sg-1),1);$("#primary_svg").val(a4);if((d.secondary_end_sg>0.99)&&(d.secondary_end_sg<d.brew_fermenter_sg)){var 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)){var a7=Round(100*(d.brew_fermenter_sg-d.fg)/(d.brew_fermenter_sg-1),1);$("#final_svg").val(a7);var a5=Round(abvol(d.brew_fermenter_sg,d.fg),2);$("#final_abv").val(a5)}}}}function ap(a4,i){var a5=i*1.8+32;return 3.0378-0.050062*a5+0.00026555*a5*a5}function Y(a4,i,a6){var a5=a6*(a4-ap(a4,i))/0.286;if(a5<0){a5=0}return Round(a5,3)}function o(a4,a7,a6){var i=a4-ap(a4,a7);if(i<0){return 0}var a5=-1.09145427669121+0.00800006989646477*a6+0.000260276315484684*a6*a6+0.0215142075945119*a6*i+0.674996600795854*i+-0.00471757220150754*i*i;if(a5<0){a5=0}a5=a5*1.01325;return Round(a5,1)}function aa(a4,i){return(a4-(-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 aU(){var bb=d.secondary_temp;if(bb<1){bb=d.primary_end_temp}if(bb<1){bb=18}if(d.fg==0){var a8=abvol(d.brew_fermenter_sg,parseFloat($("#est_fg").jqxNumberInput("decimal")))}else{var a8=abvol(d.brew_fermenter_sg,d.fg)}var bc=d.package_volume-(a8*d.package_volume)/100;var ba=d.package_volume-bc;var bg=d.package_infuse_amount-(d.package_infuse_abv*d.package_infuse_amount)/100;var bd=d.package_infuse_amount-bg;var bi=ba+bd;var a4=bc+bg;a8=Round(bi/(a4+bi)*100,2);d.package_abv=a8;$("#package_abv").val(a8);if(!(rows=$("#fermentableGrid").jqxGrid("getrows"))){return}d.bottle_priming_amount=0;d.bottle_priming_total=0;for(var a7=0;a7<rows.length;a7++){var bj=rows[a7];if(bj.f_added==4){var bf=1/((bj.f_yield/100)*(1-bj.f_moisture/100));d.bottle_priming_amount=Y(d.bottle_carbonation,bb,bf);d.bottle_priming_total=Round(d.bottle_amount*d.bottle_priming_amount,2);$("#fermentableGrid").jqxGrid("setcellvalue",a7,"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);var a9=a8+d.bottle_priming_amount*0.47/7.907;var a5=d.bottle_amount-(a9*d.bottle_amount)/100;var bi=d.bottle_amount-a5;var a4=a5+d.bottle_priming_water;var a6=Round(bi/(a4+bi)*100,2);$("#bottle_abv").val(a6);$("#bottle_pressure").val(o(d.bottle_carbonation,bb,d.bottle_carbonation_temp));var be=aa(d.keg_carbonation,d.keg_carbonation_temp);if(be<0){be=0}d.keg_pressure=be;$("#keg_pressure").val(Round(be,1));d.keg_priming_amount=0;d.keg_priming_total=0;if(!d.keg_forced_carb){for(var a7=0;a7<rows.length;a7++){var bj=rows[a7];if(bj.f_added==5){var bf=1/((bj.f_yield/100)*(1-bj.f_moisture/100));d.keg_priming_amount=Y(d.keg_carbonation,bb,bf);d.keg_priming_total=Round(d.keg_amount*d.keg_priming_amount,2);$("#fermentableGrid").jqxGrid("setcellvalue",a7,"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);var a9=a8+d.keg_priming_amount*0.47/7.907;var a5=d.keg_amount-(a9*d.keg_amount)/100;var bi=d.keg_amount-a5;var a4=a5+d.keg_priming_water;var bh=Round(bi/(a4+bi)*100,2);$("#keg_abv").val(bh)}else{$("#keg_priming_amount").val(0);$("#keg_priming_total").val(0);$("#keg_abv").val(a8)}}function aW(){var a7=d.stage;if(a7==0&&d.est_og>1.005&&d.est_color>3&&d.est_ibu>3){a7=1}if(a7==1&&parseFloat($("#brew_date_start").val())>2000){a7=2}if(a7==2&&($("#brew_date_start").val()=="")){a7=1}if(a7==2&&parseFloat($("#brew_date_end").val())>2000){a7=3}if(a7==3&&parseFloat($("#primary_end_date").val())>2000){a7=4}if(a7==4&&parseFloat($("#secondary_end_date").val())>2000){a7=5}if(a7==5&&parseFloat($("#package_date").val())>2000){a7=6}if(a7>=6&&a7<9){var a6=new Date();var a4=$("#package_date").val();a4=a4.split("-");date1=new Date(a6.getFullYear(),a6.getMonth(),a6.getDate());a4=new Date(a4[0],a4[1]-1,a4[2]);date1_unixtime=parseInt(date1.getTime()/1000);date2_unixtime=parseInt(a4.getTime()/1000);var i=date1_unixtime-date2_unixtime;var a5=i/60/60/24;if(a5>0){if(a5>=42){a7=9}else{if(a5>=14){a7=8}else{a7=7}}}}if(a7==9&&parseFloat($("#taste_date").val())>2000){a7=10}if(a7!=d.stage){console.log("calcStage() old: "+d.stage+" new: "+a7);d.stage=a7}$("#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 aY(){console.log("calcInit()");a2();y();T();$("#starter_enable").on("checked",function(i){d.starter_enable=1;J();Z()});$("#starter_enable").on("unchecked",function(i){d.starter_enable=0;J();Z()});$("#starter_try").click(function(){$("#prop1_volume").val(0);$("#prop2_volume").val(0);$("#prop3_volume").val(0);$("#prop4_volume").val(0);Z()});$("#starter_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.starter_type=i;Z()}});$("#starter_sg").on("change",function(i){if(i.args){d.starter_sg=i.args.value;Z()}});$("#starter_viability").on("change",function(i){if(i.args){d.starter_viability=i.args.value;V();Z()}});$("#prop1_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.prop1_type=i;Z()}});$("#prop1_volume").on("change",function(i){if(i.args){d.prop1_volume=i.args.value;Z()}});$("#prop2_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.prop2_type=i;Z()}});$("#prop2_volume").on("change",function(i){if(i.args){d.prop2_volume=i.args.value;Z()}});$("#prop3_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.prop3_type=i;Z()}});$("#prop3_volume").on("change",function(i){if(i.args){d.prop3_volume=i.args.value;Z()}});$("#prop4_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.prop4_type=i;Z()}});$("#prop4_volume").on("change",function(i){if(i.args){d.prop4_volume=i.args.value;Z()}});$("#calc_acid").on("checked",function(i){d.calc_acid=1;R()});$("#calc_acid").on("unchecked",function(i){d.calc_acid=0;R()});$("#w1_name").jqxDropDownList("selectItem",d.w1_name);$("#w2_name").jqxDropDownList("selectItem",d.w2_name);if(parseFloat($("#w1_amount").jqxNumberInput("decimal"))==0&&D>0){$("#w1_amount").val(D);d.w1_amount=D;$("#wg_amount").val(D);$("#w2_amount").val(0);d.w2_amount=0}R();$("#w2_amount").on("change",function(i){var a4=parseFloat(i.args.value);if(a4>D){$("#w2_amount").val(d.w2_amount);return}d.w1_amount=parseFloat($("#wg_amount").jqxNumberInput("decimal"))-a4;$("#w1_amount").val(d.w1_amount);d.w2_amount=a4;console.log("new: "+i.args.value+" w1: "+d.w1_amount+"  w2: "+d.w2_amount);R()});$("#wa_cacl2").on("change",function(i){if(i.args){aC("CaCl2",0);aC("CaCl2",i.args.value);R()}});$("#wa_caso4").on("change",function(i){if(i.args){aC("CaSO4",0);aC("CaSO4",i.args.value);R()}});$("#wa_mgso4").on("change",function(i){if(i.args){aC("MgSO4",0);aC("MgSO4",i.args.value);R()}});$("#wa_nacl").on("change",function(i){if(i.args){aC("NaCl",0);aC("NaCl",i.args.value);R()}});$("#wa_base_name").on("change",function(a4){if(a4.args){var i=a4.args.index;console.log("wa_base_name "+i);aC(aV,0);aV=BaseTypeData[i].nl;aC(aV,parseFloat($("#wa_base").jqxNumberInput("decimal")));d.wa_base_name=i;R()}});$("#wa_base").on("change",function(a4){var i=BaseTypeData[$("#wa_base_name").val()].nl;aC(i,parseFloat(a4.args.value));R()});$("#wa_acid_name").on("change",function(a4){if(a4.args){var i=a4.args.index;console.log("wa_acid_name "+i);aC(ah,0);ah=AcidTypeData[i].nl;aC(ah,parseFloat($("#wa_acid").jqxNumberInput("decimal")));d.wa_acid_name=i;R()}});$("#wa_acid").on("change",function(a4){var i=AcidTypeData[$("#wa_acid_name").val()].nl;aC(i,parseFloat(a4.args.value));R()});$("#wa_acid_perc").on("change",function(i){R()});$("#color_method").on("change",function(i){d.color_method=i.args.index;V()});$("#ibu_method").on("change",function(i){d.ibu_method=i.args.index;V();au()});$("#batch_size").on("change",function(a5){console.log("batch_size change:"+a5.args.value+" old:"+d.batch_size);$("#est_a_vol").val(a5.args.value*1.04);var a4=parseFloat(a5.args.value)+d.boil_size-d.batch_size;var i=parseFloat(a5.args.value)/d.batch_size;d.boil_size=a4;$("#boil_size").val(Math.round(a4*100)/100);$("#est_pre_vol").val(Math.round(a4*1.04*100)/100);d.sparge_volume*=i;$("#sparge_volume").val(d.sparge_volume);$("#brew_sparge_volume").val(d.sparge_volume);d.batch_size=parseFloat(a5.args.value);ag(parseFloat($("#est_og").jqxNumberInput("decimal")));aw(i);V();ak(i);a3(i);aQ(i);au();R();j();aP()});$("#boil_time").on("change",function(a5){console.log("boil_time change:"+parseFloat(a5.args.value)+" old:"+d.boil_time);var a6=parseFloat(d.boil_size)-parseFloat(d.batch_size);var i=a6*(parseFloat(a5.args.value)/d.boil_time);var a4=parseFloat(d.batch_size)+i;d.boil_time=parseFloat(a5.args.value);d.boil_size=a4;$("#est_pre_vol").val(Math.round(a4*1.04*100)/100);$("#boil_size").val(Math.round(a4*100)/100);V();au();Z()});$("#efficiency").on("change",function(a4){var i=parseFloat($("#est_og").jqxNumberInput("decimal"));d.efficiency=parseFloat(a4.args.value);console.log("efficiency change:"+d.efficiency+" est_og:"+i);ag(i);V();au();Z()});$("#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);ag(d.est_og);V();au();aP();Z()});$("#mash_ph").on("change",function(i){d.mash_ph=parseFloat(i.args.value);R()});$("#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(a4){if(a4.args){var i=a4.args.index;d.sparge_source=i;j()}});$("#sparge_acid_type").on("change",function(a4){if(a4.args){var i=a4.args.index;d.sparge_acid_type=i;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()});O();aU();$("#package_volume").on("change",function(a4){var i=d.package_volume+d.package_infuse_amount;d.package_volume=parseFloat(a4.args.value);if(d.package_volume>d.brew_fermenter_volume){d.package_volume=d.brew_fermenter_volume;$("#package_volume").val(d.package_volume)}var a6=d.package_volume+d.package_infuse_amount;var a5=a6-i;if(i>0){d.bottle_amount+=(d.bottle_amount/i)*a5;d.keg_amount+=(d.keg_amount/i)*a5}else{d.bottle_amount=a6;d.keg_amount=0}console.log("diff:"+a5+" 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);aU()});$("#package_infuse_amount").on("change",function(a4){var i=d.package_volume+d.package_infuse_amount;d.package_infuse_amount=parseFloat(a4.args.value);var a6=d.package_volume+d.package_infuse_amount;var a5=a6-i;if(i>0){d.bottle_amount+=(d.bottle_amount/i)*a5;d.keg_amount+=(d.keg_amount/i)*a5}else{d.bottle_amount=a6;d.keg_amount=0}console.log("diff:"+a5+" 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);aU()});$("#package_infuse_abv").on("change",function(i){d.package_infuse_abv=parseFloat(i.args.value);aU()});$("#bottle_amount").on("change",function(a5){var a4=parseFloat(a5.args.value);var i=d.package_volume+d.package_infuse_amount;if(a4>i){a4=i}diff=d.bottle_amount-a4;d.bottle_amount=Math.round((d.bottle_amount-diff)*1000)/1000;d.keg_amount=Math.round((d.keg_amount+diff)*1000)/1000;$("#bottle_amount").val(parseFloat(d.bottle_amount));$("#keg_amount").val(parseFloat(d.keg_amount));aU()});$("#bottle_priming_water").on("change",function(i){d.bottle_priming_water=parseFloat(i.args.value);aU()});$("#keg_amount").on("change",function(a5){var a4=parseFloat(a5.args.value);var i=d.package_volume+d.package_infuse_amount;if(a4>i){a4=i}diff=d.keg_amount-a4;d.bottle_amount=Math.round((d.bottle_amount+diff)*1000)/1000;d.keg_amount=Math.round((d.keg_amount-diff)*1000)/1000;$("#bottle_amount").val(parseFloat(d.bottle_amount));$("#keg_amount").val(parseFloat(d.keg_amount));aU()});$("#keg_priming_water").on("change",function(i){d.keg_priming_water=parseFloat(i.args.value);aU()});$("#bottle_carbonation").on("change",function(i){d.bottle_carbonation=parseFloat(i.args.value);aU()});$("#bottle_carbonation_temp").on("change",function(i){d.bottle_carbonation_temp=parseFloat(i.args.value);aU()});$("#keg_carbonation").on("change",function(i){d.keg_carbonation=parseFloat(i.args.value);aU()});$("#keg_forced_carb").on("checked",function(i){d.keg_forced_carb=1;aU()});$("#keg_forced_carb").on("unchecked",function(i){d.keg_forced_carb=0;aU()});$("#keg_carbonation_temp").on("change",function(i){d.keg_carbonation_temp=parseFloat(i.args.value);aU()});$("#brew_fermenter_extrawater").on("change",function(i){d.brew_fermenter_extrawater=parseFloat(i.args.value);V();au();Z()});$("#brew_fermenter_tcloss").on("change",function(i){d.brew_fermenter_tcloss=parseFloat(i.args.value);V();au();Z()});$("#primary_end_sg").on("change",function(i){d.primary_end_sg=parseFloat(i.args.value);O()});$("#primary_end_brix").on("change",function(a4){if(d.brew_fermenter_sg>=1.02){OBrix=sg_to_brix(d.brew_fermenter_sg);FBrix=parseFloat(a4.args.value);var i=Round(1.0031-0.002318474*OBrix-0.000007775*(OBrix*OBrix)-3.4e-8*Math.pow(OBrix,3)+0.00574*(FBrix)+0.00003344*(FBrix*FBrix)+8.6e-8*Math.pow(FBrix,3),4);if(FBrix>0.05){$("#primary_end_sg").val(i);d.primary_end_sg=i}O()}});$("#secondary_end_sg").on("change",function(i){d.secondary_end_sg=parseFloat(i.args.value);O()});$("#secondary_end_brix").on("change",function(a4){if(d.brew_fermenter_sg>=1.02){OBrix=sg_to_brix(d.brew_fermenter_sg);FBrix=parseFloat(a4.args.value);var i=Round(1.0031-0.002318474*OBrix-0.000007775*(OBrix*OBrix)-3.4e-8*Math.pow(OBrix,3)+0.00574*(FBrix)+0.00003344*(FBrix*FBrix)+8.6e-8*Math.pow(FBrix,3),4);if(FBrix>0.05){$("#secondary_end_sg").val(i);d.secondary_end_sg=i}O()}});$("#final_brix").on("change",function(a4){if(d.brew_fermenter_sg>=1.02){OBrix=sg_to_brix(d.brew_fermenter_sg);FBrix=parseFloat(a4.args.value);var i=Round(1.0031-0.002318474*OBrix-0.000007775*(OBrix*OBrix)-3.4e-8*Math.pow(OBrix,3)+0.00574*(FBrix)+0.00003344*(FBrix*FBrix)+8.6e-8*Math.pow(FBrix,3),4);if(FBrix>0.05){$("#fg").val(i);d.fg=i}O()}});$("#fg").on("change",function(i){d.fg=parseFloat(i.args.value);O()});$("#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(a4,i,a6){var a5=styleslist.records[a4];return a5.style_guide+" "+a5.style_letter+" "+a5.name}});$("#styleSelect").on("select",function(a5){if(a5.args){var i=a5.args.index;var a4=styleslist.records[i];$("#st_name").val(a4.name);$("#st_category").val(a4.category);$("#st_category_number").val(a4.category_number);$("#st_letter").val(a4.style_letter);$("#st_guide").val(a4.style_guide);$("#st_type").val(StyleTypeData[a4.type].nl);$("#st_og_min").val(a4.og_min);$("#st_og_max").val(a4.og_max);$("#st_fg_min").val(a4.fg_min);$("#st_fg_max").val(a4.fg_max);$("#st_ibu_min").val(a4.ibu_min);$("#st_ibu_max").val(a4.ibu_max);$("#st_color_min").val(a4.color_min);$("#st_color_max").val(a4.color_max);$("#st_carb_min").val(a4.carb_min);$("#st_carb_min2").val(a4.carb_min);$("#st_carb_max").val(a4.carb_max);$("#st_carb_max2").val(a4.carb_max);$("#st_abv_min").val(a4.abv_min);$("#st_abv_max").val(a4.abv_max)}});$("#equipmentSelect").jqxDropDownList({placeHolder:"Kies apparatuur:",theme:theme,source:equipmentlist,displayMember:"name",width:170,height:23,dropDownWidth:300,renderer:function(a4,i,a6){var a5=equipmentlist.records[a4];return a5.batch_size+" liter "+a5.name}});$("#equipmentSelect").on("select",function(a6){if(a6.args){var i=a6.args.index;var a5=equipmentlist.records[i];var a4=a5.batch_size/d.batch_size;$("#eq_name").val(a5.name);$("#eq_boil_size").val(a5.boil_size);d.boil_size=a5.boil_size;$("#boil_size").val(a5.boil_size);$("#eq_batch_size").val(a5.batch_size);d.batch_size=a5.batch_size;$("#batch_size").val(a5.batch_size);$("#est_a_vol").val(a5.batch_size*1.04);$("#eq_tun_volume").val(a5.tun_volume);d.eq_tun_weight=a5.tun_weight;d.eq_tun_specific_heat=a5.tun_specific_heat;d.eq_tun_material=a5.tun_material;d.eq_tun_height=a5.tun_height/100;$("#eq_top_up_water").val(a5.top_up_water);d.eq_trub_chiller_loss=a5.trub_chiller_loss;$("#eq_trub_chiller_loss").val(a5.trub_chiller_loss);$("#eq_evap_rate").val(a5.evap_rate);$("#eq_boil_time").val(a5.boil_time);d.eq_calc_boil_volume=a5.calc_boil_volume;$("#eq_top_up_kettle").val(a5.top_up_kettle);$("#eq_hop_utilization").val(a5.hop_utilization);$("#eq_notes").val(a5.notes);$("#eq_lauter_volume").val(a5.lauter_volume);d.eq_lauter_height=a5.lauter_height/100;$("#eq_lauter_deadspace").val(a5.lauter_deadspace);$("#eq_kettle_volume").val(a5.kettle_volume);d.eq_kettle_height=a5.kettle_height/100;$("#eq_mash_volume").val(a5.mash_volume);$("#eq_mash_max").val(a5.mash_max);d.eq_mash_max=a5.mash_max;$("#mash_max").val(a5.mash_max);$("#eq_efficiency").val(a5.efficiency);d.efficiency=a5.efficiency;$("#efficiency").val(a5.efficiency);d.sparge_volume=Math.round(a5.boil_size*5)/10;$("#sparge_volume").val(d.sparge_volume);$("#brew_sparge_volume").val(d.sparge_volume);$("#est_pre_vol").val(a5.boil_size*1.04);ag(parseFloat($("#est_og").jqxNumberInput("decimal")));aw(a4);V();ak(a4);a3(a4);aQ(a4);au();R();j()}});function s(){console.log("saveRecord()");var a4=$("#fermentableGrid").jqxGrid("getrows");var a7=$("#hopGrid").jqxGrid("getrows");var a5=$("#miscGrid").jqxGrid("getrows");var i=$("#yeastGrid").jqxGrid("getrows");var a6=$("#mashGrid").jqxGrid("getrows");var a9={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")),fermentables:a4,hops:a7,miscs:a5,yeasts:i,mashs:a6};var a8="update=true&"+$.param(a9);$.ajax({dataType:"json",url:F,cache:false,data:a8,async:false,type:"POST",success:function(bb,ba,bc){console.log("saveRecord() success")},error:function(ba,bc,bb){console.log("saveRecord() error")}})}var d={};var F="includes/db_product.php";var aS={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:"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};var ai=new $.jqx.dataAdapter(aS,{loadComplete:function(){var i=ai.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);n(d);aT(d);X(d);aN(d);av(d);aW();$("#jqxTabs").jqxTabs("select",2)},loadError:function(a5,i,a4){},beforeLoadComplete:function(i){$("#jqxLoader").jqxLoader("open")}});ai.dataBind();var n=function(a4){var i={localdata:a4.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(a7,a9,a6,a8){a8(true)},deleterow:function(a6,a7){a7(true)},updaterow:function(a6,a8,a7){a7(true)}};var a5=new $.jqx.dataAdapter(i);$("#fermentableGrid").jqxGrid({width:1240,height:470,source:a5,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a8){var a7=this;var a6=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a8.append(a6);a6.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>');a6.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a6.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>');a6.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(ba,a9,bc){var bb=fermentablelist.records[ba];return bb.supplier+" / "+bb.name+" ("+bb.color+" EBC)"}});$("#faddrowbutton").on("select",function(bb){if(bb.args){var be=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;var a9=bb.args.index;var ba=fermentablelist.records[a9];var bd={};bd.f_name=ba.name;bd.f_origin=ba.origin;bd.f_supplier=ba.supplier;bd.f_amount=0;bd.f_cost=ba.cost;bd.f_type=ba.type;bd.f_yield=ba.yield;bd.f_color=ba.color;bd.f_coarse_fine_diff=ba.coarse_fine_diff;bd.f_moisture=ba.moisture;bd.f_diastatic_power=ba.diastatic_power;bd.f_protein=ba.protein;bd.f_max_in_batch=ba.max_in_batch;bd.f_graintype=ba.graintype;if(ba.add_after_boil){bd.f_added=2}else{if((ba.type==1)||(ba.type==4)){bd.f_added=1}else{bd.f_added=0}}bd.f_dissolved_protein=ba.dissolved_protein;bd.f_recommend_mash=ba.recommend_mash;bd.f_add_after_boil=ba.add_after_boil;if(be==0){bd.f_adjust_to_total_100=1;bd.f_percentage=100}else{bd.f_adjust_to_total_100=0;bd.f_percentage=0}bd.f_di_ph=ba.di_ph;bd.f_acid_to_ph_57=ba.acid_to_ph_57;bd.f_inventory=ba.inventory;var bc=$("#fermentableGrid").jqxGrid("addrow",null,bd)}});$("#finstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#finstockbutton").on("change",function(a9){fermentableinstock=a9.args.checked;fermentablelist.dataBind()});$("#fdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#fdeleterowbutton").on("click",function(){var bb=$("#fermentableGrid").jqxGrid("getselectedrowindex");var bg=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(bb>=0&&bb<bg){var bf=$("#fermentableGrid").jqxGrid("getrowid",bb);var bc=$("#fermentableGrid").jqxGrid("getcellvalue",bf,"f_percentage");var ba=$("#fermentableGrid").jqxGrid("getcellvalue",bf,"f_amount");var bd=$("#fermentableGrid").jqxGrid("deleterow",bf)}bg=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(bg>1){if(k){for(var a9=0;a9<bg;a9++){var be=$("#fermentableGrid").jqxGrid("getrowdata",a9);if(be.f_adjust_to_total_100){be.f_percentage+=bc;be.f_amount+=ba}}}else{aX()}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}V();au()})},ready:function(){V();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Vergistbaar ingredi&euml;nt",datafield:"f_name",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+bb.f_supplier+" / "+bb.f_name+" ("+bb.f_color+" EBC)</span>"}},{text:"Type",width:100,datafield:"f_type",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+FermentableTypeData[ba].nl+"</span>"}},{text:"Moment",width:110,datafield:"f_added",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+AddedData[ba].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(ba,a8,a9,a6,bc,bb){var a7="#ffffff";if(((d.inventory_reduced<=2)&&(bb.f_added<=1))||((d.inventory_reduced<=3)&&(bb.f_added==2))||((d.inventory_reduced<=5)&&(bb.f_added==3))||((d.inventory_reduced<=6)&&(bb.f_added==4))||((d.inventory_reduced<=6)&&(bb.f_added==5))){if(a9<bb.f_amount){a7="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a7+';">'+a5.formatNumber(a9,"f3")+"</span>"}else{return"<span></span>"}}},{text:"Procent",datafield:"f_percentage",width:90,align:"right",cellsrenderer:function(ba,a8,a9,a6,bc,bb){if(bb.f_added>=4){return"<span></span>"}var a7="#ffffff";if(a9>bb.f_max_in_batch){a7="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a7+';">'+a5.formatNumber(a9,"p1")+"</span>"}},{text:"100%",datafield:"f_adjust_to_total_100",width:70,align:"center",cellsalign:"center",cellsrenderer:function(a7,a6,ba,a9,a8,bb){if(ba==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(a6){u=a6;aM=$("#fermentableGrid").jqxGrid("getrowdata",u);if(aM.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(aM.f_name);$("#wf_amount").val(aM.f_amount);$("#wf_percentage").val(aM.f_percentage);$("#wf_max_in_batch").val(aM.f_max_in_batch);$("#wf_adjust_to_total_100").val(aM.f_adjust_to_total_100);$("#wf_added").val(aM.f_added);$("#popupFermentable").jqxWindow("open")}}}}]})};var aT=function(i){var a5={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(a7,a9,a6,a8){console.log("hop addrow "+a7);a8(true)},deleterow:function(a6,a7){console.log("hop deleterow "+a6);a7(true)},updaterow:function(a6,a8,a7){console.log("hop updaterow "+a6);a7(true)}};var a4=new $.jqx.dataAdapter(a5);$("#hopGrid").jqxGrid({width:1240,height:560,source:a4,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a8){var a7=this;var a6=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a8.append(a6);a6.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>');a6.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a6.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>');a6.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(ba,a9,bc){var bb=hoplist.records[ba];return bb.origin+" - "+bb.name+" / "+HopFormData[bb.form].nl+" ("+bb.alpha+"% &alpha;)"}});$("#haddrowbutton").on("select",function(bb){if(bb.args){var a9=bb.args.index;var ba=hoplist.records[a9];var bd={};bd.h_name=ba.name;bd.h_origin=ba.origin;bd.h_amount=0;bd.h_cost=ba.cost;bd.h_type=ba.type;bd.h_form=ba.form;bd.h_useat=2;bd.h_time=0;bd.h_alpha=ba.alpha;bd.h_beta=ba.beta;bd.h_hsi=ba.hsi;bd.h_humulene=ba.humulene;bd.h_caryophyllene=ba.caryophyllene;bd.h_cohumulone=ba.cohumulone;bd.h_myrcene=ba.myrcene;bd.h_total_oil=ba.total_oil;bd.h_inventory=ba.inventory;var bc=$("#hopGrid").jqxGrid("addrow",null,bd)}$("#haddrowbutton").jqxDropDownList("clearSelection")});$("#hinstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#hinstockbutton").on("change",function(a9){hopinstock=a9.args.checked;hoplist.dataBind()});$("#hdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#hdeleterowbutton").on("click",function(){var a9=$("#hopGrid").jqxGrid("getselectedrowindex");var bc=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(a9>=0&&a9<bc){var bb=$("#hopGrid").jqxGrid("getrowid",a9);var ba=$("#hopGrid").jqxGrid("deleterow",bb)}au()})},ready:function(){au();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Hop",datafield:"h_name",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+bb.h_origin+" / "+bb.h_name+"</span>"},},{text:"Type",width:90,datafield:"h_type",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopTypeData[ba].nl+"</span>"}},{text:"Vorm",width:90,datafield:"h_form",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopFormData[ba].nl+"</span>"}},{text:"Alpha",datafield:"h_alpha",width:80,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gebruik",width:110,datafield:"h_useat",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopUseData[ba].nl+"</span>"}},{text:"Tijdsduur",datafield:"h_time",width:90,align:"right",cellsrenderer:function(a7,a6,ba,a9,a8,bc){var bb="";if((bc.h_useat==2)||(bc.h_useat==4)){bb=ai.formatNumber(ba,"f0")+" min."}else{if(bc.h_useat==5){bb=ai.formatNumber(ba/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+bb+"</span>"}},{text:"IBU",datafield:"ibu",width:80,align:"right",cellsrenderer:function(a7,a6,ba,a9,a8,bc){var bb=toIBU(bc.h_useat,bc.h_form,am,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(bc.h_amount),parseFloat(bc.h_time),parseFloat(bc.h_alpha),$("#ibu_method").val());return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ai.formatNumber(bb,"f1")+"</span>"}},{text:"Gewicht",datafield:"h_amount",width:110,align:"right",cellsrenderer:function(a7,a6,bb,ba,a9,bc){var a8=ai.formatNumber(bb,"f1")+" kg";if(bb<1){a8=ai.formatNumber(bb*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+a8+"</span>"}},{text:"Voorraad",datafield:"h_inventory",width:110,align:"right",cellsrenderer:function(a8,a7,bc,bb,ba,bd){if(((d.inventory_reduced<=2)&&(bd.h_useat<=4))||((d.inventory_reduced<=6)&&(bd.h_useat==5))){var a6="#ffffff";if(bc<bd.h_amount){a6="#ff4040"}var a9=ai.formatNumber(bc,"f1")+" kg";if(bc<1){a9=ai.formatNumber(bc*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a6+';">'+a9+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a6){if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{console.log("edit button row "+a6);a=a6;e=$("#hopGrid").jqxGrid("getrowdata",a);$("#wh_name").val(e.h_name);$("#wh_amount").val(e.h_amount*1000);var a7=toIBU(e.h_useat,e.h_form,am,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(a7);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")}}}]})};var X=function(a5){var a4={localdata:a5.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(a7,a9,a6,a8){console.log("misc addrow "+a7);a8(true)},deleterow:function(a6,a7){console.log("misc deleterow "+a6);a7(true)},updaterow:function(a6,a8,a7){console.log("misc updaterow "+a6);a7(true)}};var i=new $.jqx.dataAdapter(a4,{beforeLoadComplete:function(a6){var a8=new Array();for(var a7=0;a7<a6.length;a7++){var a9=a6[a7];a8.push(a9);switch(a9.m_name){case"CaCl2":$("#wa_cacl2").val(a9.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(a9.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(a9.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(a9.m_amount*1000);break;case"Melkzuur":$("#wa_acid_name").val(0);$("#wa_acid").val(a9.m_amount*1000);$("#wa_acid_perc").val(80);ah="Melkzuur";break;case"Zoutzuur":$("#wa_acid_name").val(1);$("#wa_acid").val(a9.m_amount*1000);$("#wa_acid_perc").val(80);ah="Zoutzuur";break;case"Fosforzuur":$("#wa_acid_name").val(2);$("#wa_acid").val(a9.m_amount*1000);$("#wa_acid_perc").val(80);ah="Fosforzuur";break;case"Zwavelzuur":$("#wa_acid_name").val(3);$("#wa_acid").val(a9.m_amount*1000);$("#wa_acid_perc").val(80);ah="Zwavelzuur";break;case"NaHCO3":$("#wa_base_name").val(0);$("#wa_base").val(a9.m_amount*1000);aV="NaHCO3";break;case"Na2CO3":$("#wa_base_name").val(1);$("#wa_base").val(a9.m_amount*1000);aV="Na2CO3";break;case"CaCO3":$("#wa_base_name").val(2);$("#wa_base").val(a9.m_amount*1000);aV="CaCO3";break;case"Ca(OH)2":$("#wa_base_name").val(3);$("#wa_base").val(a9.m_amount*1000);aV="Ca(OH)2";break}}return a8},loadError:function(a8,a6,a7){$("#err").text(a6+" "+a7)},});$("#miscGrid").jqxGrid({width:1240,height:575,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a8){var a7=this;var a6=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a8.append(a6);a6.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>');a6.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a6.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>');a6.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(bb){if(bb.args){var a9=bb.args.index;var ba=misclist.records[a9];var bd={};bd.m_name=ba.name;bd.m_amount=0;bd.m_cost=ba.cost;bd.m_type=ba.type;bd.m_use_use=ba.use_use;bd.m_time=0;bd.m_amount_is_weight=ba.amount_is_weight;bd.m_inventory=ba.inventory;var bc=$("#miscGrid").jqxGrid("addrow",null,bd)}});$("#minstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#minstockbutton").on("change",function(a9){miscinstock=a9.args.checked;misclist.dataBind()});$("#mdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#mdeleterowbutton").on("click",function(){var a9=$("#miscGrid").jqxGrid("getselectedrowindex");var bd=$("#miscGrid").jqxGrid("getdatainformation").rowscount;var ba=$("#miscGrid").jqxGrid("getcellvalue",a9,"m_type");if(a9>=0&&a9<bd&&ba!=4){var bc=$("#miscGrid").jqxGrid("getrowid",a9);var bb=$("#miscGrid").jqxGrid("deleterow",bc)}})},ready:function(){aH();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Ingredient",datafield:"m_name"},{text:"Type",width:140,datafield:"m_type",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscTypeData[ba].nl+"</span>"}},{text:"Gebruik",width:140,datafield:"m_use_use",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscUseData[ba].nl+"</span>"}},{text:"Tijd",datafield:"m_time",width:90,align:"right",cellsrenderer:function(a7,a6,ba,a9,a8,bc){var bb="";if(bc.m_use_use==2){bb=ai.formatNumber(ba,"f0")+" min."}else{if((bc.m_use_use==3)||(bc.m_use_use==4)){bb=ai.formatNumber(ba/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+bb+"</span>"},},{text:"Hoeveel",datafield:"m_amount",width:110,align:"right",cellsrenderer:function(a7,a6,bb,a9,a8,bc){var ba=bc.m_amount_is_weight?"gr":"ml";return'<span style="margin: 4px; margin-top: 6px; float: right;">'+ai.formatNumber(bb*1000,"f2")+" "+ba+"</span>"}},{text:"Voorraad",datafield:"m_inventory",width:110,align:"right",cellsrenderer:function(ba,a6,bb,bd,a7,be){if(((d.inventory_reduced<=2)&&(be.m_use_use<=2))||((d.inventory_reduced<=3)&&(be.m_use_use==3))||((d.inventory_reduced<=5)&&(be.m_use_use==4))||((d.inventory_reduced<=6)&&(be.m_use_use==5))){var bc=be.m_amount_is_weight?"gr":"ml";var a8="#ffffff";if(bb<be.m_amount){a8="#ff4040"}var a9=ai.formatNumber(bb*1000,"f2")+" "+bc;return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a8+';">'+a9+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a6){ax=a6;aI=$("#miscGrid").jqxGrid("getrowdata",ax);if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{if(aI.m_type==4){alert("Brouwzouten wijzigen in de water tab.")}else{console.log("edit button row "+a6);if(aI.m_amount_is_weight){$("#wm_pmpt_amount").html("Gewicht gram:")}else{$("#wm_pmpt_amount").html("Volume ml:")}$("#wm_name").val(aI.m_name);$("#wm_amount").val(aI.m_amount*1000);if((aI.m_use_use==3)||(aI.m_use_use==4)){$("#wm_time").val(aI.m_time/1440)}else{$("#wm_time").val(aI.m_time)}$("#wm_use_use").val(aI.m_use_use);$("#popupMisc").jqxWindow("open")}}}}]})};var aN=function(a4){var i={localdata:a4.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(a7,a9,a6,a8){console.log("yeast addrow "+a7);a8(true)},deleterow:function(a6,a7){console.log("yeast deleterow "+a6);a7(true)},updaterow:function(a6,a8,a7){console.log("yeast updaterow "+a6);a7(true)}};var a5=new $.jqx.dataAdapter(i);$("#yeastGrid").jqxGrid({width:1240,height:350,source:a5,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a8){var a7=this;var a6=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a8.append(a6);a6.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>');a6.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');a6.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>');a6.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(ba,a9,bc){var bb=yeastlist.records[ba];return bb.laboratory+" "+bb.product_id+" "+bb.name}});$("#yaddrowbutton").on("select",function(bb){if(bb.args){var a9=bb.args.index;var ba=yeastlist.records[a9];var bd={};bd.y_name=ba.name;bd.y_laboratory=ba.laboratory;bd.y_product_id=ba.product_id;bd.y_type=ba.type;bd.y_form=ba.form;bd.y_amount=0;bd.y_cost=ba.cost;bd.y_use=0;bd.y_min_temperature=ba.min_temperature;bd.y_max_temperature=ba.max_temperature;bd.y_attenuation=ba.attenuation;bd.y_flocculation=ba.flocculation;bd.y_cells=ba.cells;bd.y_tolerance=ba.tolerance;bd.y_inventory=ba.inventory;var bc=$("#yeastGrid").jqxGrid("addrow",null,bd)}Z();$("#yaddrowbutton").jqxDropDownList("clearSelection")});$("#yinstockbutton").jqxCheckBox({theme:theme,height:27,disabled:(d.stage>3)});$("#yinstockbutton").on("change",function(a9){yeastinstock=a9.args.checked;yeastlist.dataBind()});$("#ydeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#ydeleterowbutton").on("click",function(){var a9=$("#yeastGrid").jqxGrid("getselectedrowindex");var bc=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(a9>=0&&a9<bc){var bb=$("#yeastGrid").jqxGrid("getrowid",a9);var ba=$("#yeastGrid").jqxGrid("deleterow",bb);Z()}})},ready:function(){V();J();Z();$("#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(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastFormData[ba].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(a8,a7,bc,bb,ba,bd){var a6="#ffffff";var a9="";if(bc>0){a9=ai.formatNumber(bc,"f1");if(d.est_abv>bc){a6="#ff4040"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a6+';">'+a9+"</span>"}},{text:"Attn. %",width:70,align:"right",cellsalign:"right",datafield:"y_attenuation",cellsformat:"f1"},{text:"Voor",width:120,datafield:"y_use",cellsrenderer:function(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastUseData[ba].nl+"</span>"}},{text:"Hoeveel",datafield:"y_amount",width:90,align:"right",cellsrenderer:function(a7,a6,bb,ba,a9,bc){var a8=ai.formatNumber(bb*1000,"f0")+" ml";if(bc.y_form==0){a8=ai.formatNumber(bb,"f0")+" pk"}else{if(bc.y_form==1){a8=ai.formatNumber(bb*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+a8+"</span>"}},{text:"Voorraad",datafield:"y_inventory",width:90,align:"right",cellsrenderer:function(a8,a7,bc,bb,ba,bd){if(((d.inventory_reduced<=3)&&(bd.y_use==0))||((d.inventory_reduced<=4)&&(bd.y_use==1))||((d.inventory_reduced<=5)&&(bd.y_use==2))||((d.inventory_reduced<=6)&&(bd.y_use==3))){var a6="#ffffff";if(bc<bd.y_amount){a6="#ff4040"}var a9=ai.formatNumber(bc*1000,"f0")+" ml";if(bd.y_form==0){a9=ai.formatNumber(bc,"f0")+" pk"}else{if(bd.y_form==1){a9=ai.formatNumber(bc*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+a6+';">'+a9+"</span>"}else{return"<span></span>"}}},{text:"",datafield:"Edit",columntype:"button",width:90,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(a6){if(d.stage>3){alert("Ingredieënt is al verwerkt.")}else{aF=a6;f=$("#yeastGrid").jqxGrid("getrowdata",aF);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){$("#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")}}}]})};var av=function(a5){var a4={localdata:a5.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(a7,a9,a6,a8){a8(true)},deleterow:function(a6,a7){a7(true)}};var i=new $.jqx.dataAdapter(a4,{beforeLoadComplete:function(a6){D=0;var a8=new Array();for(var a7=0;a7<a6.length;a7++){var a9=a6[a7];if(a9.step_type==0){D+=parseFloat(a9.step_infuse_amount)}a9.step_thickness=0;a8.push(a9)}},});$("#mashGrid").jqxGrid({width:1240,height:400,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(a8){var a7=this;var a6=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");a8.append(a6);a6.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');a6.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 bb=$("#mashGrid").jqxGrid("getdatainformation").rowscount;var ba={};ba.step_name="Stap "+(bb+1);if(bb>0){ba.step_type=1}else{ba.step_type=0;ba.step_infuse_amount=15}ba.step_temp=62;ba.step_time=20;ba.step_thickness=0;ba.ramp_time=1;ba.end_temp=62;var a9=$("#mashGrid").jqxGrid("addrow",null,ba)});$("#sdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150,disabled:(d.stage>3)});$("#sdeleterowbutton").on("click",function(){var a9=$("#mashGrid").jqxGrid("getselectedrowindex");var bc=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(a9>=0&&a9<bc){var bb=$("#mashGrid").jqxGrid("getrowid",a9);var ba=$("#mashGrid").jqxGrid("deleterow",bb)}})},ready:function(){aY();aP();$("#jqxLoader").jqxLoader("close");$("#jqxTabs").jqxTabs("first")},columns:[{text:"Stap naam",datafield:"step_name"},{text:"Stap type",datafield:"step_type",width:175,cellsrenderer:function(a7,a6,ba,a9,a8,bb){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+MashStepTypeData[ba].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(a6){if(d.stage>3){alert("Het maichen is al gedaan.")}else{al=a6;E=$("#mashGrid").jqxGrid("getrowdata",al);$("#wstep_name").val(E.step_name);$("#wstep_type").val(E.step_type);$("#wstep_infuse_amount").val(E.step_infuse_amount);$("#wstep_temp").val(E.step_temp);$("#wend_temp").val(E.end_temp);$("#wstep_time").val(E.step_time);$("#wramp_time").val(E.ramp_time);if(E.step_type==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}$("#popupMash").jqxWindow("open")}}}]})};$("#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;aW()}});$("#locked").on("unchecked",function(i){if(d.stage>=10){d.locked=0;d.stage=10;aW()}});$("#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 i=$("#fermentableGrid").jqxGrid("getrowid",u);console.log("FermentableReady row:"+u+" ID:"+i);var a4={f_name:aM.f_name,f_origin:aM.f_origin,f_supplier:aM.f_supplier,f_amount:aM.f_amount,f_cost:aM.f_cost,f_type:aM.f_type,f_yield:aM.f_yield,f_color:aM.f_color,f_coarse_fine_diff:aM.f_coarse_fine_diff,f_moisture:aM.f_moisture,f_diastatic_power:aM.f_diastatic_power,f_protein:aM.f_protein,f_max_in_batch:aM.f_max_in_batch,f_graintype:aM.f_graintype,f_added:aM.f_added,f_dissolved_protein:aM.f_dissolved_protein,f_recommend_mash:aM.f_recommend_mash,f_add_after_boil:aM.f_add_after_boil,f_adjust_to_total_100:aM.f_adjust_to_total_100,f_percentage:aM.f_percentage,f_di_ph:aM.f_di_ph,f_acid_to_ph_57:aM.f_acid_to_ph_57,f_inventory:aM.f_inventory,f_avail:aM.f_avail};$("#fermentableGrid").jqxGrid("updaterow",i,a4);aX();V();au();aP()});$("#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(a4,i,a6){var a5=fermentablelist.records[a4];return a5.supplier+" / "+a5.name+" ("+a5.color+" EBC)"}});$("#wf_select").on("select",function(a5){if(a5.args){var i=a5.args.index;var a4=fermentablelist.records[i];$("#wf_name").val(a4.name);aM.f_name=a4.name;aM.f_origin=a4.origin;aM.f_supplier=a4.supplier;aM.f_type=a4.type;aM.f_cost=a4.cost;aM.f_yield=a4.yield;aM.f_color=a4.color;aM.f_coarse_fine_diff=a4.coarse_fine_diff;aM.f_moisture=a4.moisture;aM.f_diastatic_power=a4.diastatic_power;aM.f_protein=a4.protein;aM.f_max_in_batch=a4.max_in_batch;aM.f_graintype=a4.graintype;aM.f_dissolved_protein=a4.dissolved_protein;aM.f_recommend_mash=a4.recommend_mash;aM.f_add_after_boil=a4.add_after_boil;aM.f_di_ph=a4.di_ph;aM.f_acid_to_ph_57=a4.acid_to_ph_57;aM.f_inventory=a4.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);aM.f_amount=i.args.value;if(!k){aX();V();au();aP()}});$("#wf_percentage").jqxNumberInput(Perc1dec);$("#wf_percentage").on("change",function(a4){var a5=Math.round(aM.f_percentage*10)/10;var a6=a4.args.value;console.log("percentage changed: "+a6+" old: "+a5);aM.f_percent=a6;var ba=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if((a5!=a6)&&(ba>1)){var bc=$("#fermentableGrid").jqxGrid("getrowdata",u);if(bc.f_adjust_to_total_100){$("#wf_percentage").val(a5)}else{var bb=a6-a5;var a7=0;for(af=0;af<ba;af++){var bc=$("#fermentableGrid").jqxGrid("getrowdata",af);if(bc.f_added<4){a7+=Math.round(bc.f_amount*1000)/1000}}a7=Math.round(a7*1000)/1000;if(k){var a9=Math.round(a7*bb*10)/1000;var bc=$("#fermentableGrid").jqxGrid("getrowdata",u);var i=Math.round((bc.f_amount+a9)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_amount",i);$("#wf_amount").val(i);$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_percentage",bc.f_percentage+bb);for(af=0;af<ba;af++){var bc=$("#fermentableGrid").jqxGrid("getrowdata",af);if(bc.f_adjust_to_total_100){i=bc.f_amount-a9;$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",bc.f_percentage-bb);$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_amount",i)}}V();au();aP()}else{var a8=a7*bb/100;for(af=0;af<ba;af++){var bc=$("#fermentableGrid").jqxGrid("getrowdata",af);if(bc.f_added<4){if(af==u){var i=Math.round((bc.f_amount+a8)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_amount",i);$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",a6)}else{var i=Math.round((bc.f_amount-(a8/(ba-1)))*1000)/1000;var bd=Math.round((i/a7)*1000)/10;$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_amount",i);$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",bd)}}else{$("#fermentableGrid").jqxGrid("setcellvalue",af,"f_percentage",0)}}V();au();aP()}}}});$("#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(a5){if(aM.f_adjust_to_total_100==0){if(k){var a6=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(var a4=0;a4<a6;a4++){if(a4!=u){$("#fermentableGrid").jqxGrid("setcellvalue",a4,"f_adjust_to_total_100",0)}}}$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",1);V()}});$("#wf_adjust_to_total_100").on("unchecked",function(i){if(aM.f_adjust_to_total_100!=0){$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_adjust_to_total_100",0);V()}});$("#wf_added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wf_added").on("select",function(a4){if(a4.args){var i=a4.args.index;$("#fermentableGrid").jqxGrid("setcellvalue",u,"f_added",i);V();au();aP()}});$("#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(a4){var i=parseInt(a4);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(a4){var i=parseInt(a4);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 i=$("#hopGrid").jqxGrid("getrowid",a);console.log("HopReady row:"+a+" ID:"+i);var a4={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,a4);au()});$("#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(a4,i,a6){var a5=hoplist.records[a4];return a5.origin+" - "+a5.name+" / "+HopFormData[a5.form].nl+" ("+a5.alpha+" % &alpha;)"}});$("#wh_select").on("select",function(a5){if(a5.args){var i=a5.args.index;var a4=hoplist.records[i];$("#wh_name").val(a4.name);e.h_name=a4.name;e.h_origin=a4.origin;e.h_cost=a4.cost;e.h_type=a4.type;e.h_form=a4.form;e.h_alpha=a4.alpha;e.h_beta=a4.beta;e.h_hsi=a4.hsi;e.h_humulene=a4.humulene;e.h_caryophyllene=a4.caryophyllene;e.h_cohumulone=a4.cohumulone;e.h_myrcene=a4.myrcene;e.h_total_oil=a4.total_oil;e.h_inventory=a4.inventory}});$("#wh_amount").jqxNumberInput(Spin1dec);$("#wh_amount").on("change",function(a4){console.log("amount changed: "+a4.args.value+" time:"+e.h_time+" alpha:"+e.h_alpha);var i=parseFloat(a4.args.value)/1000;var a5=toIBU(e.h_useat,e.h_form,am,parseFloat($("#batch_size").jqxNumberInput("decimal")),i,parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());e.h_amount=i;$("#wh_ibu").val(a5)});$("#wh_ibu").jqxNumberInput(Show1dec);$("#wh_time").jqxNumberInput(PosInt);$("#wh_time").on("change",function(i){var a4=parseFloat(i.args.value);if(e.h_useat==2){if(a4>parseFloat($("#boil_time").jqxNumberInput("decimal"))){a4=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wh_time").val(a4)}e.h_time=a4}else{if(e.h_useat==4){if(a4>120){a4=120;$("#wh_time").val(a4)}e.h_time=a4}else{if(e.h_useat==5){if(a4>21){a4=21;$("#wh_time").val(a4)}e.h_time=a4*1440}}}var a5=toIBU(e.h_useat,e.h_form,am,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(a5)});$("#wh_useat").jqxDropDownList({theme:theme,source:HopUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wh_useat").on("select",function(a4){if(a4.args){var i=a4.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 i=$("#miscGrid").jqxGrid("getrowid",ax);console.log("MiscReady row:"+ax+" ID:"+i);var a4={m_name:aI.m_name,m_amount:aI.m_amount,m_cost:aI.m_cost,m_type:aI.m_type,m_use_use:aI.m_use_use,m_time:aI.m_time,m_amount_is_weight:aI.m_amount_is_weight,m_inventory:aI.m_inventory,m_avail:aI.m_avail};$("#miscGrid").jqxGrid("updaterow",i,a4);aH()});$("#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(a5){if(a5.args){var i=a5.args.index;var a4=misclist.records[i];$("#wm_name").val(a4.name);aI.m_name=a4.name;aI.m_cost=a4.cost;aI.m_type=a4.type;aI.m_use_use=a4.use_use;aI.m_amount_is_weight=a4.amount_is_weight;aI.m_inventory=a4.inventory}});$("#wm_amount").jqxNumberInput(Spin2dec);$("#wm_amount").on("change",function(i){console.log("amount changed: "+i.args.value);aI.m_amount=parseFloat(i.args.value)/1000});$("#wm_time").jqxNumberInput(PosInt);$("#wm_time").on("change",function(i){console.log("time changed: "+i.args.value);var a4=parseFloat(i.args.value);if(aI.m_use_use==2){if(a4>parseFloat($("#boil_time").jqxNumberInput("decimal"))){a4=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wm_time").val(a4)}aI.m_time=a4}else{if((aI.m_use_use==3)||(aI.m_use_use==4)){if(a4>21){a4=21;$("#wm_time").val(a4)}aI.m_time=a4*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(a4){if(a4.args){var i=a4.args.index;aI.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);aI.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").jqxNumberInput(Show1dec);$("#need_cells").jqxNumberInput(Show1dec);$("#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 i=$("#yeastGrid").jqxGrid("getrowid",aF);console.log("YeastReady row:"+aF+" ID:"+i);var a4={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,a4);V();Z()});$("#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(a4,i,a6){var a5=yeastlist.records[a4];return a5.laboratory+" "+a5.product_id+" "+a5.name}});$("#wy_select").on("select",function(a5){if(a5.args){var i=a5.args.index;var a4=yeastlist.records[i];$("#wy_name").val(a4.name);$("#wy_laboratory").val(a4.laboratory);$("#wy_product_id").val(a4.product_id);f.y_name=a4.name;f.y_cost=a4.cost;f.y_type=a4.type;f.y_form=a4.form;f.y_laboratory=a4.laboratory;f.y_product_id=a4.product_id;f.y_min_temperature=a4.min_temperature;f.y_max_temperature=a4.max_temperature;f.y_flocculation=a4.flocculation;f.y_attenuation=a4.attenuation;f.y_cells=a4.cells;f.y_inventory=a4.inventory;if(f.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):")}else{if(f.y_form==1){$("#wy_pmpt_amount").html("Gewicht gram:")}else{$("#wy_pmpt_amount").html("Volume ml:")}}V();Z()}});$("#wy_amount").jqxNumberInput(Spin1dec);$("#wy_amount").on("change",function(a4){console.log("amount changed: "+a4.args.value);if(f.y_form==0){var i=parseFloat(a4.args.value)}else{var i=parseFloat(a4.args.value)/1000}f.y_amount=i;V();Z()});$("#wy_use").jqxDropDownList({theme:theme,source:YeastUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wy_use").on("select",function(a4){if(a4.args){var i=a4.args.index;f.y_use=i;V();Z()}});for(var af=1;af<5;af++){$("#prop"+af+"_type").jqxDropDownList({theme:theme,source:StarterTypeAdapter,valueMember:"id",displayMember:"nl",width:120,height:23,autoDropDownHeight:true});$("#prop"+af+"_type").hide();$("#prop"+af+"_volume").jqxNumberInput(Spin3dec);$("#prop"+af+"_volume").hide();$("#prop"+af+"_irate").jqxNumberInput(Show1dec);$("#prop"+af+"_irate").hide();$("#prop"+af+"_ncells").jqxNumberInput(Show1dec);$("#prop"+af+"_ncells").hide();$("#prop"+af+"_tcells").jqxNumberInput(Show1dec);$("#prop"+af+"_tcells").hide();$("#prop"+af+"_growf").jqxNumberInput(Show2dec);$("#prop"+af+"_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").jqxNumberInput(SGopts);$("#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(a4){if(a4.args){var ba=a4.args.index;var a9=new Array();var bc=$("#mashGrid").jqxGrid("getdisplayrows");for(var a7=0;a7<bc.length;a7++){var bb=bc[a7];a9.push(bb.uid)}$("#mashGrid").jqxGrid("deleterow",a9);var a8=mashlist.records[ba];$("#mash_name").val(a8.name);for(var a7=0;a7<a8.steps.length;a7++){var a6=a8.steps[a7];var bb={};bb.step_name=a6.step_name;bb.step_type=a6.step_type;if(D==0&&d.w1_amount>0){D=d.w1_amount}if(a7==0){bb.step_infuse_amount=D}else{bb.step_infuse_amount=0}if(aq>0){bb.step_thickness=parseFloat(D/aq)}else{bb.step_thickness=0}bb.step_temp=a6.step_temp;bb.end_temp=a6.end_temp;bb.step_time=a6.step_time;bb.ramp_time=a6.ramp_time;var a5=$("#mashGrid").jqxGrid("addrow",null,bb)}}});$("#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(){aP()});$("#wstep_name").jqxInput({theme:theme,width:320,height:23});$("#wstep_name").on("change",function(i){var a4=$("#mashGrid").jqxGrid("getrowdata",al);a4.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(a6){if(a6.args){var a4=a6.args.index;var a9=$("#mashGrid").jqxGrid("getrowdata",al);a9.step_type=a4;if(a4==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{a9.step_infuse_amount=0;$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}D=0;var a7=$("#mashGrid").jqxGrid("getrows");for(var a5=0;a5<a7.length;a5++){var a8=a7[a5];if(a8.step_type==0){D+=parseFloat(a8.step_infuse_amount)}}}});$("#wstep_temp").jqxNumberInput(Spin1dec);$("#wstep_temp").on("change",function(i){var a4=$("#mashGrid").jqxGrid("getrowdata",al);a4.step_temp=parseFloat(i.args.value)});$("#wend_temp").jqxNumberInput(Spin1dec);$("#wend_temp").on("change",function(i){var a4=$("#mashGrid").jqxGrid("getrowdata",al);a4.end_temp=parseFloat(i.args.value)});$("#wstep_time").jqxNumberInput(PosInt);$("#wstep_time").on("change",function(i){var a4=$("#mashGrid").jqxGrid("getrowdata",al);a4.step_time=parseFloat(i.args.value)});$("#wramp_time").jqxNumberInput(PosInt);$("#wramp_time").on("change",function(i){var a4=$("#mashGrid").jqxGrid("getrowdata",al);a4.ramp_time=parseFloat(i.args.value)});$("#wstep_infuse_amount").jqxNumberInput(Spin1dec);$("#wstep_infuse_amount").on("change",function(a5){var a8=$("#mashGrid").jqxGrid("getrowdata",al);a8.step_infuse_amount=parseFloat(a5.args.value);D=0;var a6=$("#mashGrid").jqxGrid("getrows");for(var a4=0;a4<a6.length;a4++){var a7=a6[a4];if(a7.step_type==0){D+=parseFloat(a7.step_infuse_amount)}}if(d.w2_amount==0){d.w1_amount=D;$("#w1_amount").val(D)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*D;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*D;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(D)});$("#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(a5){if(a5.args){var i=a5.args.index;var a4=waterlist.records[i];d.w1_name=a4.name;$("#w1_calcium").val(a4.calcium);d.w1_calcium=a4.calcium;$("#w1_sulfate").val(a4.sulfate);d.w1_sulfate=a4.sulfate;$("#w1_chloride").val(a4.chloride);d.w1_chloride=a4.chloride;$("#w1_sodium").val(a4.sodium);d.w1_sodium=a4.sodium;$("#w1_magnesium").val(a4.magnesium);d.w1_magnesium=a4.magnesium;$("#w1_total_alkalinity").val(a4.total_alkalinity);d.w1_total_alkalinity=a4.total_alkalinity;$("#w1_ph").val(a4.ph);d.w1_ph=a4.ph;$("#w1_cost").val(a4.cost);d.w1_cost=a4.cost;R()}});$("#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(a5){if(a5.args){var i=a5.args.index;var a4=waterlist.records[i];d.w2_name=a4.name;$("#w2_calcium").val(a4.calcium);d.w2_calcium=a4.calcium;$("#w2_sulfate").val(a4.sulfate);d.w2_sulfate=a4.sulfate;$("#w2_chloride").val(a4.chloride);d.w2_chloride=a4.chloride;$("#w2_sodium").val(a4.sodium);d.w2_sodium=a4.sodium;$("#w2_magnesium").val(a4.magnesium);d.w2_magnesium=a4.magnesium;$("#w2_total_alkalinity").val(a4.total_alkalinity);d.w2_total_alkalinity=a4.total_alkalinity;$("#w2_ph").val(a4.ph);d.w2_ph=a4.ph;$("#w2_cost").val(a4.cost);d.w2_cost=a4.cost;$("#w2_amount").jqxNumberInput({max:100000,readOnly:false});R()}});$("#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(a5){if(a5.args){var i=a5.args.index;var a4=waterprofiles.records[i];$("#pr_calcium").val(a4.calcium);$("#pr_sulfate").val(a4.sulfate);$("#pr_chloride").val(a4.chloride);$("#pr_sodium").val(a4.sodium);$("#pr_magnesium").val(a4.magnesium);$("#pr_total_alkalinity").val(a4.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){aW()});$("#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){aW()});$("#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(){a2()});$("#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;y()});$("#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;T();V();au()});$("#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;y()});$("#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;T();V();au()});$("#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(){var i="log_brew.php?code="+d.code+"&name="+d.name;window.open(i)});$("#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){aW()});$("#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){aW()});$("#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(){var i="log_fermentation.php?code="+d.code+"&name="+d.name;window.open(i)});$("#package_date").jqxTooltip({content:"De verpakkings datum van dit bier."});$("#package_date").jqxDateTimeInput(Dateopts);$("#package_date").on("close",function(i){aW()});$("#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(a8){if(a8.args){var a4=a8.args.index;var a7=-1;var a6=fermentablesugars.records[a4];var ba=$("#fermentableGrid").jqxGrid("getrows");for(var a5=0;a5<ba.length;a5++){if(ba[a5].f_added==4){a7=a5}}var bb={};bb.f_name=a6.name;bb.f_origin=a6.origin;bb.f_supplier=a6.supplier;bb.f_amount=parseFloat($("#bottle_priming_total").jqxNumberInput("decimal"))/1000;bb.f_cost=a6.cost;bb.f_type=a6.type;bb.f_yield=a6.yield;bb.f_color=a6.color;bb.f_coarse_fine_diff=a6.coarse_fine_diff;bb.f_moisture=a6.moisture;bb.f_diastatic_power=a6.diastatic_power;bb.f_protein=a6.protein;bb.f_max_in_batch=a6.max_in_batch;bb.f_graintype=a6.graintype;bb.f_added=4;bb.f_dissolved_protein=a6.dissolved_protein;bb.f_recommend_mash=a6.recommend_mash;bb.f_add_after_boil=1;bb.f_adjust_to_total_100=0;bb.f_percentage=0;bb.f_di_ph=a6.di_ph;bb.f_acid_to_ph_57=a6.acid_to_ph_57;bb.f_inventory=a6.inventory;if(a7>=0){var a9=$("#fermentableGrid").jqxGrid("getrowid",a7);$("#fermentableGrid").jqxGrid("updaterow",a9,bb)}else{$("#fermentableGrid").jqxGrid("addrow",null,bb)}aU()}});$("#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(a8){if(a8.args){var a4=a8.args.index;var a7=-1;var a6=fermentablesugars.records[a4];var ba=$("#fermentableGrid").jqxGrid("getrows");for(var a5=0;a5<ba.length;a5++){if(ba[a5].f_added==5){a7=a5}}var bb={};bb.f_name=a6.name;bb.f_origin=a6.origin;bb.f_supplier=a6.supplier;bb.f_amount=parseFloat($("#keg_priming_total").jqxNumberInput("decimal"))/1000;bb.f_cost=a6.cost;bb.f_type=a6.type;bb.f_yield=a6.yield;bb.f_color=a6.color;bb.f_coarse_fine_diff=a6.coarse_fine_diff;bb.f_moisture=a6.moisture;bb.f_diastatic_power=a6.diastatic_power;bb.f_protein=a6.protein;bb.f_max_in_batch=a6.max_in_batch;bb.f_graintype=a6.graintype;bb.f_added=5;bb.f_dissolved_protein=a6.dissolved_protein;bb.f_recommend_mash=a6.recommend_mash;bb.f_add_after_boil=1;bb.f_adjust_to_total_100=0;bb.f_percentage=0;bb.f_di_ph=a6.di_ph;bb.f_acid_to_ph_57=a6.acid_to_ph_57;bb.f_inventory=a6.inventory;if(a7>=0){var a9=$("#fermentableGrid").jqxGrid("getrowid",a7);$("#fermentableGrid").jqxGrid("updaterow",a9,bb)}else{$("#fermentableGrid").jqxGrid("addrow",null,bb)}aU()}});$("#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){aW()});$("#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();var i="prod_export.php?record="+my_record+"&return="+my_return+"&select="+my_select+"&code="+d.code+"&name="+d.name;window.location.href=i});$("#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:F,cache:false,data:i,type:"POST",success:function(a5,a4,a6){window.location.href=my_return},error:function(a4,a6,a5){}})})});$("#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();window.location.href=my_return});createDelElements()});
\ No newline at end of file
--- a/www/js/prod_edit.js	Thu Sep 05 14:43:04 2019 +0200
+++ b/www/js/prod_edit.js	Thu Sep 05 20:14:16 2019 +0200
@@ -22,14 +22,24 @@
 
 
 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');
 }
 
 
@@ -133,9 +143,9 @@
 		}
 	}
 
-	/*
+	/* 
 	 * All calculations that depend on changes in the fermentables,
-	 * volumes and equipments.
+ 	 * volumes and equipments.
 	 */
 	function calcFermentables() {
 
@@ -157,20 +167,23 @@
 		var mashtime = 0;	// Total mash time
 		var mashtemp = 0;	// Average mash temperature
 		var bv = 0.925; 	// Bierverlies rendement
-                var sr = 0.95;  	// Mash en spoel rendement
+        	var sr = 0.95;  	// Mash en spoel rendement
 		var lintner = 0;	// Total recipe lintner
 
-		if ((rows = $('#mashGrid').jqxGrid('getrows'))) {
-			for (var i = 0; i < rows.length; i++) {
-				var row = rows[i];
-				if (row.step_type == 0) // Infusion
-					mvol += parseFloat(row.step_infuse_amount);
-				if (row.step_temp <= 75) { // Ignore mashout
-					mashtime += row.step_time;
-					mashtemp += row.step_time * row.step_temp;
+		if ((rows = $('#mashGrid').jqxGrid('getrows'))){
+			for(var i=0;i<rows.length;i++){
+				var row=rows[i];
+				if(row.step_type==0) // Infusion
+					mvol+=parseFloat(row.step_infuse_amount);
+				if(row.step_temp<=75){ // Ignore mashout
+					var timem=row.step_time+row.ramp_time;
+					mashtime+=timem;
+					mashtemp+=timem*row.step_temp;
 				}
 			}
-			mashtemp = mashtemp / mashtime;
+			if(mashtime>5)
+				mashtime-=5;//Correct last ramp > 75
+			mashtemp=Round(mashtemp/mashtime,2);
 		}
 
 		if (!(rows = $('#fermentableGrid').jqxGrid('getrows'))) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_export-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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});$("#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});$("#Start").jqxButton({template:"success",width:"100px",theme:theme,disabled:true});$("#Start").click(function(){if(a==1){var b="prod_beerxml.php?record="+my_record;window.open(b)}else{if(a==2){var b="prod_duplicate.php?record="+my_record;window.open(b)}else{if(a==3){var b="prod_torecipe.php?record="+my_record;window.open(b)}else{if(a==4){var b="prod_print.php?record="+my_record;window.open(b)}else{if(a==5){var b="prod_checklist.php?record="+my_record;window.open(b)}else{if(a==6){var b="prod_forum.php?record="+my_record;window.open(b)}}}}}}window.location.href="prod_edit.php?record="+my_record+"&return="+my_return})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_impbrew-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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 b=c.args;var d=b.file;var 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;var d=b.file;var a=b.response;$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> ontvangen "+d+"<br />"+a+"<br />")})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_inprod-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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"};var b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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(g){var f="prod_new.php?return=prod_inprod.php";window.location.href=f})},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(i,f,k,m,g,n){var c=StageData[k].nl;if(k==2){c=StageData[k].nl+" op "+n.brew_date}if(k==7||k==8){var j=new Date();var l=n.package_date;l=l.split("-");date1=new Date(j.getFullYear(),j.getMonth(),j.getDate());l=new Date(l[0],l[1]-1,l[2]);date1_unixtime=parseInt(date1.getTime()/1000);date2_unixtime=parseInt(l.getTime()/1000);var h=date1_unixtime-date2_unixtime;var e=Math.round(h/60/60/24);if(e>=14){c=StageData[k].nl+" dag "+(e-14)+" van 28"}else{c=StageData[k].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(e){var d=b.records[e];var c="prod_edit.php?record="+d.record+"&select=inprod&return=prod_inprod.php";window.location.href=c}}],})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/prod_new-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(document).ready(function(){var a=2;var b=0;var c=0;$("#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;var 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;var 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 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();var g=j.getMonth()+1;var f=j.getFullYear()+"-";if(g<10){f=f+"0"}f=f+g+"-";if(j.getDate()<10){f=f+"0"}f=f+j.getDate();var 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};var 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,width:150});$("#nextButtonEq").jqxButton({theme:theme,width:150});$("#backButtonEq").jqxButton({theme:theme,width:150});$("#nextButtonCompleted").jqxButton({theme:theme,width:150});$("#backButtonCompleted").jqxButton({theme:theme,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");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");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");return true}}}());d.init()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/profile_fermentation-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 c={};var b="includes/db_profile_fermentation.php";$("#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 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)},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)},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)},error:function(k,m,l){i(false)}})}};var f=new $.jqx.dataAdapter(e);var 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};var 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)}};var 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(m){var l=this;var k=$("<div style='margin: 5px;'></div>");m.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 n=i();var o=$("#grid").jqxGrid("addrow",null,n)});$("#deleterowbutton").on("click",function(){var n=$("#grid").jqxGrid("getselectedrowindex");var q=$("#grid").jqxGrid("getdatainformation").rowscount;if(n>=0&&n<q){var p=$("#grid").jqxGrid("getrowid",n);var o=$("#grid").jqxGrid("deleterow",p)}})},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});var d=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:f,theme:theme,showstatusbar:true,renderstatusbar:function(i){var g=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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){if(l<24){var h=l+" uur"}else{var n=Math.floor(l/24);var g=l%24;if(n==1){var h=n+" dag, "+g+" uur"}else{var 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 g=$("#grid").jqxGrid("getrows");var h=-1;if(d>=0){var h=$("#jqxgrid").jqxGrid("getrowid",d)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/profile_mash-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 g=0;var d={};var c={};var b="includes/db_profile_mash.php";$("#name").jqxTooltip({content:"De naam voor dit maisch profiel."});$("#notes").jqxTooltip({content:"De uitgebreide opmerkingen over dit maisch profiel."});var 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)},error:function(l,n,m){k(false)}})},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)},error:function(n,p,o){l(false)}})},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)},error:function(m,o,n){k(false)}})}};$("#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});var h=new $.jqx.dataAdapter(f);var 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};var 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)}};var i=new $.jqx.dataAdapter(j);$("#grid").jqxGrid({width:1020,height:330,source:i,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(o){var n=this;var m=$("<div style='margin: 5px;'></div>");o.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 p=k();var q=$("#grid").jqxGrid("addrow",null,p)});$("#deleterowbutton").on("click",function(){var p=$("#grid").jqxGrid("getselectedrowindex");var s=$("#grid").jqxGrid("getdatainformation").rowscount;if(p>=0&&p<s){var r=$("#grid").jqxGrid("getrowid",p);var q=$("#grid").jqxGrid("deleterow",r)}})},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")}}]})};$("#name").jqxInput({theme:theme,width:480,height:23});$("#notes").jqxInput({theme:theme,width:800,height:100});var e=-1;$("#jqxgrid").jqxGrid({width:1280,height:630,source:h,theme:theme,showstatusbar:true,renderstatusbar:function(k){var i=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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(j){e=j;var i=$("#jqxgrid").jqxGrid("getrowdata",e);$("#name").val(i.name);$("#notes").val(i.notes);a(i);$("#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");var j=-1;if(e>=0){j=$("#jqxgrid").jqxGrid("getrowid",e)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/profile_setup-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(document).ready(function(){var c={};var d="getwatersources.php";var a={datatype:"json",datafields:[{name:"name",type:"string"},],url:d,async:false};var g=new $.jqx.dataAdapter(a);var b="includes/db_setup.php";$("#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)"});var e={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:b};var f=new $.jqx.dataAdapter(e,{loadComplete:function(){var h=f.records;c=h[0];$("#brewery_name").val(c.brewery_name);$("#factor_mashhop").val(c.factor_mashhop);$("#factor_fwh").val(c.factor_fwh);$("#factor_pellet").val(c.factor_pellet);$("#factor_plug").val(c.factor_plug);$("#factor_wethop").val(c.factor_wethop);$("#factor_cryohop").val(c.factor_cryohop);$("#color_method").val(c.color_method);$("#ibu_method").val(c.ibu_method);$("#brix_correction").val(c.brix_correction);$("#grain_absorbtion").val(c.grain_absorbtion)},loadError:function(j,h,i){},});f.dataBind();$("#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:g,valueMember:"name",displayMember:"name",width:250,dropDownHorizontalAlignment:"right",dropDownWidth:300,autoDropDownHeight:true});$("#default_water").jqxDropDownList("selectItem",c.default_water);$("#Save").jqxButton({template:"success",width:"90px",theme:theme});$("#Save").click(function(){var i={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()};var h="update=true&"+$.param(i);$.ajax({dataType:"json",url:b,cache:false,data:h,type:"POST",success:function(k,j,l){},error:function(j,l,k){}})})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/profile_styles-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};var a="includes/db_profile_styles.php";var 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)},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)},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)},error:function(j,l,k){h(false)}})}};$("#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});var e=new $.jqx.dataAdapter(d);var c=-1;$("#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>");var 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>");var 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(k){var j="import_ingredients.php?select=styles";window.location.href=j})},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(g){c=g;var f=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(f.name);$("#category").val(f.category);$("#category_number").val(f.category_number);$("#style_letter").val(f.style_letter);$("#style_guide").val(f.style_guide);$("#type").val(f.type);$("#og_min").val(f.og_min);$("#og_max").val(f.og_max);$("#fg_min").val(f.fg_min);$("#fg_max").val(f.fg_max);$("#ibu_min").val(f.ibu_min);$("#ibu_max").val(f.ibu_max);$("#color_min").val(f.color_min);$("#color_max").val(f.color_max);$("#carb_min").val(f.carb_min);$("#carb_max").val(f.carb_max);$("#abv_min").val(f.abv_min);$("#abv_max").val(f.abv_max);$("#notes").val(f.notes);$("#profile").val(f.profile);$("#ingredients").val(f.ingredients);$("#examples").val(f.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 f=-1;if(c>=0){f=$("#jqxgrid").jqxGrid("getrowid",c)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/profile_water-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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={};var a="includes/db_profile_water.php";$("#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 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)},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)},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)},error:function(j,l,k){h(false)}})}};$("#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);var e=new $.jqx.dataAdapter(d);var c=-1;$("#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>");var 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(g){c=g;$("#popupWindow").jqxWindow({position:{x:110,y:30}});var f=$("#jqxgrid").jqxGrid("getrowdata",c);$("#name").val(f.name);$("#calcium").val(f.calcium);$("#bicarbonate").val(f.bicarbonate);$("#sulfate").val(f.sulfate);$("#chloride").val(f.chloride);$("#sodium").val(f.sodium);$("#magnesium").val(f.magnesium);$("#ph").val(f.ph);$("#notes").val(f.notes);$("#total_alkalinity").val(f.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 f=-1;if(c>=0){f=$("#jqxgrid").jqxGrid("getrowid",c)}var 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");location.reload(true)});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/rec_edit-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+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 k=false;var S=0;var A=0;var L=0;var ah=77;var V=0;var aA=0;var J=0;var w=0;var ax="";var O="";var v=40.048;var W=24.305;var M=22.98976928;var o=35.453;var al=96.0626;var E=60.01684;var p=61.01684;var U=172.171;var H=147.015;var g=100.087;var an=246.475;var aj=84.007;var t=105.996;var c=58.443;var am=74.06268;var r=0;var ao={};var b=0;var e={};var ab=0;var ak={};var ai=0;var f={};var R=0;var y={};$("#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 a(aE){var aF=!aE;var aC=110;var aD=80;if(aE){aC=90;aD=60}$("#batch_size").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#boil_size").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#boil_time").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#efficiency").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#est_og").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#type").jqxDropDownList({disabled:aE});$("#styleSelect").jqxDropDownList({disabled:aE});$("#color_method").jqxDropDownList({disabled:aE});$("#ibu_method").jqxDropDownList({disabled:aE});$("#Delete").jqxButton({disabled:aE});$("#fermentableGrid").jqxGrid({editable:aF});$("#faddrowbutton").jqxDropDownList({disabled:aE});$("#finstockbutton").jqxCheckBox({disabled:aE});$("#fdeleterowbutton").jqxButton({disabled:aE});$("#hopGrid").jqxGrid({editable:aF});$("#haddrowbutton").jqxDropDownList({disabled:aE});$("#hinstockbutton").jqxCheckBox({disabled:aE});$("#hdeleterowbutton").jqxButton({disabled:aE});$("#miscGrid").jqxGrid({editable:aF});$("#maddrowbutton").jqxDropDownList({disabled:aE});$("#minstockbutton").jqxCheckBox({disabled:aE});$("#mdeleterowbutton").jqxButton({disabled:aE});$("#yeastGrid").jqxGrid({editable:aF});$("#yaddrowbutton").jqxDropDownList({disabled:aE});$("#yinstockbutton").jqxCheckBox({disabled:aE});$("#ydeleterowbutton").jqxButton({disabled:aE});$("#mashGrid").jqxGrid({editable:aF});$("#saddrowbutton").jqxButton({disabled:aE});$("#sdeleterowbutton").jqxButton({disabled:aE});$("#w1_name").jqxDropDownList({disabled:aE});$("#w2_name").jqxDropDownList({disabled:aE});$("#pr_name").jqxDropDownList({disabled:aE});$("#wa_cacl2").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#wa_caso4").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#wa_mgso4").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#wa_nacl").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#mash_ph").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#calc_acid").jqxCheckBox({disabled:aE});$("#wa_base_name").jqxDropDownList({disabled:aE});$("#wa_base").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#wa_acid_name").jqxDropDownList({disabled:aE});$("#wa_acid").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#wa_acid_perc").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aD});$("#sparge_temp").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#sparge_volume").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#sparge_ph").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC});$("#sparge_source").jqxDropDownList({disabled:aE});$("#sparge_acid_type").jqxDropDownList({disabled:aE});$("#sparge_acid_perc").jqxNumberInput({spinButtons:aF,readOnly:aE,width:aC})}function ay(){console.log("calcPercentages()");var aF=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(aF>1){var aD=0;for(i=0;i<aF;i++){var aE=$("#fermentableGrid").jqxGrid("getrowdata",i);if(aE.f_added<4){aD+=Math.round(aE.f_amount*1000)/1000}}aD=Math.round(aD*1000)/1000;for(i=0;i<aF;i++){var aE=$("#fermentableGrid").jqxGrid("getrowdata",i);if(aE.f_added<4){var aC=Math.round(aE.f_amount/aD*1000)/10;$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",aC)}else{$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",0)}}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}}function I(){console.log("calcFermentables()");sugarsf=0;sugarsm=0;A=0;L=0;V=0;var aV=0;var aO=0;var aW=0;var a1=0;var aJ=0;var aQ=0;var aM=0;var aP=false;var aT=0;var aI=0;var aY=0.925;var aS=0.95;var aH=0;if((aK=$("#mashGrid").jqxGrid("getrows"))){for(var aU=0;aU<aK.length;aU++){var aG=aK[aU];if(aG.step_type==0){a1+=parseFloat(aG.step_infuse_amount)}if(aG.step_temp<=75){aT+=aG.step_time;aI+=aG.step_time*aG.step_temp}}aI=aI/aT}if(!(aK=$("#fermentableGrid").jqxGrid("getrows"))){return}var aN=0;for(var aU=0;aU<aK.length;aU++){var aG=aK[aU];if(aG.f_adjust_to_total_100){aP=true}if(aG.f_type==1&&aG.f_added<4){A+=aG.f_percentage}if(aG.f_graintype==2&&aG.f_added<4){L+=aG.f_percentage}var aZ=aG.f_amount*(aG.f_yield/100)*(1-aG.f_moisture/100);if(aG.f_added==0){if(a1>0){a1+=aG.f_amount*aG.f_moisture/100;aN+=aZ}aZ=parseFloat(d.efficiency)/100*aZ;sugarsm+=aZ;V+=aG.f_amount}if(aG.f_added==0||aG.f_added==1){sugarsf+=aZ}if(aG.f_added==2||aG.f_added==3){var aL=(aG.f_yield/100)*(1-aG.f_moisture/100);aO+=aG.f_amount*aL;aW+=aG.f_amount;aV+=(aL*sugardensity+(1-aL)*1)*aG.f_amount}if(aG.f_added==0&&(aG.f_type==0||aG.f_type==4)&&aG.f_color<50){aH+=aG.f_diastatic_power*aG.f_amount}if(aG.f_added<4){aJ+=aG.f_amount*ebc_to_srm(aG.f_color);aQ+=aG.f_amount*aG.f_color*get_kt(aG.f_color);aM+=(aG.f_percentage/100)*aG.f_color}}$("#ferm_lintner").val(Math.round(parseFloat(aH/V)));console.log("lintner:"+aH+" kg:"+V);k=aP;if(k){$("#wf_amount").jqxNumberInput({width:90,readOnly:true,spinButtons:false})}else{$("#wf_amount").jqxNumberInput({width:110,readOnly:false,spinButtons:true})}d.est_og=estimate_sg(sugarsf+aO,parseFloat(d.batch_size));$("#est_og").val(d.est_og);$("#est_og2").val(d.est_og);var aC=d.est_og;S=estimate_sg(sugarsm,parseFloat(d.boil_size));if(d.color_method==4){var aR=Math.round(((sg_to_plato(d.est_og)/8.6)*aM)+(d.boil_time/60))}else{if(d.color_method==3){var aR=Math.round((4.46*aY*aS)/parseFloat(d.batch_size)*aQ)}else{var aD=aJ/parseFloat(d.batch_size)*8.34436;var aR=kw_to_ebc(d.color_method,aD)}}d.est_color=aR;$("#est_color").val(aR);$("#est_color2").val(aR);var aX=ebc_to_color(aR);document.getElementById("bcolor").style.background=aX;document.getElementById("bcolor2").style.background=aX;pmalts=V/(d.boil_size/3)*100;$("#perc_malts").jqxProgressBar("val",pmalts);$("#perc_sugars").jqxProgressBar("val",A);$("#perc_cara").jqxProgressBar("val",L);ah=0;var aK=$("#yeastGrid").jqxGrid("getrows");for(var aU=0;aU<aK.length;aU++){var aG=aK[aU];if(aG.y_use==0){if(parseFloat(aG.y_attenuation)>ah){ah=parseFloat(aG.y_attenuation)}}}if(ah==0){ah=77}if((V>0)&&(w>0)&&(aT>0)&&(aI>0)){d.est_fg=estimate_fg(A,L,w/V,aT,aI,ah,d.est_og)}else{d.est_fg=estimate_fg(A,L,0,0,0,ah,d.est_og)}$("#est_fg").val(d.est_fg);$("#est_fg2").val(d.est_fg);var a0=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);var aF=1881.22*a0*(aC-a0)/(1.775-aC);var aE=3550*a0*(0.1808*aC+0.8192*a0-1.0004);$("#kcal").val(Math.round((aF+aE)/(12*0.0295735296)))}function B(aE,aG,aD,aF){var aC;if(aD==1){aC=0.15}else{if(aE>50){aC=0.1}else{aC=15.25/(6*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((aE-21)/6,2));if(aC<0.1){aC=0.1}}}return(aC*aF*1000)/aG}function h(aE,aG,aD,aF){var aC=0;if(aD==5){aC=1.33}else{if(aE>20){aC=0}else{if(aE>7.5){aC=10.03/(4*Math.sqrt(2*Math.PI))*Math.exp(-0.5*Math.pow((aE-7.5)/4,2))}else{if(aD==2){aC=1}else{if(aD==3){aC=1.2}else{if(aD==4){aC=1.2}}}}}}return(aC*aF*1000)/aG}function ar(){if(!(rows=$("#mashGrid").jqxGrid("getrows"))){return}if(V==0){return}var aC=0;for(var aD=0;aD<rows.length;aD++){var aE=$("#mashGrid").jqxGrid("getrowdata",aD);if(aE.step_type==0){aC+=aE.step_infuse_amount}$("#mashGrid").jqxGrid("setcellvalue",aD,"step_thickness",aC/V)}}function X(){var aC=0;J=aA=0;var aE={};if(!(aE=$("#hopGrid").jqxGrid("getrows"))){return}for(var aD=0;aD<aE.length;aD++){var aF=aE[aD];aC+=toIBU(aF.h_useat,aF.h_form,S,parseFloat(d.batch_size),parseFloat(aF.h_amount),parseFloat(aF.h_time),parseFloat(aF.h_alpha),d.ibu_method);aA+=B(parseFloat(aF.h_time),parseFloat(d.batch_size),aF.h_useat,parseFloat(aF.h_amount));J+=h(parseFloat(aF.h_time),parseFloat(d.batch_size),aF.h_useat,parseFloat(aF.h_amount))}aC=Math.round(aC*10)/10;aA=Math.round(aA*1000/5)/10;J=Math.round(J*1000/6)/10;if(aA>100){aA=100}if(J>100){J=100}console.log("calcIBUs(): "+aC+"  flavour: "+aA+"  aroma: "+J);d.est_ibu=aC;$("#est_ibu").val(aC);$("#est_ibu2").val(aC);$("#hop_flavour").jqxProgressBar("val",aA);$("#hop_aroma").jqxProgressBar("val",J)}function Q(aE){console.log("adjustHops("+aE+")");var aG=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(aG==0){return}for(var aD=0;aD<aG;aD++){var aF=$("#hopGrid").jqxGrid("getrowdata",aD);var aC=aF.h_amount*aE;$("#hopGrid").jqxGrid("setcellvalue",aD,"h_amount",aC)}}function aB(aE){console.log("adjustMiscs("+aE+")");var aG=$("#miscGrid").jqxGrid("getdatainformation").rowscount;if(aG==0){return}for(var aD=0;aD<aG;aD++){var aF=$("#miscGrid").jqxGrid("getrowdata",aD);var aC=aF.m_amount*aE;$("#miscGrid").jqxGrid("setcellvalue",aD,"m_amount",aC);switch(aF.m_name){case"CaCl2":$("#wa_cacl2").val(aF.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(aF.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(aF.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(aF.m_amount*1000);break;case"Melkzuur":case"Zoutzuur":case"Fosforzuur":case"Zwavelzuur":$("#wa_acid").val(aF.m_amount*1000);break;case"NaHCO3":case"Na2CO3":case"CaCO3":case"Ca(OH)2":$("#wa_base").val(aF.m_amount*1000);break}}}function at(aE){console.log("adjustYeasts("+aE+")");var aG=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(aG==0){return}for(var aD=0;aD<aG;aD++){var aF=$("#yeastGrid").jqxGrid("getrowdata",aD);if(aF.y_form==1){var aC=aF.y_amount*aE;$("#yeastGrid").jqxGrid("setcellvalue",aD,"y_amount",aC)}}}function aa(aE){console.log("adjustWaters("+aE+")");var aG=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(aG==0){return}w=0;for(var aD=0;aD<aG;aD++){var aF=$("#mashGrid").jqxGrid("getrowdata",aD);if(aF.step_type==0){var aC=Math.round(aF.step_infuse_amount*aE*10)/10;$("#mashGrid").jqxGrid("setcellvalue",aD,"step_infuse_amount",aC);w+=aC}}if(d.w2_amount==0){d.w1_amount=w;$("#w1_amount").val(w)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*w;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*w;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(w)}function F(){var aC=(d.est_og-1)*1000;if(aC>0){return d.est_ibu/aC}else{return 0.5}}function l(){var aC=F();return(-1.2*aC+1.4)}function ag(aC,aG){var aJ=$("#miscGrid").jqxGrid("getrows");if(aG==0){for(var aF=0;aF<aJ.length;aF++){var aI=aJ[aF];if(aI.m_name==aC){var aD=$("#miscGrid").jqxGrid("getrowid",aF);var aE=$("#miscGrid").jqxGrid("deleterow",aD)}}}else{var aK=false;for(var aF=0;aF<aJ.length;aF++){var aI=aJ[aF];if(aI.m_name==aC){aK=true;$("#miscGrid").jqxGrid("setcellvalue",aF,"m_amount",aG/1000);break}}if(!aK){var aH=new $.jqx.dataAdapter(miscInvSource,{loadComplete:function(){var aM=aH.records;for(var aN=0;aN<aM.length;aN++){var aL=aM[aN];if(aL.name==aC){var aP={};aP.m_name=aL.name;aP.m_amount=aG/1000;aP.m_cost=aL.cost;aP.m_type=aL.type;aP.m_use_use=aL.use_use;aP.m_time=0;aP.m_amount_is_weight=aL.amount_is_weight;aP.m_inventory=aL.inventory;aP.m_avail=1;var aO=$("#miscGrid").jqxGrid("addrow",null,aP)}}}});aH.dataBind();return}}}function m(aD,aC){if((aC=="laag")||(aC=="hoog")){$("#wr_"+aD).html("<img src='images/dialog-error.png'><span style='vertical-align: top; font-size: 10px; font-style: italic;'>"+aC+"</span>")}else{$("#wr_"+aD).html("<img src='images/dialog-ok-apply.png'>")}}function au(aF,aE,aD,aC){if((aF+aE)>0){return((aF*aD)+(aE*aC))/(aF+aE)}return 0}function Y(aE,aD,aC){return aE-(aD/1.4+aC/1.7)}var ae=4.445e-7;var ad=4.68e-11;function u(aD){var aC=Math.pow(10,-aD);return 100*ae*ad/(aC*aC+aC*ae+ae*ad)}function af(aD){var aC=Math.pow(10,-aD);return 100*ae*aC/(aC*aC+aC*ae+ae*ad)}function ac(aC){return(-2*u(aC)-af(aC))}function C(aD){var aG=ac(4.3);var aE=ac(parseFloat($("#wg_ph").jqxNumberInput("decimal")));var aC=ac(aD);var aI=-aG+aE;var aH=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))/50/aI;var aF=-aC+aE;return aH*aF}function T(aD){var aC=parseFloat($("#wg_calcium").jqxNumberInput("decimal"))/(v/2);var aE=parseFloat($("#wg_magnesium").jqxNumberInput("decimal"))/(W/2);var aF=C(aD);return aF-(aC/3.5+aE/7)}function D(aD){var aI=T(aD)*parseFloat($("#wg_amount").jqxNumberInput("decimal"));var aG=$("#fermentableGrid").jqxGrid("getrows");for(var aE=0;aE<aG.length;aE++){var aH=aG[aE];if(aH.f_added==0&&aH.f_graintype!=6){var aF=0;if((aH.f_di_ph!=5.7)&&((aH.f_acid_to_ph_57<-0.1)||(aH.f_acid_to_ph_57>0.1))){aF=aH.f_acid_to_ph_57/(aH.f_di_ph-5.7)}else{var aC=aH.f_color;switch(aH.f_graintype){case 0:case 3:case 5:aF=0.014*aC-34.192;break;case 2:aF=-0.0597*aC-32.457;break;case 1:aF=0.0107*aC-54.768;break;case 4:aF=-149;break}}x=aF*(aD-aH.f_di_ph);aI+=x*aH.f_amount}}return aI}function aq(){var aG=0;var aE=5.4;var aD=0.001;var aF=0.1;var aC=D(aE);while(((aC<-aF)||(aC>aF))&&(aG<2000)){aG++;if(aC<-aF){aE-=aD}else{if(aC>aF){aE+=aD}}aC=D(aE)}console.log("MashpH() n: "+aG+" pH: "+aE);return aE}function s(aC){switch(aC){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}}console.log("Bummer, AT is "+aC)}function G(){console.log("calcWater()");var aW=0;var bb=0;var aM=0;var aX=0;var aN=0;var a8=0;var aO=0;var a6=0;var aQ=0;var aZ=0;var aF=0;var bi=0;var bg=0;var bc=0;if(d.w1_name==""){return}if(d.w2_name!=""){aW=d.w1_amount+d.w2_amount;bb=au(d.w1_amount,d.w2_amount,d.w1_calcium,d.w2_calcium);aM=au(d.w1_amount,d.w2_amount,d.w1_magnesium,d.w2_magnesium);aX=au(d.w1_amount,d.w2_amount,d.w1_sodium,d.w2_sodium);aO=au(d.w1_amount,d.w2_amount,d.w1_chloride,d.w2_chloride);a6=au(d.w1_amount,d.w2_amount,d.w1_sulfate,d.w2_sulfate);aN=au(d.w1_amount,d.w2_amount,d.w1_total_alkalinity,d.w2_total_alkalinity);aQ=-Math.log10(((Math.pow(10,-d.w1_ph)*d.w1_amount)+(Math.pow(10,-d.w2_ph)*d.w2_amount))/aW)}else{aW=d.w1_amount;bb=d.w1_calcium;aM=d.w1_magnesium;aX=d.w1_sodium;aO=d.w1_chloride;a6=d.w1_sulfate;aN=d.w1_total_alkalinity;aQ=d.w1_ph}$("#wg_amount").val(aW);var bd=bb;$("#wg_calcium").val(Math.round(bb*10)/10);var bf=aM;$("#wg_magnesium").val(Math.round(aM*10)/10);var aY=aX;$("#wg_sodium").val(Math.round(aX*10)/10);var be=aN;$("#wg_total_alkalinity").val(Math.round(aN*10)/10);var aK=aO;$("#wg_chloride").val(Math.round(aO*10)/10);var a7=a6;$("#wg_sulfate").val(Math.round(a6*10)/10);var aH=aQ;$("#wg_ph").val(Math.round(aQ*10)/10);$("#wb_ph").val(Math.round(aq()*10)/10);a8=aN*1.22;var aE=a8;aZ=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*v/H+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*v/U;bb+=1000*aZ/aW;aZ=parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*W/an;aM+=1000*aZ/aW;aZ=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*M/c;aX+=1000*aZ/aW;aZ=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*al/U+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*al/an;a6+=1000*aZ/aW;aZ=2*parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*o/H+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*o/c;aO+=1000*aZ/aW;if($("#wa_acid_name").val()<0||$("#wa_acid_name").val()>3){console.log("fix wa_acid_name");$("#wa_acid_name").val(0);d.wa_acid_name=0}if(O==""){O=AcidTypeData[$("#wa_acid_name").val()].nl}if($("#wa_base_name").val()<0||$("#wa_base_name").val()>3){console.log("fix wa_base_name");$("#wa_base_name").val(0);d.wa_base_name=0}if(ax==""){ax=BaseTypeData[$("#wa_base_name").val()].nl}var ba=d.wa_acid_name;var a0=d.wa_base_name;var aS=s(ba);var aG=aS.pK1;var aD=aS.pK2;var aC=aS.pK3;var aR=aS.MolWt;var aJ=aS.AcidSG;var aI=aS.AcidPrc;if(d.calc_acid){bg=parseFloat(d.mash_ph);bc=D(bg);console.log("calc_acid tgt: "+bg+" protonDeficit: "+bc);if(bc>0){$("#wa_base").val(0);ag(ax,0);bi=CalcFrac(bg,aG,aD,aC);Acid=bc/bi;Acid*=aR;Acidmg=Acid;Acid=Acid/aJ;if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(aI)}Acid=Acid*aI/(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);console.log("Final ml: "+Acid);$("#wa_acid").val(Math.round(Acid*100)/100);ag(AcidTypeData[ba].nl,Math.round(Acid*100)/100);a8=a8-bc*bi/aW;aN=a8*50/61}else{if(bc<0){$("#wa_acid").val(0);ag(O,0);var a2=Math.pow(10,(bg-6.38));var aU=Math.pow(10,(bg-10.38));var aL=1/(1+a2+a2*aU);var a3=aL*a2;var aV=a3*aU;switch(a0){case 0:aZ=-bc/(aL-aV);aZ=aZ*aj/1000;$("#wa_base").val(Math.round(aZ*100)/100);ag("NaHCO3",Math.round(aZ*100)/100);if(aW>0){aZ=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*M/c+parseFloat($("#wa_base").jqxNumberInput("decimal"))*M/aj;aZ=1000*aZ/aW;aX=aY+aZ;aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))*p/aj;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 1:aZ=-bc/(2*aL+a3);aZ=aZ*t/1000;$("#wa_base").val(Math.round(aZ*100)/100);ag("Na2CO3",Math.round(aZ*100)/100);if(aW>0){aZ=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*M/c+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*M/t;aZ=1000*aZ/aW;aX=aY+aZ;aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))*p/t;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 2:aZ=-bc*(aL-aV);aZ=aZ*g/1000;aZ=3*aZ;$("#wa_base").val(Math.round(aZ*100)/100);ag("CaCO3",Math.round(aZ*100)/100);if(aW>0){aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*p/g;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*v/H+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*v/U+parseFloat($("#wa_base").jqxNumberInput("decimal"))*v/g;aZ=1000*aZ/aW;bb=bd+aZ;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium)}break;case 3:aZ=-bc/19.3;$("#wa_base").val(Math.round(aZ*100)/100);ag("Ca(OH)2",Math.round(aZ*100)/100);if(aW>0){aZ=-bc/aW;aN=be+aZ;a8=aN*61/50;aZ=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*v/H+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*v/U+parseFloat($("#wa_base").jqxNumberInput("decimal"))*v/am;aZ=1000*aZ/aW;bb=bd+aZ;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium)}break}}}aQ=bg;$("#wb_ph").val(Math.round(aQ*10)/10)}else{console.log("calc_acid no");if(parseFloat($("#wa_base").jqxNumberInput("decimal"))>0){if(aW>0){switch(a0){case 0:aZ=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*M/c+parseFloat($("#wa_base").jqxNumberInput("decimal"))*M/aj;aZ=1000*aZ/aW;aX=aY+aZ;aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))*p/aj;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 1:aZ=parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*M/c+parseFloat($("#wa_base").jqxNumberInput("decimal"))*2*M/t;aZ=1000*aZ/aW;aX=aY+aZ;aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))*p/t;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium);break;case 2:aZ=parseFloat($("#wa_base").jqxNumberInput("decimal"))/3*p/g;aZ=1000*aZ/aW;a8=aE+aZ;aN=a8*50/61;aZ=Y(wb_total_alkalinity,wb_calcium,wb_magnesium);aZ=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*v/H+parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*v/U+parseFloat($("#wa_base").jqxNumberInput("decimal"))*v/g;aZ=1000*aZ/aW;bb=bd+aZ;break}}}bg=parseFloat(d.mash_ph);pHa=aq();if(parseFloat($("#wa_acid").jqxNumberInput("decimal"))>0){console.log("TpH: "+bg+" water: "+pHa);Acid=parseFloat($("#wa_acid").jqxNumberInput("decimal"));if(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))==0){$("#wa_acid_perc").val(aI)}Acid=Acid/aI*(parseFloat($("#wa_acid_perc").jqxNumberInput("decimal"))/100);Acid*=aJ;Acid/=aR;Acidmg=Acid;bi=CalcFrac(pHa,aG,aD,aC);bc=Acid*bi;var a9=0.001;var a1=0.1;var aT=D(pHa);var a5=0;while(((aT<(bc-a1))||(aT>(bc+a1)))&&(a5<2000)){a5++;if(aT<(bc-a1)){pHa-=a9}else{if(aT>(bc+a1)){pHa+=a9}}bi=CalcFrac(pHa,aG,aD,aC);bc=Acid*bi;aT=D(pHa)}console.log("n: "+a5+" pd: "+aT+" protonDeficit: "+bc+" frac: "+bi+" pHa: "+pHa);aZ=aE-bc*bi/aW;a8=aZ;aN=aZ*50/61;aQ=pHa;$("#wb_ph").val(Math.round(aQ*10)/10)}}if((ba==3)&&(aW>0)){aZ=parseFloat($("#wa_caso4").jqxNumberInput("decimal"))*al/U+parseFloat($("#wa_mgso4").jqxNumberInput("decimal"))*al/an+Acidmg/1000*al/(al+2);aZ=1000*aZ/aW;a6=a7+aZ}else{if((ba==1)&&(aW>0)){aZ=parseFloat($("#wa_cacl2").jqxNumberInput("decimal"))*o/H+parseFloat($("#wa_nacl").jqxNumberInput("decimal"))*o/c+Acidmg/1000*o/(o+1);aZ=1000*aZ/aW;aO=aK+aZ}}$("#tgt_bu").val(Math.round(F()*100)/100);if(F()<0.32){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Zeer moutig en zoet</span>")}else{if(F()<0.43){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Moutig, zoet</span>")}else{if(F()<0.52){$("#wr_bu").html("<span style='vertical-align: top; font-size: 14px; font-style: italic;'>Evenwichtig</span>")}else{if(F()<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(l()*10)/10);if(a6>0){aZ=aO/a6}else{aZ=10}$("#got_cl_so4").val(Math.round(aZ*10)/10);var bh=0.8*l();var a4=1.2*l();var aP="normaal";if(aZ<bh){aP="laag"}else{if(aZ>a4){aP="hoog"}}m("cl_so4",aP);$("#wb_calcium").val(Math.round(bb*10)/10);$("#wb_magnesium").val(Math.round(aM*10)/10);$("#wb_sodium").val(Math.round(aX*10)/10);$("#wb_sulfate").val(Math.round(a6*10)/10);$("#wb_chloride").val(Math.round(aO*10)/10);$("#wb_total_alkalinity").val(Math.round(aN*10)/10);if(bb<40){m("calcium","laag")}else{if(bb>150){m("calcium","hoog")}else{m("calcium","normaal")}}if(aM>=0&&aM<=30){m("magnesium","normaal")}else{m("magnesium","hoog")}if(aX<=150){m("sodium","normaal")}else{m("sodium","hoog")}if(aO<=50){m("chloride","laag")}else{if(aO<=100){m("chloride","normaal")}else{m("chloride","hoog")}}if(a6<=50){m("sulfate","laag")}else{if(a6<=350){m("sulfate","normaal")}else{m("sulfate","hoog")}}if(aQ<5.2){m("ph","laag")}else{if(aQ>5.6){m("ph","hoog")}else{m("ph","normaal")}}j()}function j(){var aF=d.sparge_ph;var aT=d.w1_ph;var aR=d.w1_total_alkalinity;if(d.sparge_source==1){if(d.w2_ph>0){aT=d.w2_ph;aR=d.w2_total_alkalinity}else{d.sparge_source=0;$("#sparge_source").val(0)}}else{if(d.sparge_source==2){if(d.w2_ph>0){aT=parseFloat($("#wg_ph").jqxNumberInput("decimal"));aR=parseFloat($("#wg_total_alkalinity").jqxNumberInput("decimal"))}else{d.sparge_source=0;$("#sparge_source").val(0)}}}var a0=Math.pow(10,aT-6.38);var aZ=Math.pow(10,aT-10.373);var a3=1+a0+a0*aZ;var aX=1/a3;var aW=a0/a3;var aV=a0*aZ/a3;var aY=Math.pow(10,4.3-6.38);var aJ=Math.pow(10,4.3-10.373);var a8=1+aY+aY*aJ;var a6=1/a8;var aQ=aY/a8;var aD=aY*aJ/a8;var aH=aR/50;var aL=(aH-1000*(Math.pow(10,-4.3)-Math.pow(10,-aT)))/((a6-aX)+(aV-aD));var aS=Math.pow(10,aF-6.38);var a4=Math.pow(10,aF-10.373);var a2=1+aS+aS*a4;var a5=1/a2;var aI=aS/a2;var aU=aS*a4/a2;var aE=aL*((a5-aX)+(aV-aU))+Math.pow(10,-aF)-Math.pow(10,-aT);aE+=0.01;if(d.sparge_acid_type<0||d.sparge_acid_type>3){d.sparge_acid_type=0;$("#sparge_acid_type").val(0)}var aK=d.sparge_acid_type;var aP=s(aK);var aO=aP.pK1;var aN=aP.pK2;var aM=aP.pK3;var a7=aP.MolWt;var aG=aP.AcidSG;var aC=aP.AcidPrc;var a1=CalcFrac(aF,aO,aN,aM);aE/=a1;aE*=a7;aE=aE/aG;var aX=d.sparge_acid_perc;if(aX<=0.1){aX=aC}aE=aE*aC/(aX/100);aE*=d.sparge_volume;aE=Math.round(aE*100)/100;d.sparge_acid_amount=aE/1000;$("#sparge_acid_amount").val(aE)}function N(aD){console.log("calcFermentablesFromOG("+aD+")");var aC=parseFloat($("#efficiency").jqxNumberInput("decimal"));var aK=sg_to_plato(aD)*parseFloat($("#batch_size").jqxNumberInput("decimal"))*aD/100;var aH=0;var aJ=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(var aE=0;aE<aJ;aE++){var aL=$("#fermentableGrid").jqxGrid("getrowdata",aE);if(aL.f_added<4){var aI=aL.f_percentage/100*(aL.f_yield/100)*(1-aL.f_moisture/100);if(aL.f_added==0){aI=aC/100*aI}aH+=aI}}var aG=0;if(aH){aG=Math.round((aK/aH)*1000)/1000}if(aG){for(aE=0;aE<aJ;aE++){var aL=$("#fermentableGrid").jqxGrid("getrowdata",aE);if(aL.f_added<4){var aF=Math.round(aL.f_percentage*10*aG)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",aE,"f_amount",aF)}}}}function az(){console.log("calc.init()");$("#calc_acid").on("checked",function(aC){d.calc_acid=1;G()});$("#calc_acid").on("unchecked",function(aC){d.calc_acid=0;G()});$("#w1_name").jqxDropDownList("selectItem",d.w1_name);$("#w2_name").jqxDropDownList("selectItem",d.w2_name);if(parseFloat($("#w1_amount").jqxNumberInput("decimal"))==0&&w>0){$("#w1_amount").val(w);d.w1_amount=w;$("#wg_amount").val(w);$("#w2_amount").val(0);d.w2_amount=0}G();$("#w2_amount").on("change",function(aC){var aD=parseFloat(aC.args.value);if(aD>w){$("#w2_amount").val(d.w2_amount);return}d.w1_amount=parseFloat($("#wg_amount").jqxNumberInput("decimal"))-aD;$("#w1_amount").val(d.w1_amount);d.w2_amount=aD;console.log("new: "+aC.args.value+" w1: "+d.w1_amount+"  w2: "+d.w2_amount);G()});$("#wa_cacl2").on("change",function(aC){if(aC.args){ag("CaCl2",0);ag("CaCl2",aC.args.value);G()}});$("#wa_caso4").on("change",function(aC){if(aC.args){ag("CaSO4",0);ag("CaSO4",aC.args.value);G()}});$("#wa_mgso4").on("change",function(aC){if(aC.args){ag("MgSO4",0);ag("MgSO4",aC.args.value);G()}});$("#wa_nacl").on("change",function(aC){if(aC.args){ag("NaCl",0);ag("NaCl",aC.args.value);G()}});$("#wa_base_name").on("change",function(aD){if(aD.args){var aC=aD.args.index;console.log("wa_base_name "+aC);ag(ax,0);ax=BaseTypeData[aC].nl;ag(ax,parseFloat($("#wa_base").jqxNumberInput("decimal")));d.wa_base_name=aC;G()}});$("#wa_base").on("change",function(aD){var aC=BaseTypeData[$("#wa_base_name").val()].nl;ag(aC,parseFloat(aD.args.value));G()});$("#wa_acid_name").on("change",function(aD){if(aD.args){var aC=aD.args.index;console.log("wa_acid_name "+aC);ag(O,0);O=AcidTypeData[aC].nl;ag(O,parseFloat($("#wa_acid").jqxNumberInput("decimal")));d.wa_acid_name=aC;G()}});$("#wa_acid").on("change",function(aD){var aC=AcidTypeData[$("#wa_acid_name").val()].nl;ag(aC,parseFloat(aD.args.value));G()});$("#wa_acid_perc").on("change",function(aC){G()});$("#color_method").on("change",function(aC){d.color_method=aC.args.index;I()});$("#ibu_method").on("change",function(aC){d.ibu_method=aC.args.index;I();X()});$("#batch_size").on("change",function(aE){console.log("batch_size change:"+aE.args.value+" old:"+d.batch_size);var aD=parseFloat(aE.args.value)+d.boil_size-d.batch_size;var aC=parseFloat(aE.args.value)/d.batch_size;d.boil_size=aD;$("#boil_size").val(Math.round(aD*100)/100);d.sparge_volume*=aC;$("#sparge_volume").val(d.sparge_volume);d.batch_size=parseFloat(aE.args.value);N(parseFloat($("#est_og").jqxNumberInput("decimal")));aa(aC);I();Q(aC);aB(aC);at(aC);X();G();j();ar()});$("#boil_time").on("change",function(aE){console.log("boil_time change:"+parseFloat(aE.args.value)+" old:"+d.boil_time);var aF=parseFloat(d.boil_size)-parseFloat(d.batch_size);var aC=aF*(parseFloat(aE.args.value)/d.boil_time);var aD=parseFloat(d.batch_size)+aC;d.boil_time=parseFloat(aE.args.value);d.boil_size=aD;$("#boil_size").val(Math.round(aD*100)/100);I();X()});$("#efficiency").on("change",function(aD){var aC=parseFloat($("#est_og").jqxNumberInput("decimal"));d.efficiency=parseFloat(aD.args.value);console.log("efficiency change:"+d.efficiency);N(aC);I();X()});$("#est_og").on("change",function(aC){d.est_og=parseFloat(aC.args.value);console.log("est_og change:"+d.est_og);N(d.est_og);I();X();ar()});$("#mash_ph").on("change",function(aC){d.mash_ph=parseFloat(aC.args.value);G()});$("#sparge_ph").on("change",function(aC){d.sparge_ph=parseFloat(aC.args.value);j()});$("#sparge_volume").on("change",function(aC){d.sparge_volume=parseFloat(aC.args.value);j()});$("#sparge_source").on("change",function(aD){if(aD.args){var aC=aD.args.index;d.sparge_source=aC;j()}});$("#sparge_acid_type").on("change",function(aD){if(aD.args){var aC=aD.args.index;d.sparge_acid_type=aC;console.log("new sparge_acid_type: "+d.sparge_acid_type);j()}});$("#sparge_acid_perc").on("change",function(aC){d.sparge_acid_perc=parseFloat(aC.args.value);j()});$("#locked").on("checked",function(aC){d.locked=1;a(true)});$("#locked").on("unchecked",function(aC){d.locked=0;a(false)})}$("#styleSelect").jqxDropDownList({placeHolder:"Kies bierstijl:",theme:theme,source:styleslist,displayMember:"name",width:180,height:23,dropDownVerticalAlignment:"top",dropDownWidth:500,dropDownHeight:380,renderer:function(aD,aC,aF){var aE=styleslist.records[aD];return aE.style_guide+" "+aE.style_letter+" "+aE.name}});$("#styleSelect").on("select",function(aE){if(aE.args){var aC=aE.args.index;var aD=styleslist.records[aC];$("#st_name").val(aD.name);$("#st_category").val(aD.category);$("#st_category_number").val(aD.category_number);$("#st_letter").val(aD.style_letter);$("#st_guide").val(aD.style_guide);$("#st_type").val(StyleTypeData[aD.type].nl);$("#st_og_min").val(aD.og_min);$("#st_og_max").val(aD.og_max);$("#st_fg_min").val(aD.fg_min);$("#st_fg_max").val(aD.fg_max);$("#st_ibu_min").val(aD.ibu_min);$("#st_ibu_max").val(aD.ibu_max);$("#st_color_min").val(aD.color_min);$("#st_color_max").val(aD.color_max);$("#st_carb_min").val(aD.carb_min);$("#st_carb_max").val(aD.carb_max);$("#st_abv_min").val(aD.abv_min);$("#st_abv_max").val(aD.abv_max)}});function q(){var aD=$("#fermentableGrid").jqxGrid("getrows");var aG=$("#hopGrid").jqxGrid("getrows");var aE=$("#miscGrid").jqxGrid("getrows");var aC=$("#yeastGrid").jqxGrid("getrows");var aF=$("#mashGrid").jqxGrid("getrows");var aI={record:my_record,uuid:d.uuid,name:$("#name").val(),locked:d.locked,notes:$("#notes").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(),fermentables:aD,hops:aG,miscs:aE,yeasts:aC,mashs:aF};var aH="update=true&"+$.param(aI);$.ajax({dataType:"json",url:z,cache:false,async:false,data:aH,type:"POST",success:function(aK,aJ,aL){console.log("saveRecord() success")},error:function(aJ,aL,aK){console.log("saveRecord() error")}})}var d={};var z="includes/db_recipes.php";var av={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:z+"?record="+my_record};var P=new $.jqx.dataAdapter(av,{loadComplete:function(){var aC=P.records;d=aC[0];$("#name").val(d.name);$("#notes").val(d.notes);$("#locked").val(d.locked);$("#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);$("#type").val(d.type);$("#batch_size").val(d.batch_size);$("#boil_size").val(d.boil_size);$("#boil_time").val(d.boil_time);$("#efficiency").val(d.efficiency);$("#est_og").val(d.est_og);$("#est_og2").val(d.est_og);$("#st_og_min").val(d.st_og_min);$("#st_og_max").val(d.st_og_max);$("#est_fg").val(d.est_fg);$("#est_fg2").val(d.est_fg);$("#st_fg_min").val(d.st_fg_min);$("#st_fg_max").val(d.st_fg_max);$("#est_color").val(d.est_color);$("#est_color2").val(d.est_color);$("#est_abv").val(d.est_abv);$("#est_abv2").val(d.est_abv);$("#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);$("#color_method").val(d.color_method);$("#est_ibu").val(d.est_ibu);$("#est_ibu2").val(d.est_ibu);$("#st_ibu_min").val(d.st_ibu_min);$("#st_ibu_max").val(d.st_ibu_max);$("#ibu_method").val(d.ibu_method);$("#est_carb").val(d.est_carb);$("#st_carb_min").val(d.st_carb_min);$("#st_carb_max").val(d.st_carb_max);$("#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);n(d);aw(d);K(d);ap(d);Z(d);$("#jqxTabs").jqxTabs("next")},loadError:function(aE,aC,aD){},beforeLoadComplete:function(aC){$("#jqxLoader").jqxLoader("open")}});P.dataBind();var n=function(aD){var aC={localdata:aD.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(aG,aI,aF,aH){aH(true)},deleterow:function(aF,aG){aG(true)},updaterow:function(aF,aH,aG){aG(true)}};var aE=new $.jqx.dataAdapter(aC);$("#fermentableGrid").jqxGrid({width:1240,height:470,source:aE,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(aH){var aG=this;var aF=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");aH.append(aF);aF.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>');aF.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');aF.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>');aF.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(aJ,aI,aL){var aK=fermentablelist.records[aJ];return aK.supplier+" / "+aK.name+" ("+aK.color+" EBC)"}});$("#faddrowbutton").on("select",function(aK){if(aK.args){var aN=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;var aI=aK.args.index;var aJ=fermentablelist.records[aI];var aM={};aM.f_name=aJ.name;aM.f_origin=aJ.origin;aM.f_supplier=aJ.supplier;aM.f_amount=0;aM.f_cost=aJ.cost;aM.f_type=aJ.type;aM.f_yield=aJ.yield;aM.f_color=aJ.color;aM.f_coarse_fine_diff=aJ.coarse_fine_diff;aM.f_moisture=aJ.moisture;aM.f_diastatic_power=aJ.diastatic_power;aM.f_protein=aJ.protein;aM.f_max_in_batch=aJ.max_in_batch;aM.f_graintype=aJ.graintype;if(aJ.add_after_boil){aM.f_added=2}else{if((aJ.type==1)||(aJ.type==4)){aM.f_added=1}else{aM.f_added=0}}aM.f_dissolved_protein=aJ.dissolved_protein;aM.f_recommend_mash=aJ.recommend_mash;aM.f_add_after_boil=aJ.add_after_boil;if(aN==0){aM.f_adjust_to_total_100=1;aM.f_percentage=100}else{aM.f_adjust_to_total_100=0;aM.f_percentage=0}aM.f_di_ph=aJ.di_ph;aM.f_acid_to_ph_57=aJ.acid_to_ph_57;aM.f_inventory=aJ.inventory;var aL=$("#fermentableGrid").jqxGrid("addrow",null,aM)}});$("#finstockbutton").jqxCheckBox({theme:theme,height:27});$("#finstockbutton").on("change",function(aI){fermentableinstock=aI.args.checked;fermentablelist.dataBind()});$("#fdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#fdeleterowbutton").on("click",function(){var aK=$("#fermentableGrid").jqxGrid("getselectedrowindex");var aP=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(aK>=0&&aK<aP){var aO=$("#fermentableGrid").jqxGrid("getrowid",aK);var aL=$("#fermentableGrid").jqxGrid("getcellvalue",aO,"f_percentage");var aJ=$("#fermentableGrid").jqxGrid("getcellvalue",aO,"f_amount");var aM=$("#fermentableGrid").jqxGrid("deleterow",aO)}aP=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if(aP>1){if(k){for(var aI=0;aI<aP;aI++){var aN=$("#fermentableGrid").jqxGrid("getrowdata",aI);if(aN.f_adjust_to_total_100){aN.f_percentage+=aL;aN.f_amount+=aJ}}}else{ay()}}else{$("#fermentableGrid").jqxGrid("setcellvalue",0,"f_percentage",100)}I();X()})},ready:function(){I();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Vergistbaar ingredi&euml;nt",datafield:"f_name",cellsrenderer:function(aH,aG,aJ,aF,aI,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+aK.f_supplier+" / "+aK.f_name+" ("+aK.f_color+" EBC)</span>"}},{text:"Type",width:100,datafield:"f_type",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+FermentableTypeData[aJ].nl+"</span>"}},{text:"Moment",width:110,datafield:"f_added",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+AddedData[aJ].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(aJ,aH,aI,aF,aL,aK){var aG="#ffffff";if(aI<aK.f_amount){aG="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aG+';">'+aE.formatNumber(aI,"f3")+"</span>"}},{text:"Procent",datafield:"f_percentage",width:90,align:"right",cellsrenderer:function(aJ,aH,aI,aF,aL,aK){var aG="#ffffff";if(aI>aK.f_max_in_batch){aG="#ff4040"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aG+';">'+aE.formatNumber(aI,"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(aF){r=aF;ao=$("#fermentableGrid").jqxGrid("getrowdata",r);$("#wf_name").val(ao.f_name);$("#wf_amount").val(ao.f_amount);$("#wf_percentage").val(ao.f_percentage);$("#wf_max_in_batch").val(ao.f_max_in_batch);$("#wf_adjust_to_total_100").val(ao.f_adjust_to_total_100);$("#wf_added").val(ao.f_added);$("#popupFermentable").jqxWindow("open")}}]})};var aw=function(aC){var aE={localdata:aC.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(aG,aI,aF,aH){console.log("hop addrow "+aG);aH(true)},deleterow:function(aF,aG){console.log("hop deleterow "+aF);aG(true)},updaterow:function(aF,aH,aG){console.log("hop updaterow "+aF);aG(true)}};var aD=new $.jqx.dataAdapter(aE);$("#hopGrid").jqxGrid({width:1240,height:560,source:aD,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(aH){var aG=this;var aF=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");aH.append(aF);aF.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>');aF.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');aF.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>');aF.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(aJ,aI,aL){var aK=hoplist.records[aJ];return aK.origin+" / "+aK.name+" ("+aK.alpha+"% &alpha;)"}});$("#haddrowbutton").on("select",function(aK){if(aK.args){var aI=aK.args.index;var aJ=hoplist.records[aI];var aM={};aM.h_name=aJ.name;aM.h_origin=aJ.origin;aM.h_amount=0;aM.h_cost=aJ.cost;aM.h_type=aJ.type;aM.h_form=aJ.form;aM.h_useat=2;aM.h_time=0;aM.h_alpha=aJ.alpha;aM.h_beta=aJ.beta;aM.h_hsi=aJ.hsi;aM.h_humulene=aJ.humulene;aM.h_caryophyllene=aJ.caryophyllene;aM.h_cohumulone=aJ.cohumulone;aM.h_myrcene=aJ.myrcene;aM.h_total_oil=aJ.total_oil;aM.h_inventory=aJ.inventory;var aL=$("#hopGrid").jqxGrid("addrow",null,aM)}$("#haddrowbutton").jqxDropDownList("clearSelection")});$("#hinstockbutton").jqxCheckBox({theme:theme,height:27});$("#hinstockbutton").on("change",function(aI){hopinstock=aI.args.checked;hoplist.dataBind()});$("#hdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#hdeleterowbutton").on("click",function(){var aI=$("#hopGrid").jqxGrid("getselectedrowindex");var aL=$("#hopGrid").jqxGrid("getdatainformation").rowscount;if(aI>=0&&aI<aL){var aK=$("#hopGrid").jqxGrid("getrowid",aI);var aJ=$("#hopGrid").jqxGrid("deleterow",aK)}X()})},ready:function(){X();$("#jqxTabs").jqxTabs("next")},columns:[{text:"Hop",datafield:"h_name",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+aK.h_origin+" / "+aK.h_name+"</span>"},},{text:"Type",width:90,datafield:"h_type",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopTypeData[aJ].nl+"</span>"}},{text:"Vorm",width:90,datafield:"h_form",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopFormData[aJ].nl+"</span>"}},{text:"Alpha",datafield:"h_alpha",width:80,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"Gebruik",width:110,datafield:"h_useat",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+HopUseData[aJ].nl+"</span>"}},{text:"Tijdsduur",datafield:"h_time",width:90,align:"right",cellsrenderer:function(aG,aF,aJ,aI,aH,aL){var aK="";if((aL.h_useat==2)||(aL.h_useat==4)){aK=P.formatNumber(aJ,"f0")+" min."}else{if(aL.h_useat==5){aK=P.formatNumber(aJ/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+aK+"</span>"}},{text:"IBU",datafield:"ibu",width:80,align:"right",cellsrenderer:function(aG,aF,aJ,aI,aH,aL){var aK=toIBU(aL.h_useat,aL.h_form,S,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(aL.h_amount),parseFloat(aL.h_time),parseFloat(aL.h_alpha),$("#ibu_method").val());return'<span style="margin: 4px; margin-top: 6px; float: right;">'+P.formatNumber(aK,"f1")+"</span>"}},{text:"Gewicht",datafield:"h_amount",width:110,align:"right",cellsrenderer:function(aG,aF,aK,aJ,aI,aL){var aH=P.formatNumber(aK,"f1")+" kg";if(aK<1){aH=P.formatNumber(aK*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+aH+"</span>"}},{text:"Voorraad",datafield:"h_inventory",width:110,align:"right",cellsrenderer:function(aH,aG,aL,aK,aJ,aM){var aF="#ffffff";if(aL<aM.h_amount){aF="#ff4040"}var aI=P.formatNumber(aL,"f1")+" kg";if(aL<1){aI=P.formatNumber(aL*1000,"f1")+" gr"}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aF+';">'+aI+"</span>"}},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(aF){b=aF;e=$("#hopGrid").jqxGrid("getrowdata",b);$("#wh_name").val(e.h_name);$("#wh_amount").val(e.h_amount*1000);var aG=toIBU(e.h_useat,e.h_form,S,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(aG);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")}}]})};var K=function(aE){var aD={localdata:aE.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(aG,aI,aF,aH){console.log("misc addrow "+aG);aH(true)},deleterow:function(aF,aG){console.log("misc deleterow "+aF);aG(true)},updaterow:function(aF,aH,aG){console.log("misc updaterow "+aF);aG(true)}};var aC=new $.jqx.dataAdapter(aD,{beforeLoadComplete:function(aF){var aH=new Array();for(var aG=0;aG<aF.length;aG++){var aI=aF[aG];aH.push(aI);switch(aI.m_name){case"CaCl2":$("#wa_cacl2").val(aI.m_amount*1000);break;case"CaSO4":$("#wa_caso4").val(aI.m_amount*1000);break;case"MgSO4":$("#wa_mgso4").val(aI.m_amount*1000);break;case"NaCl":$("#wa_nacl").val(aI.m_amount*1000);break;case"Melkzuur":$("#wa_acid_name").val(0);$("#wa_acid").val(aI.m_amount*1000);$("#wa_acid_perc").val(80);O="Melkzuur";break;case"Zoutzuur":$("#wa_acid_name").val(1);$("#wa_acid").val(aI.m_amount*1000);$("#wa_acid_perc").val(80);O="Zoutzuur";break;case"Fosforzuur":$("#wa_acid_name").val(2);$("#wa_acid").val(aI.m_amount*1000);$("#wa_acid_perc").val(80);O="Fosforzuur";break;case"Zwavelzuur":$("#wa_acid_name").val(3);$("#wa_acid").val(aI.m_amount*1000);$("#wa_acid_perc").val(80);O="Zwavelzuur";break;case"NaHCO3":$("#wa_base_name").val(0);$("#wa_base").val(aI.m_amount*1000);ax="NaHCO3";break;case"Na2CO3":$("#wa_base_name").val(1);$("#wa_base").val(aI.m_amount*1000);ax="Na2CO3";break;case"CaCO3":$("#wa_base_name").val(2);$("#wa_base").val(aI.m_amount*1000);ax="CaCO3";break;case"Ca(OH)2":$("#wa_base_name").val(3);$("#wa_base").val(aI.m_amount*1000);ax="Ca(OH)2";break}}return aH},loadError:function(aH,aF,aG){$("#err").text(aF+" "+aG)},});$("#miscGrid").jqxGrid({width:1240,height:575,source:aC,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(aH){var aG=this;var aF=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");aH.append(aF);aF.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>');aF.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');aF.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>');aF.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(aK){if(aK.args){var aI=aK.args.index;var aJ=misclist.records[aI];var aM={};aM.m_name=aJ.name;aM.m_amount=0;aM.m_cost=aJ.cost;aM.m_type=aJ.type;aM.m_use_use=aJ.use_use;aM.m_time=0;aM.m_amount_is_weight=aJ.amount_is_weight;aM.m_inventory=aJ.inventory;var aL=$("#miscGrid").jqxGrid("addrow",null,aM)}});$("#minstockbutton").jqxCheckBox({theme:theme,height:27});$("#minstockbutton").on("change",function(aI){miscinstock=aI.args.checked;misclist.dataBind()});$("#mdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#mdeleterowbutton").on("click",function(){var aI=$("#miscGrid").jqxGrid("getselectedrowindex");var aM=$("#miscGrid").jqxGrid("getdatainformation").rowscount;var aJ=$("#miscGrid").jqxGrid("getcellvalue",aI,"m_type");if(aI>=0&&aI<aM&&aJ!=4){var aL=$("#miscGrid").jqxGrid("getrowid",aI);var aK=$("#miscGrid").jqxGrid("deleterow",aL)}})},ready:function(){$("#jqxTabs").jqxTabs("next")},columns:[{text:"Ingredient",datafield:"m_name"},{text:"Type",width:140,datafield:"m_type",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscTypeData[aJ].nl+"</span>"}},{text:"Gebruik",width:140,datafield:"m_use_use",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return"<span style='margin: 3px; margin-top: 6px; float: left;'>"+MiscUseData[aJ].nl+"</span>"}},{text:"Tijd",datafield:"m_time",width:90,align:"right",cellsrenderer:function(aG,aF,aJ,aI,aH,aL){var aK="";if(aL.m_use_use==2){aK=P.formatNumber(aJ,"f0")+" min."}else{if((aL.m_use_use==3)||(aL.m_use_use==4)){aK=P.formatNumber(aJ/1440,"f0")+" dagen"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+aK+"</span>"},},{text:"Hoeveel",datafield:"m_amount",width:110,align:"right",cellsrenderer:function(aG,aF,aK,aI,aH,aL){var aJ=aL.m_amount_is_weight?"gr":"ml";return'<span style="margin: 4px; margin-top: 6px; float: right;">'+P.formatNumber(aK*1000,"f2")+" "+aJ+"</span>"},},{text:"Voorraad",datafield:"m_inventory",width:110,align:"right",cellsrenderer:function(aJ,aF,aK,aM,aG,aN){var aL=aN.m_amount_is_weight?"gr":"ml";var aH="#ffffff";if(aK<aN.m_amount){aH="#ff4040"}var aI=P.formatNumber(aK*1000,"f2")+" "+aL;return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aH+';">'+aI+"</span>"},},{text:"",datafield:"Edit",columntype:"button",width:100,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(aF){ab=aF;ak=$("#miscGrid").jqxGrid("getrowdata",ab);if(ak.m_type==4){alert("Brouwzouten wijzigen in de water tab.")}else{if(ak.m_amount_is_weight){$("#wm_pmpt_amount").html("Gewicht gram:")}else{$("#wm_pmpt_amount").html("Volume ml:")}$("#wm_name").val(ak.m_name);$("#wm_amount").val(ak.m_amount*1000);if((ak.m_use_use==3)||(ak.m_use_use==4)){$("#wm_time").val(ak.m_time/1440)}else{$("#wm_time").val(ak.m_time)}$("#wm_use_use").val(ak.m_use_use);$("#popupMisc").jqxWindow("open")}}}]})};var ap=function(aD){var aC={localdata:aD.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(aG,aI,aF,aH){console.log("yeast addrow "+aG);aH(true)},deleterow:function(aF,aG){console.log("yeast deleterow "+aF);aG(true)},updaterow:function(aF,aH,aG){console.log("yeast updaterow "+aF);aG(true)}};var aE=new $.jqx.dataAdapter(aC);$("#yeastGrid").jqxGrid({width:1240,height:350,source:aE,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(aH){var aG=this;var aF=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");aH.append(aF);aF.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>');aF.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>');aF.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>');aF.append('<input style="float: left; margin-left: 400px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />');$("#yaddrowbutton").jqxDropDownList({placeHolder:"Kies gist:",theme:theme,template:"primary",source:yeastlist,displayMember:"name",width:150,height:27,dropDownWidth:500,dropDownHeight:500,renderer:function(aJ,aI,aL){var aK=yeastlist.records[aJ];return aK.laboratory+" "+aK.product_id+" "+aK.name}});$("#yaddrowbutton").on("select",function(aK){if(aK.args){var aI=aK.args.index;var aJ=yeastlist.records[aI];var aM={};aM.y_name=aJ.name;aM.y_laboratory=aJ.laboratory;aM.y_product_id=aJ.product_id;aM.y_type=aJ.type;aM.y_form=aJ.form;aM.y_amount=0;aM.y_cost=aJ.cost;aM.y_use=0;aM.y_min_temperature=aJ.min_temperature;aM.y_max_temperature=aJ.max_temperature;aM.y_attenuation=aJ.attenuation;aM.y_flocculation=aJ.flocculation;aM.y_cells=aJ.cells;aM.y_tolerance=aJ.tolerance;aM.y_inventory=aJ.inventory;var aL=$("#yeastGrid").jqxGrid("addrow",null,aM)}$("#yaddrowbutton").jqxDropDownList("clearSelection")});$("#yinstockbutton").jqxCheckBox({theme:theme,height:27});$("#yinstockbutton").on("change",function(aI){yeastinstock=aI.args.checked;yeastlist.dataBind()});$("#ydeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#ydeleterowbutton").on("click",function(){var aI=$("#yeastGrid").jqxGrid("getselectedrowindex");var aL=$("#yeastGrid").jqxGrid("getdatainformation").rowscount;if(aI>=0&&aI<aL){var aK=$("#yeastGrid").jqxGrid("getrowid",aI);var aJ=$("#yeastGrid").jqxGrid("deleterow",aK)}})},ready:function(){I();$("#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(aG,aF,aJ,aI,aH,aK){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastFormData[aJ].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(aH,aG,aL,aK,aJ,aM){var aF="#ffffff";var aI="";if(aL>0){aI=P.formatNumber(aL,"f1");if(d.est_abv>aL){aF="#ff4040"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aF+';">'+aI+"</span>"}},{text:"Attn. %",width:70,align:"right",cellsalign:"right",datafield:"y_attenuation",cellsformat:"f1"},{text:"Voor",width:120,datafield:"y_use",cellsrenderer:function(aG,aF,aJ,aI,aH,aK){return'<span style="margin: 4px; margin-top: 6px; float: left;">'+YeastUseData[aJ].nl+"</span>"}},{text:"Hoeveel",datafield:"y_amount",width:90,align:"right",cellsrenderer:function(aG,aF,aK,aJ,aI,aL){var aH=P.formatNumber(aK*1000,"f0")+" ml";if(aL.y_form==0){aH=P.formatNumber(aK,"f0")+" pk"}else{if(aL.y_form==1){aH=P.formatNumber(aK*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right;">'+aH+"</span>"}},{text:"Voorraad",datafield:"y_inventory",width:90,align:"right",cellsrenderer:function(aH,aG,aL,aK,aJ,aM){var aF="#ffffff";if(aL<aM.y_amount){aF="#ff4040"}var aI=P.formatNumber(aL*1000,"f0")+" ml";if(aM.y_form==0){aI=P.formatNumber(aL,"f0")+" pk"}else{if(aM.y_form==1){aI=P.formatNumber(aL*1000,"f1")+" gr"}}return'<span style="margin: 4px; margin-top: 6px; float: right; color: '+aF+';">'+aI+"</span>"}},{text:"",datafield:"Edit",columntype:"button",width:90,align:"center",cellsrenderer:function(){return"Wijzig"},buttonclick:function(aF){ai=aF;f=$("#yeastGrid").jqxGrid("getrowdata",ai);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){$("#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")}}]})};var Z=function(aF){var aE=function(){var aG={};aG.step_name="Stap 1";aG.step_type=0;aG.step_infuse_amount=15;aG.step_temp=62;aG.step_time=20;aG.step_thickness=0;aG.ramp_time=1;aG.end_temp=62;return aG};var aD={localdata:aF.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(aH,aJ,aG,aI){aI(true)},deleterow:function(aG,aH){aH(true)}};var aC=new $.jqx.dataAdapter(aD,{beforeLoadComplete:function(aG){w=0;var aI=new Array();for(var aH=0;aH<aG.length;aH++){var aJ=aG[aH];if(aJ.step_type==0){w+=parseFloat(aJ.step_infuse_amount)}aJ.step_thickness=0;aI.push(aJ)}},});$("#mashGrid").jqxGrid({width:1240,height:400,source:aC,theme:theme,selectionmode:"singlerow",showtoolbar:true,rendertoolbar:function(aI){var aH=this;var aG=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");aI.append(aG);aG.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');aG.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 aJ=aE();var aK=$("#mashGrid").jqxGrid("addrow",null,aJ)});$("#sdeleterowbutton").jqxButton({template:"danger",theme:theme,height:27,width:150});$("#sdeleterowbutton").on("click",function(){var aJ=$("#mashGrid").jqxGrid("getselectedrowindex");var aM=$("#mashGrid").jqxGrid("getdatainformation").rowscount;if(aJ>=0&&aJ<aM){var aL=$("#mashGrid").jqxGrid("getrowid",aJ);var aK=$("#mashGrid").jqxGrid("deleterow",aL)}})},ready:function(){I();az();ar();$("#jqxLoader").jqxLoader("close");$("#jqxTabs").jqxTabs("first")},columns:[{text:"Stap naam",datafield:"step_name"},{text:"Stap type",datafield:"step_type",width:175,cellsrenderer:function(aH,aG,aK,aJ,aI,aL){return"<div style='margin: 4px;'>"+MashStepTypeData[aK].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(aG){R=aG;y=$("#mashGrid").jqxGrid("getrowdata",R);$("#wstep_name").val(y.step_name);$("#wstep_type").val(y.step_type);$("#wstep_infuse_amount").val(y.step_infuse_amount);$("#wstep_temp").val(y.step_temp);$("#wend_temp").val(y.end_temp);$("#wstep_time").val(y.step_time);$("#wramp_time").val(y.ramp_time);if(y.step_type==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}$("#popupMash").jqxWindow("open")}}]})};$("#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(aC){return(Math.round(parseInt(aC)*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(aC){return(Math.round(parseInt(aC)*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(aC){return(Math.round(parseInt(aC)*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(aC){return(parseInt(aC)*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 aC=$("#fermentableGrid").jqxGrid("getrowid",r);console.log("FermentableReady row:"+r+" ID:"+aC);var aD={f_name:ao.f_name,f_origin:ao.f_origin,f_supplier:ao.f_supplier,f_amount:ao.f_amount,f_cost:ao.f_cost,f_type:ao.f_type,f_yield:ao.f_yield,f_color:ao.f_color,f_coarse_fine_diff:ao.f_coarse_fine_diff,f_moisture:ao.f_moisture,f_diastatic_power:ao.f_diastatic_power,f_protein:ao.f_protein,f_max_in_batch:ao.f_max_in_batch,f_graintype:ao.f_graintype,f_added:ao.f_added,f_dissolved_protein:ao.f_dissolved_protein,f_recommend_mash:ao.f_recommend_mash,f_add_after_boil:ao.f_add_after_boil,f_adjust_to_total_100:ao.f_adjust_to_total_100,f_percentage:ao.f_percentage,f_di_ph:ao.f_di_ph,f_acid_to_ph_57:ao.f_acid_to_ph_57,f_inventory:ao.f_inventory,f_avail:ao.f_avail};$("#fermentableGrid").jqxGrid("updaterow",aC,aD);ay();I();X();ar()});$("#wf_name").jqxInput({theme:theme,width:320,height:23});$("#wf_instock").jqxCheckBox({theme:theme,height:23});$("#wf_instock").on("change",function(aC){fermentableinstock=aC.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(aD,aC,aF){var aE=fermentablelist.records[aD];return aE.supplier+" / "+aE.name+" ("+aE.color+" EBC)"}});$("#wf_select").on("select",function(aE){if(aE.args){var aC=aE.args.index;var aD=fermentablelist.records[aC];$("#wf_name").val(aD.name);ao.f_name=aD.name;ao.f_origin=aD.origin;ao.f_supplier=aD.supplier;ao.f_type=aD.type;ao.f_cost=aD.cost;ao.f_yield=aD.yield;ao.f_color=aD.color;ao.f_coarse_fine_diff=aD.coarse_fine_diff;ao.f_moisture=aD.moisture;ao.f_diastatic_power=aD.diastatic_power;ao.f_protein=aD.protein;ao.f_max_in_batch=aD.max_in_batch;ao.f_graintype=aD.graintype;ao.f_dissolved_protein=aD.dissolved_protein;ao.f_recommend_mash=aD.recommend_mash;ao.f_add_after_boil=aD.add_after_boil;ao.f_di_ph=aD.di_ph;ao.f_acid_to_ph_57=aD.acid_to_ph_57;ao.f_inventory=aD.inventory}});$("#wf_amount").jqxNumberInput(Spin3dec);$("#wf_amount").on("change",function(aC){console.log("amount changed: "+aC.args.value);$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_amount",aC.args.value);ao.f_amount=aC.args.value;if(!k){ay();I();ar()}});$("#wf_percentage").jqxNumberInput(Perc1dec);$("#wf_percentage").on("change",function(aD){var aE=Math.round(ao.f_percentage*10)/10;var aF=aD.args.value;console.log("percentage changed: "+aF+" old: "+aE);ao.f_percent=aF;var aJ=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;if((aE!=aF)&&(aJ>1)){var aL=$("#fermentableGrid").jqxGrid("getrowdata",r);if(aL.f_adjust_to_total_100){$("#wf_percentage").val(aE)}else{var aK=aF-aE;var aG=0;for(i=0;i<aJ;i++){var aL=$("#fermentableGrid").jqxGrid("getrowdata",i);if(aL.f_added<4){aG+=Math.round(aL.f_amount*1000)/1000}}aG=Math.round(aG*1000)/1000;if(k){var aI=Math.round(aG*aK*10)/1000;var aL=$("#fermentableGrid").jqxGrid("getrowdata",r);var aC=Math.round((aL.f_amount+aI)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_amount",aC);$("#wf_amount").val(aC);$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_percentage",aL.f_percentage+aK);for(i=0;i<aJ;i++){var aL=$("#fermentableGrid").jqxGrid("getrowdata",i);if(aL.f_adjust_to_total_100){aC=aL.f_amount-aI;$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",aL.f_percentage-aK);$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_amount",aC)}}I();cacMash()}else{var aH=aG*aK/100;for(i=0;i<aJ;i++){var aL=$("#fermentableGrid").jqxGrid("getrowdata",i);if(aL.f_added<4){if(i==r){var aC=Math.round((aL.f_amount+aH)*1000)/1000;$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_amount",aC);$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",aF)}else{var aC=Math.round((aL.f_amount-(aH/(aJ-1)))*1000)/1000;var aM=Math.round((aC/aG)*1000)/10;$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_amount",aC);$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",aM)}}else{$("#fermentableGrid").jqxGrid("setcellvalue",i,"f_percentage",0)}}I();ar()}}}});$("#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(aD){if(ao.f_adjust_to_total_100==0){if(k){var aE=$("#fermentableGrid").jqxGrid("getdatainformation").rowscount;for(var aC=0;aC<aE;aC++){if(aC!=r){$("#fermentableGrid").jqxGrid("setcellvalue",aC,"f_adjust_to_total_100",0)}}}$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_adjust_to_total_100",1);I()}});$("#wf_adjust_to_total_100").on("unchecked",function(aC){if(ao.f_adjust_to_total_100!=0){$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_adjust_to_total_100",0);I()}});$("#wf_added").jqxDropDownList({theme:theme,source:AddedAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wf_added").on("select",function(aD){if(aD.args){var aC=aD.args.index;$("#fermentableGrid").jqxGrid("setcellvalue",r,"f_added",aC);I();X();ar()}});$("#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(aD){var aC=parseInt(aD);if(aC<20){return"Weinig"}else{if(aC<40){return"Matig"}else{if(aC<60){return"Redelijk"}else{if(aC<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(aD){var aC=parseInt(aD);if(aC<20){return"Weinig"}else{if(aC<40){return"Matig"}else{if(aC<60){return"Redelijk"}else{if(aC<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 aC=$("#hopGrid").jqxGrid("getrowid",b);console.log("HopReady row:"+b+" ID:"+aC);var aD={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",aC,aD);X()});$("#wh_name").jqxInput({theme:theme,width:320,height:23});$("#wh_instock").jqxCheckBox({theme:theme,height:23});$("#wh_instock").on("change",function(aC){hopinstock=aC.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(aD,aC,aF){var aE=hoplist.records[aD];return aE.origin+" / "+aE.name+" ("+aE.alpha+" % &alpha;)"}});$("#wh_select").on("select",function(aE){if(aE.args){var aC=aE.args.index;var aD=hoplist.records[aC];$("#wh_name").val(aD.name);e.h_name=aD.name;e.h_origin=aD.origin;e.h_cost=aD.cost;e.h_type=aD.type;e.h_form=aD.form;e.h_alpha=aD.alpha;e.h_beta=aD.beta;e.h_hsi=aD.hsi;e.h_humulene=aD.humulene;e.h_caryophyllene=aD.caryophyllene;e.h_cohumulone=aD.cohumulone;e.h_myrcene=aD.myrcene;e.h_total_oil=aD.total_oil;e.h_inventory=aD.inventory}});$("#wh_amount").jqxNumberInput(Spin1dec);$("#wh_amount").on("change",function(aD){console.log("amount changed: "+aD.args.value+" time:"+e.h_time+" alpha:"+e.h_alpha);var aC=parseFloat(aD.args.value)/1000;var aE=toIBU(e.h_useat,e.h_form,S,parseFloat($("#batch_size").jqxNumberInput("decimal")),aC,parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());e.h_amount=aC;$("#wh_ibu").val(aE)});$("#wh_ibu").jqxNumberInput(Show1dec);$("#wh_time").jqxNumberInput(PosInt);$("#wh_time").on("change",function(aC){var aD=parseFloat(aC.args.value);if(e.h_useat==2){if(aD>parseFloat($("#boil_time").jqxNumberInput("decimal"))){aD=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wh_time").val(aD)}e.h_time=aD}else{if(e.h_useat==4){if(aD>120){aD=120;$("#wh_time").val(aD)}e.h_time=aD}else{if(e.h_useat==5){if(aD>21){aD=21;$("#wh_time").val(aD)}e.h_time=aD*1440}}}var aE=toIBU(e.h_useat,e.h_form,S,parseFloat($("#batch_size").jqxNumberInput("decimal")),parseFloat(e.h_amount),parseFloat(e.h_time),parseFloat(e.h_alpha),$("#ibu_method").val());$("#wh_ibu").val(aE)});$("#wh_useat").jqxDropDownList({theme:theme,source:HopUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wh_useat").on("select",function(aD){if(aD.args){var aC=aD.args.index;e.h_useat=aC;if((aC==0)||(aC==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(aC==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(aC==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 aC=$("#miscGrid").jqxGrid("getrowid",ab);console.log("MiscReady row:"+ab+" ID:"+aC);var aD={m_name:ak.m_name,m_amount:ak.m_amount,m_cost:ak.m_cost,m_type:ak.m_type,m_use_use:ak.m_use_use,m_time:ak.m_time,m_amount_is_weight:ak.m_amount_is_weight,m_inventory:ak.m_inventory,m_avail:ak.m_avail};$("#miscGrid").jqxGrid("updaterow",aC,aD)});$("#wm_name").jqxInput({theme:theme,width:320,height:23});$("#wm_instock").jqxCheckBox({theme:theme,height:23});$("#wm_instock").on("change",function(aC){miscinstock=aC.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(aE){if(aE.args){var aC=aE.args.index;var aD=misclist.records[aC];$("#wm_name").val(aD.name);ak.m_name=aD.name;ak.m_cost=aD.cost;ak.m_type=aD.type;ak.m_use_use=aD.use_use;ak.m_amount_is_weight=aD.amount_is_weight;ak.m_inventory=aD.inventory}});$("#wm_amount").jqxNumberInput(Spin1dec);$("#wm_amount").on("change",function(aC){console.log("amount changed: "+aC.args.value);ak.m_amount=parseFloat(aC.args.value)/1000});$("#wm_time").jqxNumberInput(PosInt);$("#wm_time").on("change",function(aC){console.log("time changed: "+aC.args.value);var aD=parseFloat(aC.args.value);if(ak.m_use_use==2){if(aD>parseFloat($("#boil_time").jqxNumberInput("decimal"))){aD=parseFloat($("#boil_time").jqxNumberInput("decimal"));$("#wm_time").val(aD)}ak.m_time=aD}else{if((ak.m_use_use==3)||(ak.m_use_use==4)){if(aD>21){aD=21;$("#wm_time").val(aD)}ak.m_time=aD*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(aD){if(aD.args){var aC=aD.args.index;ak.m_use_use=aC;if((aC==2)||(aC==3)||(aC==4)){$("#wm_time").jqxNumberInput({spinButtons:true,readOnly:false,width:110})}else{ak.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 aC=$("#yeastGrid").jqxGrid("getrowid",ai);console.log("YeastReady row:"+ai+" ID:"+aC);var aD={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",aC,aD);I()});$("#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(aC){yeastinstock=aC.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(aD,aC,aF){var aE=yeastlist.records[aD];return aE.laboratory+" "+aE.product_id+" "+aE.name}});$("#wy_select").on("select",function(aE){if(aE.args){var aC=aE.args.index;var aD=yeastlist.records[aC];$("#wy_name").val(aD.name);$("#wy_laboratory").val(aD.laboratory);$("#wy_product_id").val(aD.product_id);f.y_name=aD.name;f.y_cost=aD.cost;f.y_type=aD.type;f.y_form=aD.form;f.y_laboratory=aD.laboratory;f.y_product_id=aD.product_id;f.y_min_temperature=aD.min_temperature;f.y_max_temperature=aD.max_temperature;f.y_flocculation=aD.flocculation;f.y_attenuation=aD.attenuation;f.y_cells=aD.cells;f.y_inventory=aD.inventory;if(f.y_form==0){$("#wy_pmpt_amount").html("Pak(ken):")}else{if(f.y_form==1){$("#wy_pmpt_amount").html("Gewicht gram:")}else{$("#wy_pmpt_amount").html("Volume ml:")}}I()}});$("#wy_amount").jqxNumberInput(Spin1dec);$("#wy_amount").on("change",function(aD){console.log("amount changed: "+aD.args.value);if(f.y_form==0){var aC=parseFloat(aD.args.value)}else{var aC=parseFloat(aD.args.value)/1000}f.y_amount=aC;I()});$("#wy_use").jqxDropDownList({theme:theme,source:YeastUseAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true,dropDownVerticalAlignment:"top"});$("#wy_use").on("select",function(aD){if(aD.args){var aC=aD.args.index;f.y_use=aC;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(aC){if(aC.args){var aI=aC.args.index;var aH=new Array();var aK=$("#mashGrid").jqxGrid("getdisplayrows");for(var aF=0;aF<aK.length;aF++){var aJ=aK[aF];aH.push(aJ.uid)}$("#mashGrid").jqxGrid("deleterow",aH);var aG=mashlist.records[aI];$("#mash_name").val(aG.name);for(var aF=0;aF<aG.steps.length;aF++){var aE=aG.steps[aF];var aJ={};aJ.step_name=aE.step_name;aJ.step_type=aE.step_type;if(w==0&&d.w1_amount>0){w=d.w1_amount}if(aF==0){aJ.step_infuse_amount=w}else{aJ.step_infuse_amount=0}aJ.step_temp=aE.step_temp;if(V>0){aJ.step_thickness=parseFloat(w/V)}else{aJ.step_thickness=0}aJ.end_temp=aE.end_temp;aJ.step_time=aE.step_time;aJ.ramp_time=aE.ramp_time;var aD=$("#mashGrid").jqxGrid("addrow",null,aJ)}}});$("#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(){ar()});$("#wstep_name").jqxInput({theme:theme,width:320,height:23});$("#wstep_name").on("change",function(aC){var aD=$("#mashGrid").jqxGrid("getrowdata",R);aD.step_name=aC.args.value});$("#wstep_type").jqxDropDownList({theme:theme,source:MashStepTypeAdapter,valueMember:"id",displayMember:"nl",width:180,height:23,autoDropDownHeight:true});$("#wstep_type").on("select",function(aE){if(aE.args){var aC=aE.args.index;var aH=$("#mashGrid").jqxGrid("getrowdata",R);aH.step_type=aC;if(aC==0){$("#wstep_infuse_amount").show();$("#wstep_pmpt").show()}else{aH.step_infuse_amount=0;$("#wstep_infuse_amount").hide();$("#wstep_pmpt").hide()}w=0;var aF=$("#mashGrid").jqxGrid("getrows");for(var aD=0;aD<aF.length;aD++){var aG=aF[aD];if(aG.step_type==0){w+=parseFloat(aG.step_infuse_amount)}}}});$("#wstep_temp").jqxNumberInput(Spin1dec);$("#wstep_temp").on("change",function(aC){var aD=$("#mashGrid").jqxGrid("getrowdata",R);aD.step_temp=parseFloat(aC.args.value)});$("#wend_temp").jqxNumberInput(Spin1dec);$("#wend_temp").on("change",function(aC){var aD=$("#mashGrid").jqxGrid("getrowdata",R);aD.end_temp=parseFloat(aC.args.value)});$("#wstep_time").jqxNumberInput(PosInt);$("#wstep_time").on("change",function(aC){var aD=$("#mashGrid").jqxGrid("getrowdata",R);aD.step_time=parseFloat(aC.args.value)});$("#wramp_time").jqxNumberInput(PosInt);$("#wramp_time").on("change",function(aC){var aD=$("#mashGrid").jqxGrid("getrowdata",R);aD.ramp_time=parseFloat(aC.args.value)});$("#wstep_infuse_amount").jqxNumberInput(Spin1dec);$("#wstep_infuse_amount").on("change",function(aD){var aG=$("#mashGrid").jqxGrid("getrowdata",R);aG.step_infuse_amount=parseFloat(aD.args.value);w=0;var aE=$("#mashGrid").jqxGrid("getrows");for(var aC=0;aC<aE.length;aC++){var aF=aE[aC];if(aF.step_type==0){w+=parseFloat(aF.step_infuse_amount)}}if(d.w2_amount==0){d.w1_amount=w;$("#w1_amount").val(w)}else{d.w1_amount=(d.w1_amount/(d.w1_amount+d.w2_amount))*w;d.w2_amount=(d.w2_amount/(d.w1_amount+d.w2_amount))*w;$("#w1_amount").val(d.w1_amount);$("#w2_amount").val(d.w2_amount)}$("#wg_amount").val(w)});$("#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(aE){if(aE.args){var aC=aE.args.index;var aD=waterlist.records[aC];d.w1_name=aD.name;$("#w1_calcium").val(aD.calcium);d.w1_calcium=aD.calcium;$("#w1_sulfate").val(aD.sulfate);d.w1_sulfate=aD.sulfate;$("#w1_chloride").val(aD.chloride);d.w1_chloride=aD.chloride;$("#w1_sodium").val(aD.sodium);d.w1_sodium=aD.sodium;$("#w1_magnesium").val(aD.magnesium);d.w1_magnesium=aD.magnesium;$("#w1_total_alkalinity").val(aD.total_alkalinity);d.w1_total_alkalinity=aD.total_alkalinity;$("#w1_ph").val(aD.ph);d.w1_ph=aD.ph;$("#w1_cost").val(aD.cost);d.w1_cost=aD.cost;G()}});$("#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(aE){if(aE.args){var aC=aE.args.index;var aD=waterlist.records[aC];d.w2_name=aD.name;$("#w2_calcium").val(aD.calcium);d.w2_calcium=aD.calcium;$("#w2_sulfate").val(aD.sulfate);d.w2_sulfate=aD.sulfate;$("#w2_chloride").val(aD.chloride);d.w2_chloride=aD.chloride;$("#w2_sodium").val(aD.sodium);d.w2_sodium=aD.sodium;$("#w2_magnesium").val(aD.magnesium);d.w2_magnesium=aD.magnesium;$("#w2_total_alkalinity").val(aD.total_alkalinity);d.w2_total_alkalinity=aD.total_alkalinity;$("#w2_ph").val(aD.ph);d.w2_ph=aD.ph;$("#w2_cost").val(aD.cost);d.w2_cost=aD.cost;$("#w2_amount").jqxNumberInput({max:100000,readOnly:false});G()}});$("#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,max: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(aE){if(aE.args){var aC=aE.args.index;var aD=waterprofiles.records[aC];$("#pr_calcium").val(aD.calcium);$("#pr_sulfate").val(aD.sulfate);$("#pr_chloride").val(aD.chloride);$("#pr_sodium").val(aD.sodium);$("#pr_magnesium").val(aD.magnesium);$("#pr_total_alkalinity").val(aD.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(){q();var aC="rec_export.php?record="+my_record+"&return="+my_return+"&name="+d.name;window.location.href=aC});$("#Delete").jqxButton({template:"danger",width:"80px",theme:theme});$("#Delete").bind("click",function(){$("#eventWindow").jqxWindow("open");$("#delOk").click(function(){var aC="delete=true&"+$.param({record:my_record});$.ajax({dataType:"json",url:z,cache:false,data:aC,type:"POST",success:function(aE,aD,aF){window.location.href=my_return},error:function(aD,aF,aE){}})})});$("#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(){q();window.location.href=my_return});createDelElements()});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/rec_export-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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){var b="rec_beerxml.php?record="+my_record;window.open(b)}else{if(a==2){var b="rec_duplicate.php?record="+my_record;window.open(b)}else{if(a==3){var b="rec_toproduct.php?record="+my_record;window.open(b)}else{if(a==4){var b="rec_print.php?record="+my_record;window.open(b)}else{if(a==5){var b="rec_forum.php?record="+my_record;window.open(b)}}}}}window.location.href="rec_edit.php?record="+my_record+"&return="+my_return})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/rec_import-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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;var d=b.file;var 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;var d=b.file;var a=b.response;$("#eventsPanel").jqxPanel("append","<strong>"+c.type+":</strong> ontvangen "+d+"<br />"+a+"<br />")})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/rec_main-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(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"};var b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,groupable:true,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var 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(g){var f="rec_new.php?return=rec_main.php";window.location.href=f})},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(e){var d=b.records[e];var c="rec_edit.php?record="+d.record+"&return=rec_main.php";window.location.href=c}}],groups:["st_guide","st_letter"]})});
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/www/js/rec_new-min.js	Thu Sep 05 20:14:16 2019 +0200
@@ -0,0 +1,1 @@
+$(document).ready(function(){var a=2;var b=0;$("#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 d=f.args.index;var 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)}});var 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};var 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,width:150});$("#nextButtonCompleted").jqxButton({theme:theme,width:150});$("#backButtonCompleted").jqxButton({theme:theme,width:150});d();this.validate();this.showHint("Validation hints.")},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");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");return true}}}());c.init()});
\ No newline at end of file

mercurial