﻿$(document).ready(function() {
    accordeonDropDown();

    $("#ctl00_cph_Content_file_id").change(function() {
        $("#fileName").text($("#ctl00_cph_Content_file_id").val());

    });



    //    $("#CountryId").click(function() {
    //        $('#code_postal_id').val('');
    //    });

    $("input.contact_mailing_valider_bouton").click(function() {

        if (($('#CountryId :selected').val() == 34) || ($('#CountryId :selected').val() == 84) || ($('#CountryId :selected').val() == 91) || ($('#CountryId :selected').val() == 135) || ($('#CountryId :selected').val() == 180)) {
            $("#CityHidden").attr("value", $("#City").val());
        }
        else {
            $("#CityHidden").attr("value", $("#TCityInput").val());
        }

        $("#reference_id").val($("#id_prod").val());
        //$("#nouveauForm")[0].submit();
    });
    if ($("#isFirstSubmit").length > 0) {
        $("font[color='red']").parent().siblings("input").css('color', 'red');
    }
    var tarea = $("#TComment").val();
    if (tarea == "") {
        $("#TComment").val("Entrez votre commentaire (facultatif)");
    }

});


function accordeonDropDown() {

 $(".illustr_acces").hide()	
 $(".bt_acces_espace_particulier .illustr_acces").show()	

 $("a.bt_acces").click(function() {

	if ($(this).is(".active")) {
	 $("a.bt_acces").removeClass("active");
	 $(this).next(".illustr_acces").slideUp()
	} else {
	 $("a.bt_acces").removeClass("active");
	 $("a.bt_acces").next(".illustr_acces").slideUp();
	 $(this).addClass("active");
	 $(this).next(".illustr_acces").slideDown();
	}
 });
}

function changeTextCol(el) {
    $(el).css("color", "#22abe5");
    $(el).removeClass("requiredBold");
}


