if (!window.ubbcode)var ubbcode={}
if (!window.__IMGPATH)var __IMGPATH = 'http://img4.ngacn.cc/ngabbs'

ubbcode.smiles = {
1:__IMGPATH+'/post/smile/smile.gif',
2:__IMGPATH+'/post/smile/mrgreen.gif',
3:__IMGPATH+'/post/smile/question.gif',
4:__IMGPATH+'/post/smile/wink.gif',
5:__IMGPATH+'/post/smile/redface.gif',
6:__IMGPATH+'/post/smile/sad.gif',
7:__IMGPATH+'/post/smile/cool.gif',
8:__IMGPATH+'/post/smile/crazy.gif',
32:__IMGPATH+'/post/smile/12.gif',
33:__IMGPATH+'/post/smile/13.gif',
34:__IMGPATH+'/post/smile/14.gif',
30:__IMGPATH+'/post/smile/10.gif',
29:__IMGPATH+'/post/smile/09.gif',
28:__IMGPATH+'/post/smile/08.gif',
27:__IMGPATH+'/post/smile/07.gif',
26:__IMGPATH+'/post/smile/06.gif',
25:__IMGPATH+'/post/smile/05.gif',
24:__IMGPATH+'/post/smile/04.gif',
35:__IMGPATH+'/post/smile/15.gif',
36:__IMGPATH+'/post/smile/16.gif',
37:__IMGPATH+'/post/smile/17.gif',
38:__IMGPATH+'/post/smile/18.gif',
39:__IMGPATH+'/post/smile/19.gif',
40:__IMGPATH+'/post/smile/20.gif',
41:__IMGPATH+'/post/smile/21.gif',
42:__IMGPATH+'/post/smile/22.gif',
43:__IMGPATH+'/post/smile/23.gif'
}

ubbcode.checkLinkTable = {
'worldofwarcraft.com':1,
'ofcard.com':1,
'uusee.com':1,
'youtube.com':1,
'youku.com':1,
'weplay.cn':1,
'tudou.com':1,
'ngacn.cc':1,
'uencn.com':1,
'sc2.cc':1,
'ngacn.com':1,
'wowchina.com':1,
'microsoft.com':1,
'dmzj.com':1,
'178.com':1,
'com.cn':'add1',
'pixiv.net':'add1',
'embed.pixiv.net':1,
'sina.com.cn':1,
'bilibili.us':1
}

ubbcode.checkIframeTable = {
1:'http://embed.pixiv.net/code.php?id=',
2:'http://poll.178.com/cache/'
}

ubbcode.regexplock = 0;
ubbcode.videonum = 0;

ubbcode.sRand={
		'seed':2110032,
		'rnd':function(){this.seed = (this.seed*9301+49297) % 233280;
			return this.seed/(233280.0);
			},
		'rand':function(){
			return this.rnd();
			}
		}

ubbcode.genRandSeed=function(tid,pid,uid,mid){
if(uid=parseInt(uid,10)){
	if (pid=parseInt(pid,10))
		return pid+uid
	else if (tid=parseInt(tid,10))
		return tid+uid
	else if (mid=parseInt(mid,10))
		return mid+uid
	}
return Math.floor(Math.random()*10000);
}

ubbcode.secure_text=function(t)
{
t = t.replace('<','&lt;');
t = t.replace('>','&gt;');
t = t.replace('"','&quot;');
t = t.replace("'",'&#39;');
t = t.replace(/&lt;br&gt;/gi,'<br />');
return t;
}
//fe

ubbcode.bbscodeConvArgsSave = {}

ubbcode.bbscode=function(o,noimg,tid,pid,uid)
{
if (this.regexplock)
	{
	var self = this
	window.setTimeout(function(){self.bbscode(o,noimg,tid,pid,uid)},50);
	}
else
	{
	this.regexplock = 1;
	var argsId = o.id ? o.id : 'bbcode'+Math.random()
	this.bbscodeConvArgsSave[argsId]=[o,noimg,tid,pid,uid]
	this.sRand.seed = this.genRandSeed(tid,pid,uid)
	if (typeof(o)=='string')o=document.getElementById(o)
	o.className+=' ubbcode'
	o.innerHTML = this.bbscode_common(this.secure_text(o.innerHTML),noimg,argsId);
	this.regexplock = 0;
	}
}

ubbcode.bbscode_common=function(c,noimg,argsId)
{

var self = this

c = c.replace(/\r/g,'');

c = c.replace(/\n/g,' ');


c = c.replace(/\[code(=[^\]]+)?\](.+?)\[\/code\]/gi,function($0,$1,$2){
	var s = $2;
	var l = null;
	var h = null;
	var hh = null;
	if ($1)l = $1.substr(1);
	switch (l)
		{
		case 'lua':
			h = "/js_highlighter.lua.js";
			break;
		case 'php':
			h = "/js_highlighter.php.js";
			break;
		case 'c':
			h = "/js_highlighter.c.js";
			break;
		case 'js':
			h = "/js_highlighter.js.js";
			break;
		case 'xml':
			h = "/js_highlighter.xml.js";
			break;
		case 'css':
			h = "/js_highlighter.css.js";
			break;
		default :
			s=s.replace(/\[/g,'&#91;').replace(/\]/g,'&#93;').replace(/ /g,'&nbsp;');
			return ("<br/><br/><span class='orange'>Code:</span><br><div class='textfield'>"+s+"</div><br/><br/>");
		}
	if (typeof(window.Highlighter)=='undefined')
		{
		window.Highlighter={'Brushes':{}};
		commonui.loadScriptInOrder(Array(__COMMONRES_PATH+"/js_highlighter.js"),function(){});
		}
	var id = 'code'+Math.floor(Math.random()*1000);
	s = s.replace(/<br\s*\/?>/ig,"\r\n").replace(/ /g,'&nbsp;').replace(/\[/g,'&#91;').replace(/\]/g,'&#93;');
	s = "<span class='orange'>Code <span class='gray'>("+l+")</span>:</span><br><div class='textfield'></div><textarea id='"+id+"' style='display:none'>"+s+"</textarea><br/><br/>";
	var prase = function(){$(id).previousSibling.innerHTML=Highlighter.Execute($(id).value,l);$(id).previousSibling.style.height='auto'}
	window.setTimeout(function(){commonui.loadScriptInOrder(__COMMONRES_PATH+h,prase)},1000);
	return s;
	}
	
	);//[code]

c = c.replace(/(<br\s*\/?>)?\s*\[table\]\s*(<br\s*\/?>)*\s*(.+?)\s*(<br\s*\/?>)*\s*\[\/table\]\s*(<br\s*\/?>)?/gi,function ($0,$1,$2,$3){
	var t = $3
	t = t.replace(/(<br\s*\/?>)?\s*\[tr\]\s*(<br\s*\/?>)*\s*(.+?)\s*(<br\s*\/?>)*\s*\[\/tr\]\s*(<br\s*\/?>)?/gi,"<tr>$3</tr>");//[tr]
	t = t.replace(/(<br\s*\/?>)?\s*\[td\s*([^\]]*)\]\s*(<br\s*\/?>)*\s*(.+?)\s*(<br\s*\/?>)*\s*\[\/td\]\s*(<br\s*\/?>)?/gi,function($0,$1,$2,$3,$4){
		var x,w='',c='',r='';
		if (parseFloat($2))
			w = 'width:'+$2+'%;'
		else{
			if (x = $2.match(/width=?(\d{0,2})/))
				w='width:'+x[1]+'%;'
			if (x = $2.match(/colspan=?(\d{0,2})/))
				c=' colspan='+x[1]+' '
			if (x = $2.match(/rowspan=?(\d{0,2})/))
				r=' rowspan='+x[1]+' '
			}
		return "<td "+c+r+" style='"+w+"border-left:1px solid #aaa;border-bottom:1px solid #aaa'>"+$4+"</td>"
		}
	);//[td]
	return "<div><table cellspacing='0px' style='border:1px solid #aaa;width:99.9%'>"+t+"</table></div>"
	}
);//[table]


c = c.replace(/\[del\](.+?)\[\/del\]/gi,"<del class='gray'> $1 </del>");//[del]
c = c.replace(/\[u\](.+?)\[\/u\]/gi,"<u>$1</u>");//[u]
c = c.replace(/\[b\](.+?)\[\/b\]/gi,"<b>$1</b>");//[b]
c = c.replace(/\[i\](.+?)\[\/i\]/gi,"<i style='font-style:italic'>$1</i>");//[i]

c = c.replace(/\[dice\]([\dd+\s]+?)\[\/dice\]/gi,function($0,$1){
var sum = 0;
var rr = $1;
$1 = '+'+$1;
$1 = $1.replace(/(\+)(\d{0,10})(?:(d)(\d{1,10}))?/gi,function($0,$1,$2,$3,$4){
	if($2)$2 = parseInt($2,10); else if($3)$2=1; else $2=0;
	$4 = parseInt($4,10);
	var r = '';
	if(!$3){if(typeof(sum)!='string')sum+=$2;return '+'+$2}
	if($2>10 || $4>1000){sum='ERROR';return'+OUT OF LIMIT'};
	for (var i=0; i<$2; i++)
		{
		var rand = Math.floor(ubbcode.sRand.rand()*$4)+1
		r+='+d'+$4+'('+rand+')';
		if(typeof(sum)!='string')sum+=rand;
		}
	return r;
	});
return "<table class='dice'><tr><td><b>ROLL : "+rr+'</b>='+$1.substr(1)+'=<b>'+sum+"</b></td></tr></table>";
});//[dice]

c = c.replace(/(<br\s*\/?>)*\s*\[(\/?)list(=.+?)?\]\s*(<br\s*\/?>)*/gi,function ($0,$1,$2,$3){ if($3){return("<"+$3+"ul type"+$3+">")}else{return("<"+$2+"ul>")} } );//[list]
c = c.replace(/\[\*\]/gim,"<li>");//[list]

c = c.replace(/\[quote\](.+?)\[\/quote\]/gi,"<div class='quote'>$1</div>");//[quote]

//c = c.replace(/\[say\](.+?)\[\/say\]/gi,"<div class='say'>$1</div>");//[say]

c = c.replace(/\[lessernuke\](.+?)\[\/lessernuke\]/gi,"<div class='lessernuke'><span class='crimson'>用户因此贴被暂时禁言，此效果不会累加</span> <a href='javascript:void(0)' onclick='nextElement(this).style.display=\"block\"'>点击查看</a><div style='display:none'>$1</div></div>");//[lessernuke]

c = c.replace(/\[color=(skyblue|royalblue|blue|darkblue|orange|orangered|crimson|red|firebrick|darkred|green|limegreen|seagreen|teal|deeppink|tomato|coral|purple|indigo|burlywood|sandybrown|sienna|chocolate|silver|gray)\](.+?)\[\/color\]/gi,"<span class='$1'>$2</span>");//[color]

c = c.replace(/\[email=(.{1,50}?)\](.+?)\[\/email\]/gi,"<a href='mailto:$1'>$2</a>");//[email\]

c = c.replace(/\[email\](.+?)\[\/email\]/gi,"<a href='mailto:$1'>$1</a>");//[email\]

c = c.replace(/\[size=(\d{1,3})%\](.+?)\[\/size\]/gi,function($0,$1,$2){return "<span style='font-size:"+$1+"%;line-height:"+$1+"%'>"+$2+"</span>"});//[size\]

c = c.replace(/\[font=(simsun|simhei|Arial|Arial Black|Book Antiqua|Century Gothic|Comic Sans MS|Courier New|Georgia|Impact|Tahoma|Times New Roman|Trebuchet MS|Script MT Bold|Stencil|Verdana|Lucida Console)\](.+?)\[\/font\]/gi,"<span style='font-family:$1'>$2</span>");//[font]

c = c.replace(/(?:<br\s*\/?>)?\s*(\[align=)(left|center|right)(\])(.+?)(\[\/align\])\s*(?:<br\s*\/?>)?/gi,"<div style='text-align:$2'>$4</div>");//[align]

if(c.indexOf('[headline]')!=-1){
var tmp = []
c = c.replace(/(?:<br\s*\/?>)*\s*\[headline\](.+?)\[\/headline\]\s*(?:<br\s*\/?>)*/ig,function ($0,$1){tmp.push($1);if(tmp.length==1)return '[headlinehere]';else return ''});
c = c.replace('[headlinehere]',function (){
var x = tmp
if(x){
	var td1,td2
	var z =[]
	for (var k=0;k<x.length;k++)
		{
		var u = x[k].match(/\[url=(https?|ftp|gopher|news|telnet|mms|rtsp|)(.+?)\](.+?)\[\/url\]/i)
		if(u){
			if(!u[1])u[1]='http://';
			u=self.writelink(u[1]+u[2],u[3])
			}
		else{
			u = x[k].match(/\[url\](https?|ftp|gopher|news|telnet|mms|rtsp)(.+?)\[\/url\]/i)
			if(u){
				u=self.writelink(u[1]+u[2],u[1]+u[2])
				}
			else
				{
				u = x[k].match(/\[(tid|pid)=?(\d{0,20})\](.+?)\[\/(tid|pid)\]/i)
				if(u){
					if(u[2])
						u= self.writelink('/read.php?'+u[1]+'='+u[2],u[3])
					else
						u= self.writelink('/read.php?'+u[1]+'='+u[3],u[3])
					}
				else
					{
					u = x[k].match(/\[hltxt\](.+?)\[\/hltxt\]/i)
					if(u)
						u='<span class=hltxt>'+u[1]+'</span>'
					}
				}
			}
		var i = x[k].match(/\[img\](.+?)\[\/img\]/i)
		if(i){
			i=i[1]
			z._Img=1
			}
		z.push({'i':i,'u':u})
		}
	if(!self.loadHeadLineElm)self.loadHeadLineElm = []
	self.loadHeadLineElm.push(z)
	return '<div></div><img style="display:none" src="about:blank" onerror="ubbcode.loadHeadLine(this.previousSibling,'+(self.loadHeadLineElm.length-1)+')"/>'
	}
});
}

var img_count = 0;
if (!noimg || typeof(noimg)=='object')
	{
	c = c.replace(/\[img(\d{0,3})\](.+?)\[\/img\]/gi,function($0,$1,$2){
		if($2.match(/^[\x00-\x7F]+$/)) 
			var src=$2; 
		else
			var src='';
		if (src && src.substr(0,2).toLowerCase()=='./')
			src = __ATTACH_BASE+'/'+src.substr(2);
		if(src && src.substr(0,7).toLowerCase()!='http://') 
			src = 'http://'+src;
		if($1 && $1<=100 && $1>0) 
			$1="style='width:"+($1-0.1)+"%'";
		else
			$1='';
		var tmp ='';
		if (typeof(noimg)=='object')
			{
			if (noimg.h)
				tmp+= 'if(this.offsetHeight>'+noimg.h+')this.style.height="'+noimg.h+'px";';
			if (noimg.w)
				tmp+= 'if(this.offsetWidth>'+noimg.w+')this.style.height="'+noimg.w+'px";';
			}
		if (src.substr(0,__ATTACH_BASE.length)==__ATTACH_BASE)
			{
			if (src.substr(src.length-10)=='.thumb.jpg')
				return("<a href='"+src.substr(0,src.length-10)+"' class='thumblink' target='_blank'><img src='"+src+"' onerror='this.onerror=null;this.parentNode.title=\"\";this.src=\""+src.substr(0,src.length-10)+"\"'/></a>")
			img_count++
			if (img_count>5)
				return("<a href='"+src+"' title='为了保证正常浏览，暂不显示全部大图' class='thumblink' target='_blank'><img src='"+src+".thumb.jpg' onerror='this.onerror=null;this.parentNode.title=\"\";this.src=\""+src+"\"'/></a>")
			}
		//if(src.match(/ngacn\.cc/gi))return "为了保证正常浏览，暂不显示签名中的图片";
		return("<img "+$1+" src='"+src+"' alt='' onload='"+tmp+"' onerror='this.nextSibling.style.display=\"inline\"'/><span class='silver' style='display:none'> [ "+$2+" ] </span>")
		});//[img]

	c = c.replace(/\[flash\](.+?)\[\/flash\]/gi,function($0,$1){ var u=$1;if(u.substr(0,7).toLowerCase()!='http://'){u = 'http://'+u} if (self.checklink(u,1)==1 && self.videonum<1) {var w=425;var h=350;if(u.indexOf('pl.bilibili.us')!=-1){w=540;h=450}self.videonum++;return("<object class='video' width='"+w+"' height='"+h+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'><param name='movie' value='"+u+"'><embed src='"+u+"' quality='high' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' allowfullscreen='true'></embed></object>");} else {return("<a href='"+u+"' target='_blank'>"+u+"</a>");} } );//[flash]

	c = c.replace(/\[iframe=(\d+),(\d+)\](https?)(.+?)\[\/iframe\]/gi,function($0,$1,$2,$3,$4){
		$1 = parseInt($1,10);$2 = parseInt($2,10)
		$1 = (!$1 || $1>1000)? 500 : $1
		$2 = (!$2 || $2>1000)? 500 : $2
		var u = $3+$4;
		for (var k in self.checkIframeTable)
			if(u.indexOf(self.checkIframeTable[k])==0)
				return "<div style='border:1px solid #444;width:"+$1+"px;height:"+($2+10)+"px;overflow:hidden'><div style='font-size:8px;line-height:10px;height:10px;overflow:hidden'>IFRAME:"+u+"</div><iframe frameborder=0 marginheight=0 marginwidth=0 scrolling='no' style='border:none;width:"+$1+"px;height:"+$2+"px;overflow:hidden;margin:0;background:transparent' src='"+u+"'></iframe></div>";
		return "<span><span class='chocolate'><span class='urltip chocolate' style='font-size:11px;padding:2px;text-align:center;line-height:15px'>"+u+"<br/>此网页不属于NGA网站，NGA不保证其安全性<br/><a href='"+u+"' onclick='this.parentNode.style.display=\"none\"' target='_blank'>继续访问</a> <a href='javascript:void(0)' onclick='this.parentNode.style.display=\"none\"'>取消</a></span>[</span> <a href='"+u+"' target='_blank'  onclick='this.parentNode.firstChild.firstChild.style.display=\"inline\";return false'>"+u+"</a> <span class='chocolate'>]</span></span>";
		});//[iframe]
	}

c = c.replace(/\[attach\](.+?)\[\/attach\]/gi,function($0,$1){
	if ($1 && $1.substr(0,2).toLowerCase()=='./')
		$1 = __ATTACH_BASE+'/'+$1.substr(2);
	if ($1.substr(0,__ATTACH_BASE.length)==__ATTACH_BASE)
		return self.writelink($1,$1)
	});


c = c.replace(/\[url=(https?|ftp|gopher|news|telnet|mms|rtsp|)(.+?)\](.+?)\[\/url\]/gi,function($0,$1,$2,$3){if(!$1)$1='http://';return(self.writelink($1+$2,$3))});//[url]

c = c.replace(/\[url\](https?|ftp|gopher|news|telnet|mms|rtsp)(.+?)\[\/url\]/gi,function($0,$1,$2){return(self.writelink($1+$2,$1+$2))});//[url]

c = c.replace(/\[(tid|pid)=?(\d{0,20})\](.+?)\[\/(tid|pid)\]/gi,function($0,$1,$2,$3,$4){
	if ($2)
		{return self.writelink('/read.php?'+$1+'='+$2,$3)}
	else
		{
		if ($1=='tid')
			var txt = '主题'
		else
			var txt = '回复'
		return self.writelink('/read.php?'+$1+'='+$3,txt+$3)}
	})

c = c.replace(/\[s:(\d{1,11})\]/gi,function($0,$1){ return("<img src='"+self.smiles[$1]+"' alt=''/>") } );//[smile]

c = c.replace(/(?:<br\s*\/?>)?\s*\[h\](.*?)\[\/h\]\s*(?:<br\s*\/?>)?/gi,function($0,$1){if($1){return "<h4>"+$1+"</h4>"}else{return "<h4 class='subtitle' style='line-height:0;font-size:0;padding:0;margin:0 0 3px 0;height:0'></h4>"}});//[h]
c = c.replace(/(?:<br\s*\/?>)?\s*(={3,100})\s*(<br\s*\/?>)?(.+?)(<br\s*\/?>)?\s*(={3,100})\s*(?:<br\s*\/?>)?/gi,
	function($0,$1,$2,$3,$4,$5){
		if ($2 || $4 || $3.match(/<br\s*\/?>/i)){
			if($2){
				if ($1.length>6)$1="<h4 class='subtitle'></h4>";
				$2='';
				}
			if ($4){
				if ($5.length>6)$5="<h4 class='subtitle'></h4>";
				$4='';
				}
			}
		else{
			if($3=='=')$3='';
			$1 = "<h4 class='subtitle'>";
			$5 = "</h4>";
			$2=$4='';
			}
		return $1+$2+$3+$4+$5});//[h]



c = c.replace(/(<br\s*\/?>)*\s*\[l(\d*)\]\s*(<br\s*\/?>)*\s*(.+?)\s*(<br\s*\/?>)*\s*\[\/l\]\s*(<br\s*\/?>)*/gi,function($0,$1,$2,$3,$4){if($2<=100){$2="style='width:"+($2-0.1)+"%'"}else{$2=''}return "<div "+$2+" class='left'>"+$4+"</div>"});//[left]
c = c.replace(/(<br\s*\/?>)*\s*\[r(\d*)\]\s*(<br\s*\/?>)*\s*(.+?)\s*(<br\s*\/?>)*\s*\[\/r\]\s*(<br\s*\/?>)*/gi,function($0,$1,$2,$3,$4){if($2<=100){$2="style='width:"+($2-0.1)+"%'"}else{$2=''}return "<div "+$2+" class='right'>"+$4+"</div>"});//[right]

c = c.replace(/p_w_upload/gi,"attachment");//[img]

c = c.replace(/\[crypt\](.+?)\[\/crypt\]/gi,"<div class='quote'><b>输入正确的密码以浏览加密的内容 </b><input type=text size=10><button type='button' onclick='ubbcode.decrypt(this.previousSibling,this.nextSibling,\""+argsId+"\")'>确认</button><div style='display:none'>$1</div></div>");//[url]


return c;
}

ubbcode.loadHeadLine = function (o,id){
if(!this.loadHeadLineElm || !this.loadHeadLineElm[id])return
var i,j,k,w,ww,td1,td2,tr,sel,col,cls,lt,ltr,clsr,height,tmp,x
height = 250;
w=o.parentNode
while(!w.offsetWidth && w!=document.body)w=w.parentNode
if(!w.offsetWidth)w.offsetWidth=930
if(this.loadHeadLineElm[id]._Img){
	if (w.offsetWidth>=1200){
		ww = '750px'
		w='33.3%'
		col=3
		}
	else if (w.offsetWidth>=930){
		ww = '500px'
		w='50%'
		col=2
		}
	else{
		ww = '250px'
		w='100%'
		col=1
		}
	}
else{
	if (w.offsetWidth>=1200){
		ww = '100%'
		w='20%'
		col=5
		}
	else if (w.offsetWidth>=930){
		ww = '100%'
		w='25%'
		col=4
		}
	else{
		ww = '100%'
		w='33.3%'
		col=3
		}
	}
td1 = _$('<td/>')._.css('width',ww)
td2 = _$('<td/>')._.css('height',height+'px')
sel = _$('<tr/>')
lt = _$('<tbody/>')
clsr='row1'
ltr = _$('<tr/>')._.cls(clsr)
i=j=k=0
for (var k=0;k<this.loadHeadLineElm[id].length;k++)
	{
	x = this.loadHeadLineElm[id][k]
	if (x.i){
		sel._.aC(_$('<td/>')._.sV({'i':x.i,'u':x.u.replace(/^.+?<\/span> /,'').replace(/<\/a> .+$/,'</a>')})._.on('mouseover',function (){
			var i,t,u,x
			i= this._.gV('i');t= this._.gV('t');u= this._.gV('u');
			x = this.parentNode._x
			x._.css('backgroundImage','url('+i+')')
			x = this.parentNode._xx
			x.innerHTML = u
			x=x.childNodes[0]
			x.style.height=(height-40)+'px'
			x.style.padding='15px'
			x = this.parentNode.getElementsByTagName('td')
			for (i=0;i<x.length;i++)
				x[i].style.backgroundColor='#000'
			this.style.backgroundColor='#f00'
			},1))
		i++
		}
	else{
		if(cls=='b1')cls='b2'
		else cls='b1'
		if (j==col)
			{
			if (clsr=='row1')clsr='row2'
			else clsr='row1'
			cls='b1'
			j=0
			lt._.aC(ltr)
			ltr = _$('<tr/>')._.cls(clsr)
			}
		tmp =  _$('<td/>')._.css('width',w)._.cls('headlineelm '+cls)
		tmp.innerHTML = x.u
		ltr._.aC( tmp )
		j++
		}
	}
tr = _$('<tr/>')._.aC(td1._.aC(_$('<div/>')._.cls('leftblock')._.css('height',height+'px')._.aC(_$('<table/>')._.aC(lt._.aC(ltr))) ))
if(i){
	x = _$('<div/>')._.cls('headlinemask6')
	tmp = _$('<div/>')._.css({'width':'100%','height':'100%'})._.aC( 
		_$('<div/>')._.cls('headlinemask')._.aC( 
			_$('<div/>')._.cls('headlinemask2')._.aC( 
				_$('<div/>')._.cls('headlinemask5')._.aC( 
					_$('<div/>')._.cls('headlinemask1')._.aC( 
						_$('<div/>')._.cls('headlinemask3')._.aC( 
							_$('<div/>')._.cls('headlinemask4')._.aC( 
								x
								)
							)
						)
					)
				)
			)
		)
	td2._.aC(_$('<div/>')._.cls('headlinebg')._.css({'width':'100%','height':((height-10)+'px')})._.aC(tmp))
	sel._x = tmp
	sel._xx = x
	i=100/i+'%'
	for (var k=0;k<sel.childNodes.length;k++)
		sel.childNodes[k].style.width=i
	td2._.aC(_$('<table/>')._.css('height','10px')._.cls('headlinesel')._.aC(_$('<tbody/>')._.aC(sel)))
	tmp = cookieFuncs.getCookie('lastvisit')
	if (!tmp || date.getTime()/1000-tmp>3600*5)
		sel.childNodes[0].onmouseover()
	else
		sel.childNodes[Math.floor(sel.childNodes.length*Math.random())].onmouseover()
	tr._.aC(td2)
	}
o.appendChild(_$('<table/>')._.cls('headline')._.aC(_$('<tbody/>')._.aC(tr)))
if (o.parentNode.id!='toppedtopic')return
o.parentNode.style.display='block'
o.parentNode.style.overflow='hidden'
o.parentNode.style.height='290px'
}//fe

ubbcode.decrypt=function (pI,cC,argsId){
var pass = pI.value
if (!pass)
	return window.alert('请输入密码')
var txt = this.crypt.rc4(pass,this.crypt.e(cC.innerHTML))
txt = txt.replace(/\n/g,'<br/>').replace(/\r/g,'').replace(/\[crypt\]/g,'')
cC=cC.parentNode
cC.style.display='none'
cC.innerHTML = txt
if(argsId && this.bbscodeConvArgsSave[argsId]){
	var arg = []
	for (var k in this.bbscodeConvArgsSave[argsId])
		arg.push(this.bbscodeConvArgsSave[argsId][k])
	arg[0]=cC
	this.bbscode.apply(this,arg);
	cC.style.display=''
	}
}//fe

ubbcode.writelink=function(u,n,h,frame)
{
u=u.replace(/http:\/\/([^\.]+)\.ngacn\.com/i,'http://$1.ngacn.cc')
var c = '';
var a = '';
var s = this.checklink(u);
if (!h)
	{
		if (u != n)
			{
				h = u;
			}
		else
			{
				h = '';
			}
	}
switch (s)
	{
		case 0:
			c = 'silver';
			break;
		case 1:
			c = 'silver';
			break;
		case 2:
			c = 'chocolate';
			break;
		case 3:
			c = 'red';
			break;
	}
if (h)
	{
		h = " onmouseover='this.childNodes[0].style.display=\"inline\"' onmouseout='this.childNodes[0].style.display=\"none\"'><span class='urltip "+c+"'>"+h+" </span>";
	}
else 
	{
		h = ">";
	}
if (s>1)
	{
		h = " onclick='this.previousSibling.style.display=\"inline\";return false' "+h;
		a = "<span class='urltip "+c+"' style='font-size:11px;padding:2px;text-align:center;line-height:15px' unselectable=on><div>"+u.replace(/http:\/\/([^\/]+)/i,"http://<b style='color:red'>$1</b>")+"</div><div> 此网页不属于本网站，不保证其安全性 </div><div> <a href='"+u+"' onclick='this.parentNode.parentNode.style.display=\"none\"' target='_blank'>继续访问</a> <a href='javascript:void(0)' onclick='this.parentNode.parentNode.style.display=\"none\"'>取消</a> <a href='"+u+"' "+(window.cookieFuncs ? "onclick='this.parentNode.parentNode.style.display=\"none\";cookieFuncs.setMiscCookieInSecond(\"ngabbsnochecklink\",1,1296000)' target='_blank'>不再提示我</a>" : '')+" </div></span>";
	}
return ("<span class='"+c+"'>[</span> "+a+"<a href='"+u+"' target='_blank' "+h+n+"</a> <span class='"+c+"'>]</span>");
}
//fe


ubbcode.checklink=function(u,nocookie,tbl)
{
if(!tbl)tbl=this.checkLinkTable
var c = false
if (window.cookieFuncs)c = cookieFuncs.getMiscCookie('ngabbsnochecklink')
if (!c || nocookie)
	{
	if (u.charAt(0)=='/')return 1;
	u = u.toLowerCase().match(/^http:\/\/([^\/]+)/);
	if (u && u[1])
		{
		u = u[1].split('.');
		var x = u[u.length-2]+'.'+u[u.length-1];
		if(tbl[x])
			if (tbl[x]=='add1')
				{
				if (u[u.length-3])
					x=u[u.length-3]+'.'+x
				if(tbl[x])return tbl[x]
				}
			else
				return tbl[x]
		}
	return 2;
	}
else
	return 0;
}
//fe

ubbcode.crypt = {
'key':{},
'genKey':function(k){
var s=[],i=0,j=0,x;
for (; i<256; i++)
	s[i] = i;
for (i=0; i<256; i++) {
	j = (j + s[i] + k.charCodeAt(i % k.length)) % 256;
	x = s[i];
	s[i] = s[j];
	s[j] = x;
	}
this.key[k] = s
},
/* RC4 symmetric cipher encryption/decryption
Copyright (c) 2006 by Ali Farhadi.
released under the terms of the Gnu Public License.

Email: ali[at]farhadi[dot]ir
Website: http://farhadi.ir/ */
'rc4':function (k, pt) {
	if(!this.key[k])
		this.genKey(k);
	var i=0,j=0,y=0,s=[],ct='',x;
	for (; i<256; i++)
		s[i] = this.key[k][i];
	for (i=0; y<pt.length; y++) {
		i = (i + 1) % 256;
		j = (j + s[i]) % 256;
		x = s[i];
		s[i] = s[j];
		s[j] = x;
		ct += String.fromCharCode(pt.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
	}
	return ct;
},
'cT':{
	'0':'~','1':'!','2':'#','3':'|','4':'^','5':'(','6':')','7':'=','8':'`','9':']','a':';','b':',','c':'?','d':':','e':'{','f':'}','A':';','B':',','C':'?','D':':','E':'{','F':'}'
	},
'eT':{
	'~':'0','!':'1','#':'2','|':'3','^':'4','(':'5',')':'6','=':'7','`':'8',']':'9',';':'a',',':'b','?':'c',':':'d','{':'e','}':'f'
	},
'c':function(t){
t = escape(t)
var cT =this.cT
t = t.replace(/(?:%u([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9]))/g,function ($0,$1,$2,$3,$4){
	return cT[$1]+cT[$2]+cT[$3]+cT[$4]
	})
return t
},//fe
'e':function (t){
if (t.match(/[^~!#\^()=`\];,\?:\{\}|A-Za-z0-9%]/)){
	window.alert('编码错误')
	return
	}
var eT =this.eT
t=t.replace(/([~!#\^()=`\];,\?:\{\}|])([~!#\^()=`\];,\?:\{\}|])([~!#\^()=`\];,\?:\{\}|])([~!#\^()=`\];,\?:\{\}|])/g,function ($0,$1,$2,$3,$4){
	return '%u'+eT[$1]+eT[$2]+eT[$3]+eT[$4]
	})
return unescape(t)
}//fe
}//ce

ubbcode.sc2reply_draw=function(r,thumbbase,oi,od,oa){
if (!oa)
	return
var h = '地图: <b>'+r.map+'</b><br/>';
if (r.time)
	{
	var ih = Math.floor(r.time/3600)
	var im = Math.floor((r.time-ih*3600)/60)
	var is = Math.floor(r.time-ih*3600-im*60)
	h+='时长: <b>'+ih+':'+im+':'+is+'</b><br/>'
	}
var c ,n;
n='';
for (var i in r.player )
	{
	if(typeof(r.player[i])!='object')continue
	if(!r.player[i]['id']){
		r.player[i]['id']=r.player[i][0]
		r.player[i]['race']=r.player[i][1]
		r.player[i]['color']=r.player[i][2]
		}
	c=''
	if (r.player[i]['color'])
		c = ' style="color:#'+r.player[i]['color']+'"'
	if (r.player[i]['id']){
		h+= '<b'+c+'>'+r.player[i]['id']+'</b> <span class=gray>('+r.player[i]['race']+')</span><br/>'
		n+= '_'+r.player[i]['id']+'_['+r.player[i]['race']+']'
		}
	}
if (r.thumb){
	oi.src=thumbbase+'/'+r.thumb
	oi.onerror=null
	}
else
	oi.style.display='none'
od.innerHTML = h+od.innerHTML
oa.href += '?filename='+r.map+n+'.sc2replay'
}//fe

ubbcode.attach_org_name=function(o,n){
if (o.nodeName!='A'){
	o=o.getElementsByTagName('a')
	if(!o[0])return
	o=o[0]
	}
o.innerHTML = decodeURIComponent(n)
o.href+='?filename='+n
}//fe

/*
bbscode提示
0元素为简要说明
1元素为详细说明
2元素为添加向导

添加向导的结构
{
	0:'请输入用户名',//参数1提示
	1:'请输入用户id',//参数2提示
	2:{'hint:'请输入用户组',//参数3提示
		'opts':{
			0:{0:'管理员',//参数3选项0名称
				1:'admin'//参数3选项0值
				},
			1:{0:'用户',//参数3选项1名称
				1:'user'//参数3选项1值
				},
			}//参数3选项
		}
	3:function(v){
		v[0] = '[username]'+v[0]+'[/username]' 参数数组v 参数ID对应提示的id
		v[1] = '[uid]'+v[1]+'[/uid]'
		v[2] = '[group]'+v[2]+'[/group]'
		return '[user]'+v[0]+v[1]+v[2]+'[/user]'
	}//参数数组处理函数 返回生成的bbscode 如返回false则视为参数错误中止
}
*/
ubbcode.codeHelpCommon = [
{0:'<b>[color]</b><br/><nobr>文字颜色</nobr>',1:"<b>文字颜色</b><br/><br/>	选中你希望加颜色的文字并使用下面的选择器选择颜色<br/>"},
{0:'<b>[size]</b><br/><nobr>文字大小</nobr>',1:"<b>文字大小</b><br/><br/>	选中你希望改变尺寸的文字并使用下面的选择器选择尺寸<br/>"},
{0:'<b>[font]</b><br/><nobr>文字字体</nobr>',1:"<b>文字字体</b><br/><br/>	选中你希望改变字体的文字并使用下面的选择器选择字体<br/>"},
{
	0:'<b>[b]</b><br/><nobr>粗体文字</nobr>',
	1:"<b>粗体文字</b><br/><br/>	[b]甲乙丙丁戊己庚辛[/b]<br/>",
	2:{
		0:{'hint':'请输入文字'},
		1:function(v){
			return '[b]'+v[0]+'[/b]'
		}
	}
},
{
	0:'<b>[u]</b><br/><nobr>下划线文字</nobr>',
	1:"<b>下划线文字</b><br/><br/>	[u]甲乙丙丁戊己庚辛[/u]<br/>",
	2:{
		0:{'hint':'请输入文字'},
		1:function(v){
			return '[u]'+v[0]+'[/u]'
		}
	}
},
{
	0:'<b>[i]</b><br/><nobr>斜体文字</nobr>',
	1:"<b>斜体文字</b><br/><br/>	[i]甲乙丙丁戊己庚辛[/i]<br/>",
	2:{
		0:{'hint':'请输入文字'},
		1:function(v){
			return '[i]'+v[0]+'[/i]'
		}
	}
},
{
	0:'<b>[del]</b><br/><nobr>删除线</nobr>',
	1:"<b>有删除线的文字</b><br/><br/>	[del]甲乙丙丁戊己庚辛[/del]<br/>",
	2:{
		0:{'hint':'请输入文字'},
		1:function(v){
			return '[del]'+v[0]+'[/del]'
		}
	}
},
{
	0:'<b>[align]</b><br/><nobr>左/中/右对齐</nobr>',
	1:"<b>左/中/右对齐文字</b><br/><br/>	[align=left]<br/>	甲乙丙丁戊己庚辛<br/>	左对齐文字<br/>	[/align]<br/><br/>	[align=center]<br/>	甲乙丙丁戊己庚辛<br/>	中对齐文字<br/>	[/align]<br/><br/>	[align=right]<br/>	甲乙丙丁戊己庚辛<br/>	右对齐文字<br/>	[/align]<br/>	",
	2:{
		0:{'hint':'请输入文字'},
		1:{
			'hint':'选择对齐方向',
			'opts':{
				0:{0:'左对齐',1:'left'},
				1:{0:'中对齐',1:'center'},
				2:{0:'右对齐',1:'right'}
				}
			},
		2:function(v){
			return '[align='+v[1]+']'+v[0]+'[/align]'
		}
	}
},
{
	0:'<b>[h]</b><br/><nobr>段落标题</nobr>',
	1:"<b>段落标题</b><br/><br/>	[h]甲乙丙丁戊己庚辛[/h]<br/><br/>	或使用三连等号亦可<br/><br/>	===甲乙丙丁戊己庚辛===<br/>	",
	2:{
		0:{'hint':'请输入标题文字'},
		1:function(v){
			return '==='+v[0]+'==='
		}
	}
},
{0:'<b>[l/r]</b><br/><nobr>左/右浮动</nobr>',1:"<b>段落左/右浮动</b><br/><br/>	[l]左浮动段落<br/>	甲乙丙丁戊己庚辛[/l]<br/><br/>	[r]右浮动段落<br/>	甲乙丙丁戊己庚辛[/r]<br/>	"},
{
	0:'<b>[list]</b><br/><nobr>列表条目</nobr>',
	1:"<b>列表条目</b><br/><br/>	[list]<br/>	[*]条目1<br/>	[*]条目2<br/>	[*]条目3<br/>	[*]条目4<br/>	[/list]<br/>	",
	2:{
		0:{'hint':'第1条'},
		1:{'hint':'第2条'},
		2:{'hint':'第3条'},
		3:{'hint':'第4条'},
		4:{'hint':'第5条'},
		5:{'hint':'第6条'},
		6:{'hint':'第7条'},
		7:{'hint':'第8条'},
		8:{'hint':'第9条'},
		9:{'hint':'第10条'},
		10:function(v){
			var x=''
			for (var i=0;i<v.length;i++)
				{
				if (v[i])
					x+='[*]'+v[i]+'\n'
				}
			return '[list]'+x+'[/list]'
		}
	}
},
{
	0:'<b>[img]</b><br/><nobr>插入图片</nobr>',
	1:"<b>插入图片</b><br/><br/>	[img]http://xxx.com/ooo.jpg[/img]<br/>	",
	2:{
		0:{'hint':'请输入图片地址'},
		1:function(v){
			return '[img]'+v[0]+'[/img]'
		}
	}
},
{
	0:'<b>[url]</b><br/><nobr>插入链接</nobr>',
	1:"<b>插入链接</b><br/><br/>	[url]http://xxx.com[/url]<br/><br/>	[url=http://xxx.com]点此链接[/url]<br/>	",
	2:{
		0:{'hint':'请输入链接地址'},
		1:{'hint':'请输入链接文字(可以不填)'},
		2:function(v){
			if (v[1])
				return '[url='+v[0]+']'+v[1]+'[/url]'
			else
				return '[url]'+v[0]+'[/url]'
		}
	}
},
{
	0:'<b>[quote]</b><br/><nobr>引用文字</nobr>',
	1:"<b>引用文字</b><br/><br/>	[quote]<br/>	引用文字<br/>	甲乙丙丁戊己庚辛<br/>	[/quote]<br/>	",
	2:{
		0:{'hint':'请输入引用文字'},
		1:function(v){
			return '[quote]'+v[0]+'[/quote]'
		}
	}
},
{0:'<b>[code]</b><br/><nobr>程序代码</nobr>',1:"<b>程序代码</b><br/><br/>	[code]\n\
	for (i=0; i<10; i++)\n\
	 &nbsp; {\n\
	 &nbsp; &nbsp; print('hello world')\n\
	 &nbsp; }\n\
	[/code]\n\
\n\
	支持以下语法高亮\n\
	[code=lua] …… [/code] lua\n\
	[code=php] …… [/code] php\n\
	[code=c] …… [/code] c\n\
	[code=js] …… [/code] javascript\n\
	[code=xml] …… [/code] xml/html\n\
"},
{
	0:'<b>[flash]</b><br/><nobr>插入flash(视频)</nobr>',
	1:"<b>插入flash(仅限于youtube.com/tudou.com/youku.com等站点)</b><br/><br/>	[flash]http://xxx.com/ooo.swf[/flash]<br/>",
	2:{
		0:{'hint':'请输入flash地址(仅限于youtube.com/tudou.com/youku.com等站点)'},
		1:function(v){
			return '[flash]'+v[0]+'[/flash]'
		}
	}
},
{0:'<b>[table]</b><br/><nobr>插入表格</nobr>',1:"<b>插入表格</b><br/><br/>[table]\n\
  [tr]\n\
  &nbsp; [td33]第一行第一列，宽度33%[/td]\n\
  &nbsp; [td25]第一行第二列，宽度25%[/td]\n\
  &nbsp; [td]第一行第三列，宽度自动[/td]\n\
  [/tr]\n\
  [tr]\n\
  &nbsp; [td]第二行第一列[/td]\n\
  &nbsp; [td]第二行第二列[/td]\n\
  &nbsp; [td]第二行第三列[/td]\n\
  [/tr]\n\
[/table]\n\
\n\
[table]\n\
  [tr]\n\
  &nbsp; [td]第一行第一列[/td]\n\
  &nbsp; [td]第一行第二列[/td]\n\
  &nbsp; [td]第一行第三列[/td]\n\
  [/tr]\n\
  [tr]\n\
  &nbsp; [td colspan2 width50]二行第一列和第二列合并 宽度50%[/td]\n\
  &nbsp; [td]第二行第三列[/td]\n\
  [/tr]\n\
  [tr]\n\
  &nbsp; [td colspan=3]第三行第一列和第二列第三列合并[/td]\n\
  [/tr]\n\
[/table]\n\
\n\
[table]\n\
  [tr]\n\
  &nbsp; [td rowspan=3]第一行和第二行第三行第一列合并[/td]\n\
  &nbsp; [td]第一行第二列[/td]\n\
  &nbsp; [td]第一行第三列[/td]\n\
  [/tr]\n\
  [tr]\n\
  &nbsp; [td]第二行第二列[/td]\n\
  &nbsp; [td]第二行第三列[/td]\n\
  [/tr]\n\
  [tr]\n\
  &nbsp; [td]第三行第二列[/td]\n\
  &nbsp; [td]第三行第三列[/td]\n\
  [/tr]\n\
[/table]"},
{
	0:'<b>[tid/pid]</b><br/><nobr>主题/回复</nobr>',
	1:"<b>插入到主题/回复的链接</b><br/><br/>	[tid]主题ID[/tid]<br/>	[tid=主题ID]甲乙丙丁[/tid]<br/>	[pid]回复ID[/pid]<br/>	[pid=回复ID]甲乙丙丁[/pid]<br/>	",
	2:{
		0:{'hint':'请输入ID'},
		1:{'hint':'请输入链接文字(可以不填)'},
		2:{
			'hint':'选择类型',
			'opts':{
				0:{0:'主题',1:'tid'},
				1:{0:'回复',1:'pid'}
				}
			},
		3:function(v){
			if (v[1])
				return '['+v[2]+'='+v[0]+']'+v[1]+'[/'+v[2]+']'
			else
				return '['+v[2]+']'+v[0]+'[/'+v[2]+']'
		}
	}
},
{0:'<b>[dice]</b><br/><nobr>投骰子</nobr>',1:"<b>投一个或多个骰子，并计算总和</b><br/>投骰结果使用随机数计算，以帖子ID和发帖人ID做为种子，故引用他人的投骰代码会得到不同结果<br/><br/>[dice]d100[/dice] 投一个100面的骰子 (1~100)<br/>[dice]2d6[/dice] 投两个6面的骰子 (2~12)<br/>[dice]2d4+2d6[/dice] 投两个4面的骰子和两个6面的骰子 (4~20)<br/><br/>骰子面数不能超过1000,一次最多投10个骰子<br/>"},
{
	0:'<b>[crypt]</b><br/><nobr>插入加密的内容</nobr>',
	1:"<b>请使用向导添加</b>",
	2:{
		0:{'hint':'请设置密码<br/><span style="font-weight:normal">(只有使用正确的密码才能浏览加密的内容<br/>发布人和一定权限以上者可以看到密码)</span>'},
		1:{'hint':'请输入要加密的内容','cols':30,'rows':20},
		2:function(v){
			if (v[0].length<5){
				window.alert('请使用更长的密码')
				return false
				}
			if (v[0].match(/[^0-9A-Za-z_]/)){
				window.alert('请使用大小写字母或数字做密码')
				return false
				}
			if(!v[1])return false
			if (postfunc && postfunc.addHiddenInfo)
				postfunc.addHiddenInfo('Password: '+v[0])
			return '[crypt]'+ubbcode.crypt.c(ubbcode.crypt.rc4(v[0],v[1]))+'[/crypt]'
		}
	}
}
];
if (__GP['lesser'])
	ubbcode.codeHelpCommon.push({
	0:'<b>[headline]</b><br/><nobr>插入头条</nobr>',
	1:"头条可以包含若干个头条链接(或文字)，数目不限，分为文字和图文两类，请参考以下例子\n\
头条图片高度250像素，宽度不限，图片右侧超出框架部分将不会显示\n\
\n\
&emsp;[headline]\n\
 &emsp; [url=http://www.null.com/null.html]这是一个头条图文链接[/url]\n\
 &emsp; [img]http://www.null.com/null.jpg[/img]\n\
&emsp;[/headline]\n\
\n\
&emsp;[headline]\n\
 &emsp; [tid=100000]这是一个到论坛主题id100000的头条图文链接[/tid]\n\
 &emsp; [img]http://www.null.com/null.jpg[/img]\n\
&emsp;[/headline]\n\
\n\
&emsp;[headline]\n\
 &emsp; [hltxt]这是一个只有文字的图文头条[/hltxt]\n\
 &emsp; [img]http://www.null.com/null.jpg[/img]\n\
&emsp;[/headline]\n\
\n\
&emsp;[headline]\n\
 &emsp; [url=http://www.null.com/null.html][b][color=red]这是一个红色粗体的文字头条链接[/color][/b][/url]\n\
&emsp;[/headline]\n\
\n\
&emsp;[headline]\n\
 &emsp; [tid=100000]这是一个到论坛主题id100000的文字头条链接[/tid]\n\
&emsp;[/headline]\n\
\n\
&emsp;[headline]\n\
 &emsp; [hltxt]这是一个没有链接的文字头条[/hltxt]\n\
&emsp;[/headline]\n\
",
	2:{
		0:{'hint':'添加一个头条<br/><br/>输入头条文字'},
		1:{'hint':'链接地址或主题ID<br/><span style="font-weight:normal">(可以不填)</span>'},
		2:'<b>文字的颜色</b><br/><select><option selected value="">默认</option>\
<option style="background-color: skyblue" value=skyblue>&nbsp; &nbsp; &nbsp; &nbsp;</option>\
<option style="background-color: royalblue" value=royalblue></option>\
<option style="background-color: blue" value=blue></option>\
<option style="background-color: darkblue" value=darkblue></option>\
<option style="background-color: orange" value=orange></option>\
<option style="background-color: orangered" value=orangered></option>\
<option style="background-color: crimson" value=crimson></option>\
<option style="background-color: red" value=red></option>\
<option style="background-color: firebrick" value=firebrick></option>\
<option style="background-color: darkred" value=darkred></option>\
<option style="background-color: green" value=green></option>\
<option style="background-color: limegreen" value=limegreen></option>\
<option style="background-color: seagreen" value=seagreen></option>\
<option style="background-color: teal" value=teal></option>\
<option style="background-color: deeppink" value=deeppink></option>\
<option style="background-color: tomato" value=tomato></option>\
<option style="background-color: coral" value=coral></option>\
<option style="background-color: purple" value=purple></option>\
<option style="background-color: indigo" value=indigo></option>\
<option style="background-color: burlywood" value=burlywood></option>\
<option style="background-color: sandybrown" value=sandybrown></option>\
<option style="background-color: sienna" value=sienna></option>\
<option style="background-color: chocolate" value=chocolate></option>\
<option style="background-color: silver" value=silver></option></select>',
		3:{
		'hint':'字体大小',
		'opts':{
			0:{0:'默认',1:''},
			1:{0:'110%',1:'110%'},
			2:{0:'120%',1:'120%'},
			3:{0:'130%',1:'130%'},
			4:{0:'140%',1:'140%'},
			5:{0:'150%',1:'150%'}
			}
		},
		4:{
		'hint':'字体样式',
		'opts':{
			0:{0:'默认',1:''},
			1:{0:'粗体',1:'b'},
			2:{0:'斜体',1:'i'}
			}
		},
		5:{'hint':'头条图片地址<br/><span style="font-weight:normal">(可以不填，图片高度为250像素，宽度不限，图片右侧超出框架部分将不会显示)</span>'},
		6:function(v){
			var x = '';
			if(!v[0]){
				if(v[1])v[0]=v[1]
				else return
				}
			if(v[2])v[0] = '[color='+v[2]+']'+v[0]+'[/color]'
			if(v[3])v[0] = '[size='+v[3]+']'+v[0]+'[/size]'
			if(v[4]=='b')v[0] = '[b]'+v[0]+'[/b]'
			if(v[4]=='i')v[0] = '[i]'+v[0]+'[/i]'
			if(v[1]){
				if(parseInt(v[1]))
					v[0]='[tid='+v[1]+']'+v[0]+'[/tid]'
				else
					v[0]='[url='+v[1]+']'+v[0]+'[/url]'
				}
			else
				v[0]='[hltxt]'+v[0]+'[/hltxt]'
			if(v[5])v[0]+='\n[img]'+v[5]+'[/img]'
			return '[headline]\n'+v[0]+'\n[/headline]\n'
			}
	}
})