$2
');b=b.replace(/\[img\]\s*(((?!")[\s\S])+?)(?:"[\s\S]*?)?\s*\[\/img\]/ig,'$1");b=b.replace(/\[flash\s*(?:=\s*(\d+)\s*,\s*(\d+)\s*)?\]\s*(((?!")[\s\S])+?)(?:"[\s\S]*?)?\s*\[\/flash\]/ig, function(a,h,i,l){h||(h=480);i||(i=400);return''});b=b.replace(/\[media\s*(?:=\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+)\s*)?)?\]\s*(((?!")[\s\S])+?)(?:"[\s\S]*?)?\s*\[\/media\]/ig,function(a,h,i,l,e){h||(h=480);i||(i=400);return''});b=b.replace(/\[table\s*(?:=\s*(\d{1,4}%?)\s*(?:,\s*([^\]"]+)(?:"[^\]]*?)?)?)?\s*\]/ig,function(a,h,i){a="
1?' colspan="'+h+'"':"")+(i>1?' rowspan="'+i+'"':
"")+(l?' width="'+l+'"':"")+">"});b=b.replace(/\[\/(table|tr|td)\]/ig,"$1>");b=b.replace(/\[\*\]((?:(?!\[\*\]|\[\/list\]|\[list\s*(?:=[^\]]+)?\])[\s\S])+)/ig,"
");for(g=1;g<=n;g++)b=b.replace("[\tubbcodeplace_"+g+"\t]",m[g]);return b=b.replace(/(^|<\/?\w+(?:\s+[^>]*?)?>)([^<$]+)/ig,function(a, h,i){return h+i.replace(/[\t ]/g,function(l){return{"\t":" "," ":" "}[l]})})} function html2ubb(g){function o(e){var c;if(c=e.match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)){for(e=(c[1]*65536+c[2]*256+c[3]*1).toString(16);e.length<6;)e="0"+e;e="#"+e}return e=e.replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3")}var b=/\s+src\s*=\s*(["']?)\s*(.+?)\s*\1(\s|$)/i,m=/\s+width\s*=\s*(["']?)\s*(\d+(?:\.\d+)?%?)\s*\1(\s|$)/i,n=/\s+height\s*=\s*(["']?)\s*(\d+(?:\.\d+)?%?)\s*\1(\s|$)/i,s=/(?:background|background-color|bgcolor)\s*[:=]\s*(["']?)\s*((rgb\s*\(\s*\d{1,3}%?,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\))|(#[0-9a-f]{3,6})|([a-z]{1,20}))\s*\1/i, a=String(g),h=[],i=0;a=a.replace(/\s*\r?\n\s*/g,"");a=a.replace(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig,"");a=a.replace(/ |