// toolbar: 
// http://www.pvmgarage.com/2009/12/nice-and-simple-toolbar-for-your-website-with-css3-and-jquery/
$(document).ready(function(){
	
 //hide toolbar and make visible the 'show' button
	$("span.downarr a").click(function() {
 $("#toolbar").slideToggle("fast");
 $("#toolbarbut").fadeIn("slow");
				$.cookie('tbhide', '1', { expires: 0.02 });
 });
 
 // check to see if there is a cookie. If there is then do the same code as clicking the hide button
		if ($.cookie('tbhide') == true) {
 $("#toolbar").slideToggle("fast");
 $("#toolbarbut").fadeIn("slow");
		}
		
		//show toolbar and hide the 'show' button
 $("span.showbar a").click(function() {
 $("#toolbar").slideToggle("fast");
 $("#toolbarbut").fadeOut(); 
				// unset a coockie
				$.cookie('tbhide', 0);
 });
 
 //show tooltip when the mouse is moved over a list element 
 $("ul#social li").hover(function() {
		$(this).find("div").fadeIn("fast").show(); //add 'show()'' for IE
 $(this).mouseleave(function () { //hide tooltip when the mouse moves off of the element
  $(this).find("div").hide();
 });
 });
 // don't jump to #id link anchor 
 $(".menutit, span.downarr a, span.showbar a").click(function() {
 return false;
			}
		);
	
 //show quick menu on click 
		//1
	$("span.menu_title1 a").click(function() {
		if($(".quickmenu1").is(':hidden')){ //if quick menu isn't visible 
			$(".quickmenu1").fadeIn("fast"); //show menu on click
		}
		else if ($(".quickmenu1").is(':visible')) { //if quick menu is visible 
  $(".quickmenu1").fadeOut("fast"); //hide menu on click
 }
	});
	
	//hide quickmenu on casual click on the page
	//1
	$(document).click(function() {
			$(".quickmenu1").fadeOut("fast");
			$(".quickmenu1").css({'vivibility': 'hidden'});
	});
	$('.quickmenu1').click(function(event) { 
		event.stopPropagation(); //use .stopPropagation() method to avoid the closing of quick menu panel clicking on its elements 
	});
});
