//You need an anonymous function to wrap around your function to avoid conflict  
(function($){  

	//Attach this new method to jQuery  
	$.fn.extend({   
	
		//This is where you write your plugin's name  
		textSlider: function(options) {  
		
			//Set the default values, use comma to separate the settings, example:  
			var defaults = {  
				slideInTime: 1000,  
				slideOutTime: 1000,  
				pauseTime: 300,
				easeIn: 'easeOutElastic',
				easeOut: 'easeInElastic',
				text: ["text 1","text 2","text 3"]
			}  
		
			var options =  $.extend(defaults, options);
			
		
			//Iterate over the current set of matched elements  
			return this.each(function() {  
				var o = options;        
				
				//Assign current element to variable
        var obj = $(this);
				
				obj.css({
					'position': 'absolute',
					'overflow': 'hidden',
					'min-height': '16px'
				});
				//code to be inserted here  
        //you can access the value like this: alert(o.padding);
				for(i=0;i<o.text.length;i++) {
					obj.append("<div>" + o.text[i] + "</div>");
				}
				$("div", obj).css({
					'position': 'absolute',
					'display': 'none',
					'opacity': '0',
					'text-shadow': '0px 0px 4px #bd7e48',
					'filter': 'progid:DXImageTransform.Microsoft.Glow(color=#bd7e48,strength=1) progid:DXImageTransform.Microsoft.Blur(Enabled=true, pixelradius=1)'
				});
			
				var textObj = $("div:first", obj);
				slideIn(textObj);
				
				function slideIn(textObj) {
					var textWidth = textObj.width();
					var textCenter = textWidth / 2;
					var containerCenter = obj.width() / 2;
					var centerPos = containerCenter - textCenter;
					textObj.css("display", "block");
					textObj.css("left", obj.width());
			//		textObj.css("width", textWidth);
						textObj.animate({
							opacity: 1,
							left: centerPos
						}, o.slideInTime, o.easeIn, function(){
							setTimeout(function() { 
								slideOut(textObj) 
							}, o.pauseTime);
							setTimeout(function() {
								var next = textObj.next();
								if(next.width() == null) { 
									next = textObj.siblings(':first');
								}		
								slideIn(next);
							}, o.pauseTime);
						});
				}
					
				function slideOut(textObj) {
					textObj.animate({
						opacity: 0,
						left: -textObj.width()
					}, o.slideOutTime, o.easeOut, function(){});
				}

		
			});  // return this.each(function() {
		}  
	});  

//pass jQuery to the function,   
//So that we will able to use any valid Javascript variable name   
//to replace "$" SIGN. But, we'll stick to $ (I like dollar sign: ) )         
})(jQuery);  
