function ToggleElem(id)
{
	var target_width = "205px";
	if ($("#" + id).width() == 205 || $("#" + id).width() == 203) target_width = "768px"; 
	$("#" + id + " #" + id +"_button").hide();
	$("#" + id).animate({width: target_width}, 350, "linear", function() {
		
		if ($("#" + id + " #" + id +"_button").hasClass("btn_close") || $("#" + id + " #" + id +"_button").hasClass("btn_open")) {
			$("#" + id + " #" + id +"_button").toggleClass("btn_close");
			$("#" + id + " #" + id +"_button").toggleClass("btn_open");
		}
		
		if ($("#" + id + " #" + id +"_button").hasClass("btn_close_big") || $("#" + id + " #" + id +"_button").hasClass("btn_open_big")) {
			$("#" + id + " #" + id +"_button").toggleClass("btn_close_big");
			$("#" + id + " #" + id +"_button").toggleClass("btn_open_big");
		}
		
		$("#" + id + " #" + id +"_button").show();
		if($("#" + id + " #" + id +"_content").css("display") == "block")
			$("#" + id + " #" + id +"_content").hide();
		else
			$("#" + id + " #" + id +"_content").show();

		if (document.getElementById(id + "_tools"))
		{
			if(target_width == "205px")
			{
				document.getElementById(id + "_tools").style.width='203px';
				$("#" + id +"_scroll").hide();
			}
			else
			{
				document.getElementById(id + "_tools").style.width='768px';
				$("#" + id +"_scroll").show();
			}
		}


		if (typeof(this.currentStyle) != 'undefined')
		{
			document.getElementById( this.id ).style.overflow='hidden';
		}
	});
	
}

