(function($) {
	//Plugin Description and Settings
	$.fn.setBackgroundPosition = function(s) {
		s = jQuery.extend({
			x: 'e',
			y: 'e'
		},s);

		var p = $(this).css('background-position');
    	if(p == undefined){
    		p = $(this).css('background-position-x') + ' ' + $(this).css('background-position-y');
    		
    		var index = p.indexOf('px');
			var x = p.substring(0, index);
			index = index + 3;
			var y = p.substring(index, p.length-2);
			var css = {x:x,y:y};
			
			if (s.x != 'e') css.x = s.x;
			if (s.y != 'e') css.y = s.y;
    		
    		$(this).css({'background-position-x':css.x +'px'});
    		$(this).css({'background-position-y':css.y +'px'});
    		
    	}else{
    		var index = p.indexOf('px');
			var x = p.substring(0, index);
			index = index + 3;
			var y = p.substring(index, p.length-2);
			var css = {x:x,y:y};

			
			if (s.x != 'e') css.x = s.x;
			if (s.y != 'e') css.y = s.y;
						
			var cssString = css.x +'px' + ' ' + css.y + 'px';
			$(this).css({'background-position':cssString});	
    	}
	};
})(jQuery);