/* 
converts images into background of the parent element;

*/



(function($) {

    $.fn.img2bgr = function(options) {
	
		var defaults = {  
		           
				
		}
		
		
		
		
		
		var options = $.extend(defaults, options); 
		
		
		
		
		var methods = {
			
			//	methods.init.call(this);
			init : function(){
				
				$(this).each(function(){

					var s = $(this).attr('src');
				//	$(this).hide();
				
					$(this).parent().css({
						"background-image":'url('+s+')',
						backgroundRepeat:'none',
						"background-position":'center',
						width:$(this).width(),
						height:$(this).height(),
						display:'block'
					});
					
					$(this).remove();


				})
					
				
			}
						
			
		}; // end of methods
				
		methods.init.call(this);
		
			
				
		
	
	}// end of plugin function : $.fn.img2bgr
})(jQuery);




