// JavaScript Document

// JavaScript Document

$(document).ready(function(){
	
	var maxicon = location.protocol + "//www.newpaltz.edu/images/social_maximize_blue.jpg";
	var minicon = location.protocol + "//www.newpaltz.edu/images/social_minimize_blue.jpg";
	
	/* Show the minimize button if JS is on */
	$("#minbutton").show();
	
	/* Set up functions for showing and hiding bar, and setting up cookies to remember state */
	
		function closeIcons (){
			/* Change the min/max button */
			$("#minbutton a img").attr("title","Show Social Media Icons"); /* Change mouseover title */
			$("#minbutton a img").attr("src", maxicon); /* Change the image to an up arrow */
		
			/* Hide the bottom bar */
			$("#bottom").stop().animate({
				bottom: "-35px"
			},100);
			
			/* Remember that the bar is hidden */
			$.cookie("showsocialmedia", "false", { expires: 30, path: "/", domain: "oc.edu" });
		}
		
		function openIcons (){
			/* Change the min/max button */
			$("#minbutton a img").attr("title","Hide Social Media Icons"); /* Change mouseover title */
			$("#minbutton a img").attr("src", minicon); /* Change the image to a down arrow */
		
			/* Show bottom bar */
			$("#bottom").stop().animate({
				bottom: "-3px"
			},75);
			
			/* Remember that the bar is shown */
			$.cookie("showsocialmedia", "true", { expires: 30, path: "/", domain: "oc.edu" });
		}




	/*********** Set starting conditions based on cookie ************/
	
		
		/*********** If the bar should be shown ... ************/
		
			/* Hide and show based on click - FIRST CLICK HIDES */
			$("#hideshow").toggle(
				function(e){
					closeIcons();
					/*e.preventDefault();*/
					return false;
				},
				function(e){
					openIcons ();
					/*e.preventDefault();*/
					return false;
				}
			);
	
	
	
	
	
	
	
	
	
	
	
	
	
});
