jQuery.fn.noticebar = function(options) {
	//compiles options
	var settings = jQuery.extend({
		 html : "Notice is credit to team!" ,
		 animate : true ,
		 delay : 0 ,
		 css : "",
		 close : true,
		 target : "body",
	   }, options);
	
	//A class noticebar, generates needed divs
	function noticebar() {
		this.generate = function() {
		var close = ""
		if (settings.close) {close = '<span class="jqueryNoticebarClose" style="margin-left: 10px;opacity: .5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter: alpha(opacity=50);cursor: pointer;">[close]</span>'};
		var html = '<div class="jqueryNoticebar" style="width: 100%;text-align: center;background:#FFF6BF none repeat scroll 0 0;border-bottom:2px solid;border-color:#FFD324;color:#514721;position:absolute;left:0px;top:0px;padding: 3px 0;' + settings.css + '">' + settings.html + close + '</div>'
			return html;
		}
		this.offset = function() {
			var html = '<div class="jqueryNoticebar" style="height: 25px;width: 1px;display:none;"></div>'
			return html;
		}
	}
	//Creates an instance of the class for to use
	var noticebar =  new noticebar();

	//Adds noticebar to page
	jQuery(document).ready(function(){
		if(settings.target!="body") {jQuery(settings.target).css("position" , "relative")};
		//pushes the page's contents down making room for the notice bar insuring nothing gets Hidden
		jQuery(settings.target).prepend(noticebar.offset());
		//Calls generator and prepends results
		jQuery(settings.target).prepend(noticebar.generate());
		
		//Handles delay and animate options
		if (settings.animate) {
			jQuery('.jqueryNoticebar').hide();
			jQuery('.jqueryNoticebar').delay(settings.delay).animate({height: ['show', 'swing'],}, 500, 'linear');
		}
		
		jQuery(".jqueryNoticebarClose").click(function () { 
			$('.jqueryNoticebar').slideUp(); 
		})
	})
}