
$(document).ready(function(){
		
	    $(".firstpane div.menu_body").hide();
	 
	    $(".firstpane p").click(function(){
		
	        $(this).next("div.menu_body").slideToggle("slow")
        .siblings("div:visible").slideUp("slow");
	        $(this).toggleClass("active");
        $(this).siblings("p").removeClass("active");
	     });
		 
 });

function getVals(value,option_id,d){
	
	var id="#select-"+option_id
	
	if(d) id+='-'+d;

	var select=$(id);
	
	var url="/ru/catalog/option_values";
	
	select.attr('disabled', true);

	$.get(
       url,
       "value=" + value + "&option_id=" + option_id,
        function (result) {
                if (result.type == 'error') {
                    alert('error');
                    return(false);
                }
                else {
                    var options = '<option value="">-------</option>';
                    $(result).each(function(index,value) {
                        options += '<option value="' + $(this).attr('value') + '">' + $(this).attr('value') + '</option>';
                    });
                    select.html(options);
                    select.attr('disabled', false);
                }
            },
            "json"
        );

	
}
