function hide_all(){
$("#str_container > li > ul").hide();
}


$(function(){
  $("#str_container li a").click(
    function(){
      $(this).parent().children("ul").toggle("slow");

      if($(this).attr("class")){
        $(this).removeClass();
      }else{
        $(this).addClass('on');
      }
    }
  )
})

$(document).ready( function(){ hide_all(); hide_bookmark(); })

//Слайдинг панели закладок
function hide_bookmark(){
  $("#bookmarks").hide();
}
var shown = false;
var showing = false;

function show_mod(){
	if(shown)return;
	shown = true;
	if (showing) return;
	showing = true;
	$("#bookmarks").show();
	$("#bookmarks").animate({bottom: 0}, 400, 'swing', function () {
		$('#bookmarks').show();
		showing = false;
		if (!shown) {
			shown = true;
			hide_mod();
		}
	})
  return false;
}

function hide_mod(){
	//alert("hide")
	if (!shown) return;
	shown = false;
	if (showing) return;
	showing = true;
	$("#bookmarks").animate({bottom: -155}, 400, 'swing', function () {
		$('#bookmarks').hide();
		showing = false;
		if (shown) {
			shown = false;
			show_mod();
		}
	})
	return false;
}
$(function(){
  $("#bookkmark_but").click(function(){
    if(shown==false){
      show_mod(); $('#bookkmark_but').addClass('on');
    }else{ hide_mod(); $('#bookkmark_but').removeClass(); }
  })
})
