jQuery(document).ready(function(){
    setStyles();
    jQuery("#typeRow").show();
    jQuery("#marqueRow").hide();

  jQuery("input[name='fieldVousetesR']").change(function(){
    jQuery("input[name='fieldVousetes']").val(jQuery("input[name='fieldVousetesR']:checked").val());
  })

  jQuery("input[name='fieldRefectionR']").change(function(){
    if(jQuery("input[name='fieldRefectionR']:checked").val() =="Billard"){
      jQuery("#typeRow").show();
      jQuery("#marqueRow").hide();
      jQuery("input[name='fieldRefection']").val("Billard - "+jQuery("#typeBillard :selected").val());
    }
    else { if(jQuery("input[name='fieldRefectionR']:checked").val() =="Baby-foot"){
        jQuery("#typeRow").hide();
        jQuery("#marqueRow").show();
        jQuery("input[name='fieldRefection']").val("Baby-foot - "+jQuery("#notmandatory---text---Marque").val());
        }
    }

  })
  jQuery("#typeBillard").change(function(){
    jQuery("input[name='fieldRefection']").val(jQuery("input[name='fieldRefectionR']:checked").val()+' - '+jQuery("#typeBillard :selected").val());
  })
    jQuery("#notmandatory---text---Marque").change(function(){
    jQuery("input[name='fieldRefection']").val(jQuery("input[name='fieldRefectionR']:checked").val()+' - '+jQuery("#notmandatory---text---Marque").val());
  })
});

function setStyles(){
    jQuery('input[type="text"], input[type="password"], textarea').addClass("inputText");
    jQuery('input[type="button"], input[type="reset"], input[type="submit"]').addClass("inputButton");
    jQuery('input[type="checkbox"]').addClass('inputCheckbox');
    jQuery('input[type="radio"]').addClass('inputRadio');

    jQuery('input[type="text"], input[type="password"], textarea').focus(function() {
        jQuery(this).addClass("inputText-focus");
    }).blur(function() {
        jQuery(this).removeClass("inputText-focus");
    });

    jQuery('input[type="button"], input[type="reset"], input[type="submit"]').mouseover(function() {
        jQuery(this).addClass("inputButton-focus");
    }).mouseout(function() {
        jQuery(this).removeClass("inputButton-focus");
    }).click(function(){
        jQuery(this).blur();
    });

    jQuery('.button1').mouseover(function() {
        jQuery(this).addClass("button1-focus");
    }).mouseout(function() {
        jQuery(this).removeClass("button1-focus");
    });

}


