(function($) {
	
	$.fn.jwAnnounce = function(options) {

		var options = $.extend({
			className : 'notice',
			text : null,
			siteWidth : null }, options);
	
		return this.each(function() {
			$(this).prepend('<div class="' + options.className + '" />');
			
			var $announceDiv = $('.' + options.className);
			
			$announceDiv
				.append('<div>' + options.text + '</div>')
				.children('div:last')
					.css({
						'width' : options.siteWidth,
						'margin' : 'auto'
					})
				.end()
				.prepend('<span class="close">X</span>')
				.children('.close')
					.css({
						'position' : 'absolute',
						'cursor' : 'pointer',
						'display' : 'none',
						'margin-left':'20px',
						'margin-top':'10px'
					})
				.end()
				
				.hover(function() {
					// over
					$(this)
						.children('.close')
						.show()
						.click(function() {
							$announceDiv.slideUp(250, function() {
								$(this).remove();
							});
						})
				}, function() {
					$('.close').hide();
				});
		}); // end each
	
	}
	
})(jQuery);