tools1
$(document).ready(function() { $("#txt_yeast_liquid_mfg_date").datepicker({ dateFormat: 'yy/mm/dd', defaultDate: "-1" });
// check for metric cookie if(getCookie('bfmetric') == 'metric') { $('input:radio[name=units]:nth(1)').attr('checked',true); switchUnitsToMetric(); }
if(getCookie('bfsugar') == 'plato') { $('input:radio[name=sugarscale]:nth(1)').attr('checked',true); switchToPlato(); }
// default date to today, but not if previously set (in the case of the back button) if($('#txt_yeast_liquid_mfg_date').val() == "") { var now = new Date(); var day = now.getDate(); var month = now.getMonth() + 1; var year = now.getFullYear(); if(day < 10) { day = '0' + day; } if(month < 10) { month = '0' + month; } $('#txt_yeast_liquid_mfg_date').val(year + '/' + month + '/' + day); } // deal with incoming parameters from recipe editor GET = processGetVariables(); if(GET['units']) { if(GET['units'] == "us") { $('input:radio[name=units]:nth(0)').attr('checked',true); switchUnitsToUs(); } else { $('input:radio[name=units]:nth(1)').attr('checked',true); switchUnitsToMetric(); } } if(GET['sugarscale']) { if(GET['sugarscale'] == "sg") { $('input:radio[name=sugarscale]:nth(0)').attr('checked',true); switchToSG(); } else { $('input:radio[name=sugarscale]:nth(1)').attr('checked',true); switchToPlato(); } } if(GET['yeasttype']) { $('#yeasttype').val(GET['yeasttype']); } // always call this in case the back button was used updateYeastType(); if(GET['og'] && isNumber(GET['og'])) { $('#txtwortgravity').val(GET['og']); } if(GET['batchsize'] && isNumber(GET['batchsize'])) { $('#txtwortvolume').val(GET['batchsize']); } if(GET['pitchrate']) { $('#pitchrate').val(GET['pitchrate']); } if($("#step2").attr('checked')) { $('.step2row').show(); } else { $('.step2row').hide(); } if($("#step3").attr('checked')) { $('.step3row').show(); } else { $('.step3row').hide(); } updateAll(); });