//读取COOKIE
function GetCookieData(sL)
{
    var sRet="";
    var sC=""+document.cookie;
    if(sC.length>0)
    {
        var aC=sC.split(";",100);
        var iC=aC.length;
        for(var i=0;i<iC;i++)
        {
            if(aC[i].indexOf(sL+"=")!=-1)
            {
                var aRet=aC[i].split("=");
                sRet=unescape(aRet[1]);
                break;
            }
        }
    }
    return sRet;
}

		function Submit_onclick()
        {
	       if(window.top.document.getElementById("myFrame").cols=="462,14,*")
	        {
		       window.top.document.getElementById("myFrame").cols="0%,14,*";
		       window.top.midFrame.document.getElementById("ImgArrow").src="images_001/al.jpg";
	        }
			else
			{
				window.top.document.getElementById("myFrame").cols="462,14,*"
				window.top.midFrame.document.getElementById("ImgArrow").src="images_001/ar.jpg";
			}
       }
       function MyLoad() 
       {
			if(self.location.href.indexOf("20")>0)
			{
				window.top.document.getElementById("myFrame").cols="20%,12,*"; 
				window.top.midFrame.document.getElementById("ImgArrow").src="/images_001/al.jpg";
			}
		}

//跳转页面显示
function ShowPage(TotalPage,PageIndex,url){
document.write("<table cellspacing=1 cellPadding=2 bgcolor=#E1E1E1><tr class=a3><td bgcolor='#F2f2f2' style='padding:0px 4px 0px 4px'><b>"+PageIndex+"/"+TotalPage+"</b></td>");
if (PageIndex<6){PageLong=11-PageIndex;}
else
if (TotalPage-PageIndex<6){PageLong=10-(TotalPage-PageIndex)}
else{PageLong=5;}
for (var i=1; i <= TotalPage; i++) {
if (i < PageIndex+PageLong && i > PageIndex-PageLong || i==1 || i==TotalPage){
if (PageIndex==i){document.write("<td bgcolor=#ffffff>&nbsp;<b>"+ i +"</b>&nbsp;</td>");}else{document.write("<td bgcolor=#ffffff onclick='window.location.href(\"?PageIndex="+i+"&"+url+"\")' style=cursor:pointer>&nbsp;"+ i +"&nbsp;</td>");}
}
}
document.write("<td class=a4 style='padding:1px 4px 1px 4px' bgcolor='#F2f2f2'><input onkeydown=if((event.keyCode==13)&&(this.value!=''))window.location='?PageIndex='+this.value+'&"+url+"'; onkeyup=if(isNaN(this.value))this.value='' style='border:1px solid #698cc3;height:13px;' size=2></td></tr></table>");
}

//全选复选框
function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.name != 'chkall')e.checked = form.chkall.checked;}}

//全选主题ID复选框
function ThreadIDCheckAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name == 'ThreadID')e.checked = form.chkall.checked;
}
}
//全选主题ID复选框
function CheckedAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name == 'list')e.checked = form.chkall.checked;
}
}
//自定义类别
function ChangeCategory()
{
	CategoryName=prompt("请输入类别名称(最多20个字符):","");
	if(!CategoryName) return;
	if(CategoryName.length > 20){alert("类别名称不能大于20个字符！");return false;}
	this.focus();
	i=document.form.Category.length;
	document.form.Category.options[i]=new Option(CategoryName,CategoryName);
	document.form.Category.options[i].selected=true;
}




// add area script
function focusEdit(editBox)
{
 if ( editBox.value == editBox.Helptext )
 {
 editBox.value = '';
 editBox.className = 'editbox';
 }
 return true;
}
function blurEdit(editBox)
{
 if ( editBox.value.length == 0 )
 {
 editBox.className = 'editbox Graytitle';
 editBox.value = editBox.Helptext;
 }
}
function ValidateTextboxAdd(box, button)
{
 var buttonCtrl = document.getElementById( button );
 if ( buttonCtrl != null )
 {
 if (box.value == "" || box.value == box.Helptext)
 {
 buttonCtrl.disabled = true;
 }
 else
 {
 buttonCtrl.disabled = false;
 }
 }
}
// add area script end


function loadtree(ino){
frames["hiddenframe"].location.replace("ForumTree.asp?id="+ino+"")
}

function loadThreadFollow(ino,Online){
var targetImg =document.getElementById("followImg" + ino);
var targetDiv =document.getElementById("follow" + ino);
if (targetDiv.style.display!='block'){
if(targetImg.loaded=="no"){frames["hiddenframe"].location.replace("loading.asp?id="+ino+"&ForumID="+Online+"");}
targetDiv.style.display="block";
targetImg.src="images/minus.gif";
}else{
targetDiv.style.display="none";
targetImg.src="images/plus.gif";
}
}

function ToggleMenuOnOff (menuName) {
    var menu = document.getElementById(menuName);
    if (menu.style.display == 'none') {
      menu.style.display = 'block';
    } else {
      menu.style.display = 'none';
    }
}

function OpenWindow (target) { 
  window.open(target, "_Child", "toolbar=no,scrollbars=yes,resizable=yes,width=400,height=400"); 
}
function OpenFriendWindows (target,width,height) { 
  window.open(target, "Friend", "resizable=yes,resizable=yes,width="+width+",height="+height+""); 
}
function OpenFriendWindow (target) { 
  window.open(target, "Friend", "resizable=yes,resizable=yes,width=320,height=160"); 
}
function OpenFriendWindow2 (target) { 
  window.open(target, "open", "resizable=yes,resizable=yes,width=320,height=190"); 
}

function OpenWindow3 (target) { 
  window.open(target, "open2", "toolbar=no,scrollbars=yes,resizable=yes,width=340,height=400"); 
}

function log_out()
{
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('你确定要退出？'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}
function log_outs()
{
	
	if (confirm('你确定要退出？'))
	{
		return true;
	}
	else
	{
		
		return false;
	}
}
function guest_del()
{
	
	if (confirm('你确定要删除？'))
	{
		return true;
	}
	else
	{
		
		return false;
	}
}
function guest_stop()
{
	
	alert('请先停用！');
}

function ShowError(sitename,message){
document.writeln("<style type=\"text\/css\">body {margin:20px 10px 10px 6px;}<\/style>");	
document.writeln("<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"480\" bgcolor=#E6F8F8 style=\"border:1px solid #e1e1e1;padding-bottom:5px;padding-top:8px;\">");
document.writeln("<tr align=\"center\"><td width=\"100%\" ><b><font style=font-size:12px; color=#33A499>错误信息</font><\/b><\/td><\/tr>");
document.writeln("<tr align=\"center\"><td width=\"100%\" style=\"padding:0px;height:1px;\"><img src=\"\" height=1 width=460 style=\"background:#e1e1e1\"><br><img src=\"\" height=1 width=460 style=\"background:#ffffff\"><\/td><\/tr>");
document.writeln("<tr><td width=\"100%\" style=\"padding:5px 8px 8px 8px;font-size:12px;color:#666666\" height=80 valign=top>"+message+"<\/td><\/tr>");
document.writeln("<\/table>");
}

function Succ(sitename,message){
	
document.writeln("<style type=\"text\/css\">body {margin:20px 10px 10px 6px;}a:link{FONT:normal 12px Tahoma, Arial, Helvetica, Sans-Serif;text-decoration:underline;color:#999999}a:visited{FONT:normal 12px Tahoma, Arial, Helvetica, Sans-Serif;text-decoration:underline;color:#999999}a:active{FONT:normal 12px Tahoma, Arial, Helvetica, Sans-Serif;TEXT-DECORATION:underline;color:#999999}a:hover{FONT:normal 12px Tahoma, Arial, Helvetica, Sans-Serif;COLOR: #999999; TEXT-DECORATION: none}<\/style>");	
document.writeln("<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"480\" bgcolor=#E6F8F8 style=\"border:1px solid #e1e1e1;padding-bottom:5px;padding-top:8px;\">");
document.writeln("<tr align=\"center\"><td width=\"100%\" ><b><font style=font-size:12px; color=#33A499>操作成功</font><\/b><\/td><\/tr>");
document.writeln("<tr align=\"center\"><td width=\"100%\" style=\"padding:0px;height:1px;\"><img src=\"\" height=1 width=460 style=\"background:#e1e1e1\"><br><img src=\"\" height=1 width=460 style=\"background:#ffffff\"><\/td><\/tr>");
document.writeln("<tr><td width=\"100%\" style=\"padding:10px 8px 12px 8px;font-size:12px;color:#666666;\" height=80 valign=top><b><span id=\"count\">3<\/span><a href=\"javascript:countDown\"><\/a>秒钟后系统将自动返回...<\/b><br>"+message+"<\/td><\/tr>");
document.writeln("<\/table>");
countDown(3);
}


function countDown(secs)
{
count.innerText=secs;if(--secs>0)setTimeout("countDown("+secs+")",1000);
}

function showdz(sID)
{
whichEl = eval("dz" + sID);
if (whichEl.style.display == "none")
{
eval("dz" + sID + ".style.display=\"\";");
}
else
{
eval("dz" + sID + ".style.display=\"none\";");
}
}

function setFontSize(n)
{
	var elements = document.getElementsByTagName('span');
	for (var i=0; i<elements.length; i++)
	{
		var element = elements[i];
		if (element.getAttribute('name') != 'content') continue;
		element.style.fontSize   = n + 'px';
		element.style.lineHeight = (8 + n) + 'px';
	}
}