var dv = AppGiniHelper.DV;

// dv.getField("pilot").size(250);

dv.getField("anzahl_fluege").size(150);

dv.getField("anzahl_fluege_120").size(150);

dv.getField("max_flughoehe").size(150);

dv.getField("beginn").size(350);

dv.getField("ende").size(350);



if (!$j("#gastpilot").is(':checked'))  {

	$j("#name_gastpilot").parents('.form-group').hide();

	$j("#mfbo").parents('.form-group').hide();

	$j("#reg_nr").parents('.form-group').hide();

	$j("#fluege").parents('.form-group').hide();

	$j("#lrb").parents('.form-group').hide();

	$j("#hoehe").parents('.form-group').hide();

	

}	



$j("#gastpilot").on('change', function () {  

// if you want to show only the label

if ($j(this).is(':checked')) { 

	$j("label[for='name_gastpilot']").parent('.form-group').show();

	$j("label[for='mfbo']").parent('.form-group').show();

	$j("label[for='reg_nr']").parent('.form-group').show();

	$j("label[for='fluege']").parent('.form-group').show();

	$j("label[for='lrb']").parent('.form-group').show();

	$j("label[for='hoehe']").parent('.form-group').show();

	

}

else {

	$j("label[for='name_gastpilot']").parent('.form-group').hide();

	$j("label[for='mfbo']").parent('.form-group').hide();

	$j("label[for='reg_nr']").parent('.form-group').hide();

	$j("label[for='fluege']").parent('.form-group').hide();

	$j("label[for='lrb']").parent('.form-group').hide();

	$j("label[for='hoehe']").parent('.form-group').hide();



}

});







// populate curent date time for NEW record

$j(function () {

    // check if data (record) exist or not

    if ($j('#beginn').val()) return;

    // populate the current date time (using moment.js)

    $j('#beginn').val(moment().add(-60, 'minutes').format('H:mm'));

});

// populate curent date time for NEW record

$j(function () {

    // check if data (record) exist or not

    if ($j('#ende').val()) return;

    // populate the current date time (using moment.js)

    $j('#ende').val(moment().format('H:mm'));

});



var f1 = dv.addFooter();

f1.append("JF - Flugbuch - Aeroclub");



new AppGiniFields(["erfasser", "erfasst", "geaendert_von", "geaendert"]).hide();







