/*
 * jQuery Text Alignment v0.02
 *
 * Licensed under the new BSD License.
 * Copyright 2009, Bram Stein
 * All rights reserved.
 */
(function(a){a.extend(a.fn,{textAlign:function(d){var b=a(this),c=0,e=0;if(d==="start"||d==="end"||d==="left"||d==="right"||d==="justify"||d==="center"){return b.css({textAlign:d})}else{if(d.length===1){b.each(function(){var g=a(this),i=g.text(),h,f;if(i.indexOf(d)!==-1){h=a("<span>"+i.slice(0,i.indexOf(d))+"</span>");f=a("<span>"+i.slice(i.indexOf(d))+"</span>")}else{h=a("<span>"+i+"</span>");f=a("<span/>")}h.css({display:"inline-block",textAlign:"right"});f.css({display:"inline-block",textAlign:"left"});a(this).empty().append(h).append(f);c=Math.max(c,h.width());e=Math.max(e,f.width())});b.each(function(){var g=a(this).children(),h=a(g[0]),f=a(g[1]);h.width(c);f.width(e)})}}return b}})})(jQuery);
