/*
junminliu@msn.com
QQ:9619774
*/

function insertHtml(HtmlCode)
{
//alert(window.content_html.idEditbox.document.selection.createRange().text)
//window.content_html.idEditbox.document.body.insertAdjacentHTML("BeforeEnd","marqueehehe")
var win=window.content_html.idEditbox.document;
window.content_html.idEditbox.focus();
win.selection.createRange().pasteHTML(HtmlCode)
}
function ResetHtml()
{
var win=window.content_html.idEditbox.document;
window.content_html.idEditbox.focus();
win.body.innerHTML='<div></div>'
}
function button_gl(text,url,img)
{
if (!img) img=""
else
img="<img src=images/"+img+" border=0 align=absbottom> ";
document.write("<TABLE border=0 height=24 cellspacing=0 cellpadding=0 style=\"cursor: hand;\" onclick="+url+">");
document.write("<TR>");
document.write("<TD><IMG SRC=images/botton001.gif WIDTH=2 HEIGHT=24 BORDER=0 ></TD>");
document.write("<TD background=images/botton002.gif style=\"border-top:1pt solid #8596CA;border-bottom:1pt solid #5A6DA5;padding-top=0;padding-left=8;padding-right=7;\" align=center>"+img+"<font color=5A6CA2>"+text+"</font></TD>");
document.write("<TD><IMG SRC=images/botton003.gif WIDTH=2 HEIGHT=24 BORDER=0></TD>");
document.write("</TR>");
document.write("</TABLE>");
}
function button_gl_gray(text,img)
{
if (!img) img=""
else
img="<img src=images/"+img+" border=0 align=absbottom> ";
document.write("<TABLE border=0 height=24 cellspacing=0 cellpadding=0 style=\"cursor: wait;\">");
document.write("<TR>");
document.write("<TD><IMG SRC=images/botton001.gif WIDTH=2 HEIGHT=24 BORDER=0 ></TD>");
document.write("<TD background='images/botton002.gif' style=\"border-top:1pt solid #8596CA;border-bottom:1pt solid #5A6DA5;padding-top=0;padding-left=8;padding-right=7;\" align=center><table cellspacing=0 cellpadding=0 border=0><tr><td style=\"filter:dropshadow(color=#FFFFFF,offx=1,offy=1);color:#A0B0C9;\">"+img);
document.write(text+"</td></tr></table></TD>");
document.write("<TD><IMG SRC=images/botton003.gif WIDTH=2 HEIGHT=24 BORDER=0></TD>");
document.write("</TR>");
document.write("</TABLE>");
}
function del(theselect) {
var id = theselect.selectedIndex
if (id != -1) {
for (i = id ; i < theselect.length -1 ; i++) {
// For Netscape, you can use theselect.options[i] = theselect.options[i+1]
optext = theselect.options[i+1].text
opvalue = theselect.options[i+1].value
opdefault = theselect.options[i+1].defaultSelected
opselected = theselect.options[i+1].selected
theselect.options[i] = new Option(optext, opvalue, opdefault, opselected)
}
theselect.length --
}
}
function attachment_sel(theselect)
{
	var att;
	if (theselect.length>0)
	{
		att = theselect.options[0].text + "**" + theselect.options[0].value
		for (i = 1 ; i < theselect.length ; i++)
		{
			att += "??"+theselect.options[i].text+"**"+theselect.options[i].value
		}
		return (att)
	}
		return null
}
function change_gray(obj,text,url,img)
{
var showcontent;
if (!img) img=""
else
img="<img src=images/"+img+" border=0 align=absbottom> ";
showcontent="<TABLE border=0 height=24 cellspacing=0 cellpadding=0 style=\"cursor: wait;\">";
showcontent+="<TR>";
showcontent+="<TD><IMG SRC=images/botton001.gif WIDTH=2 HEIGHT=24 BORDER=0 ></TD>";
showcontent+="<TD background=images/botton002.gif style=\"border-top:1pt solid #8596CA;border-bottom:1pt solid #5A6DA5;padding-top=0;padding-left=8;padding-right=7;\" align=center><table cellspacing=0 cellpadding=0 border=0><tr><td style=\"filter:dropshadow(color=#FFFFFF,offx=1,offy=1);color:#A0B0C9;\">"+img+""+text+"</td></tr></table></TD>";
showcontent+="<TD><IMG SRC=images/botton003.gif WIDTH=2 HEIGHT=24 BORDER=0></TD>";
showcontent+="</TR>";
showcontent+="</TABLE>";
show.innerHTML=showcontent;
}
function change(obj,text,url,img)
{
var showcontent;
if (!img) img=""
else
img="<img src=images/"+img+" border=0 align=absbottom> ";
showcontent="<TABLE border=0 height=24 cellspacing=0 cellpadding=0 style=\"cursor: hand;\" onclick="+url+">";
showcontent+="<TR>";
showcontent+="<TD><IMG SRC=images/botton001.gif WIDTH=2 HEIGHT=24 BORDER=0 ></TD>";
showcontent+="<TD background=images/botton002.gif style=\"border-top:1pt solid #8596CA;border-bottom:1pt solid #5A6DA5;padding-top=0;padding-left=8;padding-right=7;\" align=center>"+img+"<font color=5A6CA2>"+text+"</font></TD>";
showcontent+="<TD><IMG SRC=images/botton003.gif WIDTH=2 HEIGHT=24 BORDER=0></TD>";
showcontent+="</TR>";
showcontent+="</TABLE>";
show.innerHTML=showcontent;
}
function add(theselect,text,value) {
theselect.options[theselect.length] = new Option(text , value);
}
function addline()
{
		document.write("<TABLE border=0 width=\"100%\" height=\"2\" cellspacing=0 cellpadding=0><TR><TD WIDTH=\"204\"><IMG SRC=\"images/line_left.gif\" BORDER=0 width=\"204\" height=\"2\"></TD><TD background=\"images/line_middle.gif\"><IMG SRC=\"images/line_middle.gif\" BORDER=0 width=\"1\" height=\"2\"></TD><TD WIDTH=\"209\"><IMG SRC=\"images/line_right.gif\" BORDER=0 width=\"209\" height=\"2\"></TD></TR></TABLE>");
}
function boxradio(ii,text,cid)
{
	var i;
	var  e  =  document.all.ArticleClass[ii].parentElement.parentElement; 
	for(i=0;i<document.all.ArticleClass.length;i++)
	{
		if(i!=ii)
		{
			document.all.ArticleClass[i].parentElement.parentElement.style.backgroundColor='';
			document.all.ArticleClass[i].checked = false;
		}
		else
		{
			if  (document.all.ArticleClass[ii].checked) 
			{
				e.style.backgroundColor='#ADC6DF';
				change('show','当前类别——'+text,'SelArticleType()');
				document.form1.ArticleClassID.value=cid;
			}

			else 
			{
				e.style.backgroundColor='';
				change('show','请选择文章类别','SelArticleType()');
				document.form1.ArticleClassID.value='';
			}
		}
	}
}

function boxradio1(ii,text,cid)
{
	var i;
	var  e  =  document.all.NewsClass[ii].parentElement.parentElement; 
	for(i=0;i<document.all.NewsClass.length;i++)
	{
		if(i!=ii)
		{
			document.all.NewsClass[i].parentElement.parentElement.style.backgroundColor='';
			document.all.NewsClass[i].checked = false;
		}
		else
		{
			if  (document.all.NewsClass[ii].checked) 
			{
				e.style.backgroundColor='#ADC6DF';
				change('show','当前类别——'+text,'SelNewsType()');
				document.form1.NewsClassID.value=cid;
			}

			else 
			{
				e.style.backgroundColor='';
				change('show','请选择新闻类别','SelNewsType()');
				document.form1.NewsClassID.value='';
			}
		}
	}
}


function  CheckAll(boxname,selname)
{
	var i;
	for(i=0;i<document.all.boxname.length;i++)
	{
		if (document.all.selname.checked)
		{
			document.all.boxname[i].checked = true;
		}
		else
		{
			document.all.boxname[i].checked = false;
		}

	}
}
function SelArticleType()
{
	SelectArticleType.style.display='';
	if (document.form1.Title.size==60)
	{
		document.form1.Title.size-=4;
		document.form1.Original.size-=4;
	}
}
function HidArticleType()
{
	SelectArticleType.style.display='none';
	document.form1.Title.size+=4;
	document.form1.Original.size+=4;
}
function SelNewsType()
{
	SelectNewsType.style.display='';
	if (document.form1.Title.size==60)
	{
		document.form1.Title.size-=4;
		document.form1.Subhead.size-=4;
		document.form1.Original.size-=4;
	}
}
function HidNewsType()
{
	SelectNewsType.style.display='none';
	if (document.form1.Title.size==56)
	{
	document.form1.Title.size+=4;
	document.form1.Subhead.size+=4;
	document.form1.Original.size+=4;
	}
}
function HidCC()
{
	hid.style.display='none';
	change('show','显示列表(<U>S</U>)<FONT face="webdings">4</FONT>&nbsp;','ShowCC()');
}
function ShowCC()
{
	hid.style.display='';
	change('show','<FONT face="webdings">3</FONT>隐藏列表信息(<U>H</U>)&nbsp;','HidCC()');
}
function HidAT()
{
	hid.style.display='none';
	change('show','显示文章类别(<U>F</U>)<FONT face="webdings">4</FONT>&nbsp;','ShowAT()');
}
function ShowAT()
{
	hid.style.display='';
	change('show','<FONT face="webdings">3</FONT>隐藏文章类别(<U>F</U>)&nbsp;','HidAT()');
}

//显示隐藏的标题
function ShowHid(obj)
{
	if(obj.parentElement.scrollWidth>obj.parentElement.clientWidth) 
		obj.className='showtitle'
}
//显示隐藏的标题


//隐藏显示的标题
function HidShow(obj)
{
	if(obj.parentElement.scrollWidth>obj.parentElement.clientWidth) 
		obj.className=''
}
//隐藏显示的标题