//extend the plugin
(function($){

	//define the new for the plugin ans how to call it	
	$.fn.hourz = function(options) {

	//act upon the element that is passed into the design    
		return this.each(function(options) {
			//construct the form
			$(this).html('<div id="hoursButton"></div><div id="hoursPanel"><p>M&aring;n-Fre:<b> 08 - 17 </b><br /><br /> L&ouml;r: <b>10 - 13</b></p></div>');
			//show / hide function
			$('div#hoursButton').toggle(function() {
				$('#overlay').css({display: 'block'});
				$(this).animate({"marginRight": "-=5px"}, "fast"); 
				$('#hoursPanel').animate({"marginRight": "-=0px"}, "fast");
				$(this).animate({"marginRight": "+=277px"}, "slow"); 
				$('#hoursPanel').animate({"marginRight": "+=280px"}, "slow"); 
			}, 
			function() {
				$('#hoursPanel').animate({"marginRight": "-=280px"}, "slow");
				$(this).animate({"marginRight": "-=277px"}, "slow").animate({"marginRight": "+=5px"}, "fast"); 
				$('#overlay').css({display: 'none'});
			});
		});
	};
})(jQuery);
			
