function ShowFilter(){
	if (is_showed == false ){
		$("#regions_hide").hide();
		$("#filter_form").fadeIn("slow");
		$("#switcher").attr("style","background:url(/static/img/filter-open.gif) no-repeat 0 2px;")
		is_showed = true;
	}else{
		$("#regions_hide").fadeIn("slow");
		$("#filter_form").hide();
		$("#switcher").attr("style","background:url(/static/img/filter-closed.gif) no-repeat 0 2px;")
		is_showed = false;
	}
}
function ShowFilterSimple(){
	if (is_showed == false ){
		$("#filter_form").fadeIn("slow");
		$("#switcher").attr("style","background:url(/static/img/filter-open.gif) no-repeat 0 2px;")
		is_showed = true;
	}else{
		$("#filter_form").hide();
		$("#switcher").attr("style","background:url(/static/img/filter-closed.gif) no-repeat 0 2px;")
		is_showed = false;
	}
}
var is_showed_documments = new Array();
function ShowDescription(id){
	if (is_showed_documments[id] == false ){
		$("#descr_div_"+id).fadeIn("slow");
		$("#document_"+id).attr("class","doc-block spread");
		$("#switcher").attr("style","background:url(/static/img/filter-open.gif) no-repeat 0 2px;")
		is_showed_documments[id] = true;
	}else{
		$("#descr_div_"+id).hide();
		$("#document_"+id).attr("class","doc-block");
		$("#switcher").attr("style","background:url(/static/img/filter-closed.gif) no-repeat 0 2px;")
		is_showed_documments[id] = false;
	}
}
function show_or_hide(){
		if ($('#id_chapter_type').val()!=1){
			$("#id_cost_cur").hide();
			$("#id_cost_next").hide();
			$("#id_cost_after").hide();
			
			$("label[for='id_cost_cur']").hide();
			$("label[for='id_cost_next']").hide();
			$("label[for='id_cost_after']").hide();
		}
		else{
			$("#id_cost_cur").show();
			$("#id_cost_next").show();
			$("#id_cost_after").show();
			
			$("label[for='id_cost_cur']").show();
			$("label[for='id_cost_next']").show();
			$("label[for='id_cost_after']").show();
		}
	}
function show_or_hide_kadry(){
	$("#id_discharge_type").hide();
	$("label[for='id_discharge_type']").hide();
	$("#id_appointment_type").hide();
	$("label[for='id_appointment_type']").hide();
	
	$("label[for='id_date_from']").parent().parent().hide();
	$("label[for='id_date_to']").parent().parent().hide();
	
	
	if ($('#id_type').val()!=''){
		if ($('#id_type').val()!=2){
			$("#id_appointment_type").show();
			$("label[for='id_appointment_type']").show();
			$("label[for='id_date_from']").parent().parent().show();
			$("label[for='id_date_to']").parent().parent().show();
		}
		else{
			$("#id_discharge_type").show();
			$("label[for='id_discharge_type']").show();
		}
	}
}