(function($){
	$.extend({
		bgSlider:function(opt){
			var _={
				pasta:'<div id="bgSlider"><img></div>',
				resizeFu:function(){
					var wwi=$(window).width(),
						whe=$(window).height(),
						wk=whe/wwi
					
					if(wk<_.k)
						_.img
							.css({
								width:wwi,
								height:'auto'
							})
					else
						_.img
							.css({
								width:'auto',
								height:whe
							})
				}
			}
			_.me=$(_.pasta)
				.appendTo('body')
			_.img=$('img',_.me)
				.css({position:'fixed',left:0,top:0,zIndex:-1})
				.load(function(){
					_.k=_.img.height()/_.img.width()
					_.resizeFu()
				})
			
			
			if(typeof opt=='string')
				_.img.attr({src:opt})
			if(typeof opt=='object')
				_=$.extend(_,opt)
				
			$(window)
				.resize(function(){
					_.resizeFu()
				})
			_.resizeFu()
			return _.me
		}
	})
})(jQuery)
