﻿function input_shuzi(obj){obj.value=obj.value.replace(/[^\d]/g,'');}//if(obj.value == 0 || obj.value > 12){obj.value = "";}
function input_shuzi_before(){clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''));}
function clearNoNum(obj){
	obj.value = obj.value.replace(/[^\d.]/g,"");
	obj.value = obj.value.replace(/^\./g,"");
	obj.value = obj.value.replace(/\.{2,}/g,".");
	obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
}
//----------------------------------------------------------------------
function fucCheckLength(strTemp){
	var i,sum;
	sum=0;
	for(i=0;i<strTemp.length;i++)
	{
		if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
			sum=sum+1;
		else
			sum=sum+2;
	}
	return sum;
}
function showLen(obj, id, muns){//<font color=#ffffff>—————</font><font color=#999999>
	var nr = "<font color=#999999>最多允许输入"+muns+"个字符折合"+(muns/2)+"个汉字，你已经输入了<font color=#ff0000>"+fucCheckLength(obj.value)+"</font>个字符</font>"
	document.getElementById(id).innerHTML = nr;
}
//-------------------------------------------------------- back
function ConfirmDel(){
if (confirm("你真的要删除此文件吗!"))
	return true;
else
	return false;
}

function dbbeifen(ids) {
	if (document.getElementById("lb").value==""){
		alert("对不起，你没有选择操作类别")
		return false;
	}
	var textsss = document.getElementById("lb").options[document.getElementById("lb").selectedIndex];
	document.getElementById(ids).innerHTML = "&nbsp;&nbsp;<font color=#ff0000><b>正在执行"+textsss.text+"，请稍候...</b></font>";
	showshget('shsd', 'back1|'+ids+'|'+document.getElementById("lb").value+'|'+document.getElementById("sm").value)
}
//---------------------------------------------------------------------- 删除
function dele(urls,msg){
if (confirm(msg)) 
window.location.href = urls;
}
//----------------------------------------------------------------------
function paixujc() {//排序
	if (document.MyForm.tiaoshu.value==""){
		alert("请输入参与排序队列的最大条数！")
		document.MyForm.tiaoshu.focus()
		return false;
	}
}
//----------------------------------------------------------------------
var xunr;
var xui;
function paixujcshuzi(form) {//排序序号检测
	xunr = ","; xui = 0;
	for(var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if(e.name.indexOf("xu") != -1){
			if(e.value != ""){
				if(xunr.indexOf(","+e.value+",") != -1){
					alert("序号"+e.value+"重复"); return false;break;
				}else{
					xunr += e.value + ","; xui++;
				}
			}
		}
	}

	for(var i=1;i<=xui;i++){
		if(xunr.indexOf(","+i+",") == -1){
			alert("序号不连续，缺少序号"+i); return false;break;
		}
	}
	form.submit();
//alert(xui+"\r\n"+xunr);
}
//---------------------------------------------------------------------- 

function getqxstr(form,zdname){
	var target = document.getElementById("kj").contentWindow.document.getElementById('FRM4').contentWindow;
	var nrcat = ",";
	for (var i=0;i<form.elements.length;i++) {
		var e = form.elements[i];
		if (e.checked == true){
			if(e.name == zdname){nrcat += e.value + ",";}
		}
	}
	if (nrcat == ","){
		alert("对不起，你没有选择任何权限！")
		return false;
	}
	//alert(nrcat)
	if(zdname == "bkxz"){
		target.document.getElementById("mlqx").value=nrcat;
	}else if(zdname == "ckxz"){
		target.document.getElementById("ckqx").value=nrcat;
	}else if(zdname == "czxz"){
		target.document.getElementById("qx").value=nrcat;
	}
	CloseMsg();
}
//----------------------------------------------------------------------
//var gdtyinc = false;
function showshget(id, xxx){window.document[id].asFunc(xxx);}
function showshstr(id, xxx){
	if(xxx.indexOf("|height|px") != -1){
		//xxx = xxx.replace(/\|height\|/g, (windowHeight-90));}//全部替换
		xxx = xxx.replace("|height|", (windowHeight-90));//替换第一个
		document.getElementById(id).innerHTML = xxx;
	}else if(xxx == "|hftzdlgj|"){
		document.getElementById(ldids).innerHTML = "";
		alert("对不起，你没有登录，必须先登录！"); return loginsd();
	}else if(xxx == "|hftznrgj|"){
		alert("对不起，你没有填写回复内容！");return document.getElementById(ldids).innerHTML = "";
	}else if(xxx == "|delztgj|"){
		alert("文章已删除！");window.close();
	}else if(id == "zthfnr"){
		var xinxi = xxx.split("|-*-|");
		if(xinxi[1] == "hf"){
			document.getElementById(ldids).innerHTML = "";
			if ( document.getElementById( Qhhtml ).style.display == 'none' ){
				var oEditor = FCKeditorAPI.GetInstance( DataFCKeditor ) ;
				oEditor.Commands.GetCommand( 'NewPage' ).Execute() ;
			}else{
				document.getElementById( DataTextarea ).value = "";
			}
		}
		document.getElementById(id).innerHTML = xinxi[0];
		document.getElementById("tbleft").style.height = document.getElementById("tbright").style.height = document.getElementById("content1").style.height;
		wlxsd();
		//location.reload();
	}else if(xxx.indexOf("glerror") != -1){
		xinxi = xxx.split("|*|")
		alert(xinxi[1]); return false;
	}else if(id == "loginout"){//conn
		loginoks();
	}else if(id == "listnr"){//conn
		document.getElementById(id).innerHTML = xxx; wlxsd();
	}else{
		if(document.getElementById(id)) {document.getElementById(id).innerHTML = xxx;}
		if(id.indexOf("show") != -1){wlxsd();}
	}
}

//---------------------------------------------------------------------- 目录树
function list(id,l,urlss,jb,ul,flurl,lastml,preml,pagefile,yuliu){//yuliu为预留字段，以后备用
	var ids = "ll" + id;
	var imgid = "pic" + id;
	var pic1 = "nofollow.gif";
	var pic2 = "plus.gif";
	if(yuliu == "leibie"){pic1 = "nofollow1.gif"; pic2 = "plus1.gif";}
	if(document.getElementById(ids).style.display == 'none'){
		document.getElementById(imgid).src = ul+'images/'+pic1;
		document.getElementById(ids).style.display='block';
	}else if(document.getElementById(ids).style.display == 'block'){
		document.getElementById(imgid).src = ul+'images/'+pic2;
		document.getElementById(ids).style.display='none';
	}
	if(document.getElementById(ids).innerHTML == ""){
		var LLS = "";
		var LL;
		if(lastml == "last"){LL = preml + "L1"}else{LL = preml + "L0"}
		LLS = LL.replace(/L1/g,"<IMG SRC="+ul+"images/tree_line1.gif align=absMiddle BORDER=0>");
		LLS = LLS.replace(/L0/g,"<IMG SRC="+ul+"images/tree_line.gif align=absMiddle BORDER=0>");
		document.getElementById(ids).innerHTML = LLS + "&nbsp;&nbsp;<IMG SRC='"+ul+"images/loading.gif' align=absMiddle BORDER=0><font color=#009900>loading......</font>";
		showshget('shsd',urlss+'|'+ids+'|'+id+'|'+l+'|'+jb+'|'+ul+'|'+flurl+'|'+lastml+'|'+preml+'|'+pagefile);
	}
}
//----------------------------------------------------------------------
function deleted(id,xxx){
	if (confirm("你真的要删除这条信息吗?")) 
	showshget(id, xxx);
}

//-----------------------------------------
function yuedustr(urlss,id,rmlid){showshget('shsd',urlss+'||'+id+'|'+rmlid);}
//======================================================================================= 
var upxinxi;
var prveupid;
function upshow(id, l, t, fw, fh, fl, xinxi){
	upxinxi = xinxi;
	if(prveupid != "" && prveupid != null && document.getElementById(prveupid)){document.getElementById(prveupid).innerHTML = '';}
	document.getElementById(id).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+fw+"' height='"+fh+"' id='upflsd' style='position: absolute; margin: "+t+"px "+l+"px; z-index:3000;'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='"+fl+".swf' /><param name='quality' value='high' /><embed src='"+fl+".swf' quality='high' width='"+fw+"' height='"+fh+"' name='upflsd' allowscriptaccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";//<PARAM name='wmode' value='transparent' />   wmode='transparent'
	prveupid = id;
}
function uploadshow() {window.document["upflsd"].asFunc(upxinxi);}
function uploadclose(id) {document.getElementById(id).innerHTML = '';}
function uploadstrd(id, nr){
	if(id.indexOf("txtid") != -1){
		document.getElementById(id).innerHTML = nr;
	}else if(id == "imgid"){
		document.getElementById(id).innerHTML = "<img src='"+nr+"' width=100 height=79 border=0>";
	}
}
//---------------------------------- oa删除文件
function deloafj(id,xxx){
	if (confirm("你真的要删除吗?")) 
	showshget(id, xxx);
}
//==========================================================================================================
var mubiaoid;
function PossCode(cat_id,bumennm){
	var target = document.getElementById("kj").contentWindow.document.getElementById('FRM4').contentWindow;
	target.document.getElementById(mubiaoid+"id").value=cat_id;
	target.document.getElementById(mubiaoid+"nm").value=bumennm;
	CloseMsg();
}
function PossCode1(cat_id,bumennm){
	document.getElementById(mubiaoid+"id").value=cat_id;
	document.getElementById(mubiaoid+"nm").value=bumennm;
	CloseMsg();
}
//-----------------------------------------
function getbumen(w, h, title, urlss, jb, mbid, imgurl, flurl, pagefile){
	mubiaoid = mbid;
	AlertMsg(w, h, title, imgurl, 51);
	document.getElementById("msgbody").innerHTML = "<br><br><br><div align=center><IMG SRC='"+imgurl+"images/loading.gif' align=absMiddle BORDER=0><font color=#009900>loading......</font></div>";
	showshget('shsd',urlss+'|msgbody|'+jb+'|'+imgurl+'|'+flurl+'|'+pagefile);
}
//pagefile说明：ncxxh_wdzx_bei\sm.txt
//-----------------------------------------
function getfilenr(w,h,title,id,rmlid){
	AlertMsg(w, h, title, "", 51);
	yuedustr("list/list_file_yuedu",id,rmlid);
	var strs = document.getElementById("kj").contentWindow.document.getElementById('FRM4').contentWindow.document.getElementById("nrxx"+id).value;
	document.getElementById("msgbody").innerHTML = strs;
}
//-----------------------------------------
function getshow(w,h,title,id,rmlid,urlss){
	AlertMsg(w, h, title, "", 1);
	document.getElementById("msgbody").innerHTML = "<br><br><br><div align=center><IMG SRC='images/loading.gif' align=absMiddle BORDER=0><font color=#009900>loading......</font></div>";
	showshget('shsd',urlss+'|msgbody|'+id+'|'+rmlid);
}
//-----------------------------------------
function glmenu(w,h,title,imgurl,urlss){
	AlertMsg(w, h, title, imgurl, 51);
	if(h == 0){h = windowHeight}
	document.getElementById("msgbody").innerHTML = "<br><br><br><div align=center><IMG SRC='"+imgurl+"images/loading.gif' align=absMiddle BORDER=0><font color=#009900>loading......</font></div>";
	document.getElementById("msgbody").innerHTML = "<div align=center><iframe name='ifrmid' id='ifrmid' frameborder=0 scrolling=auto width='"+(w-50)+"' height='"+(h-50)+"' src='"+urlss+"'></iframe></div>";
}
//-----------------------------------------
function loginsd(){logins('650','418','用户登录','login/dl')}
function logins(w,h,title,urlss){
	AlertMsg(w, h, title, "", 80);
	document.getElementById("msgbody").innerHTML = "<br><br><br><div align=center><IMG SRC='images/loading.gif' align=absMiddle BORDER=0><font color=#009900>loading......</font></div>";
	document.getElementById("msgbody").innerHTML = "<div align=center><iframe name='ifrmname' frameborder=0 scrolling=no width='"+(w-30)+"' height='"+(h-40)+"' src='"+urlss+"'></iframe></div>";
}
function loginout(){
	if (confirm("真的要退出系统吗？")) 
	showshget('shsd', 'login/dl|loginout|out')
}
function loginoks(){top.location.reload();}
//-----------------------------------------
var ldids, Qhhtml, DataTextarea, Qhtxt, BtnSwitchTextarea, DataFCKeditor, Focusid ;
function hfadd(id, rmlid, hfid, yyid, nrid, ldid, urlss, sessionid, lb, d1, d2, d3, d4, d5, d6) {
	Qhhtml = d1;
	DataTextarea = d2;
	Qhtxt = d3;
	BtnSwitchTextarea = d4;
	DataFCKeditor = d5;
	Focusid = d6

	if (sessionid == ""){alert("对不起，你没有登录，必须先登录！"); return loginsd();}
	if(lb == "hf" || lb == "edithfsave"){
		ldids = ldid;
		if(document.getElementById(Focusid)){document.getElementById(Focusid).focus()}
		if ( document.getElementById( Qhhtml ).style.display == 'none' ){
			var oEditor = FCKeditorAPI.GetInstance( DataFCKeditor ) ;
			if (oEditor.GetXHTML( true ) == ""){
				alert("对不起，你没有填写帖子内容！")
				oEditor.Focus();
				return document.getElementById(ldid).innerHTML = "";
			}
			var tiezinr = oEditor.GetXHTML();
		}else{
			if (document.getElementById( DataTextarea ).value == ""){
				alert("对不起，你没有填写帖子内容！")
				document.getElementById( DataTextarea ).focus()
				return document.getElementById(ldid).innerHTML = "";
			}
			var tiezinr = document.getElementById( DataTextarea ).value;
		}
		document.getElementById(ldid).innerHTML = "<IMG SRC='images/loading.gif' align=absMiddle BORDER=0>&nbsp;<font color=#ff0000>正在提交，请稍候......</font>";
		showshget('shsd',urlss+'|zthfnr|'+id+'|'+rmlid+'|'+hfid+'|'+yyid+'|'+tiezinr+'|'+lb);
		
	}
	if(lb == "delzt" || lb == "delhf"){
		if(lb == "delhf"){if(document.getElementById("Focusdel"+hfid)){document.getElementById("Focusdel"+hfid).focus()}}
		if (confirm("你真的要删除吗?"))
		showshget('shsd',urlss+'|zthfnr|'+id+'|'+rmlid+'|'+hfid+'|'+yyid+'|'+nr+'|'+lb);
	}
	if(lb == "edithf"){
		if(nrid != ""){
			document.getElementById(nrid).innerHTML = "<br><br><div align=center><IMG SRC='images/loading2.gif' align=absMiddle BORDER=0></div>";
		}
		showshget('shsd',urlss+'|'+nrid+'|'+id+'|'+rmlid+'|'+hfid+'|'+yyid+'|'+nr+'|'+lb);
	}
}

//---------------------------------------------------------
function Toggle(d1,d2,d3,d4,d5,d6){
	Qhhtml = d1;
	DataTextarea = d2;
	Qhtxt = d3;
	BtnSwitchTextarea = d4;
	DataFCKeditor = d5;
	Focusid = d6
	var oEditor ;
	if ( typeof( FCKeditorAPI ) != 'undefined' )
		oEditor = FCKeditorAPI.GetInstance( DataFCKeditor ) ;
	var eTextareaDiv	= document.getElementById( Qhhtml ) ;
	var eFCKeditorDiv	= document.getElementById( Qhtxt ) ;
	if ( eTextareaDiv.style.display != 'none' ){
		if ( !oEditor ){
			CreateEditor() ;
		}else{
			oEditor.SetData( document.getElementById(DataTextarea).value ) ;
		}
		eTextareaDiv.style.display = 'none' ;
		eFCKeditorDiv.style.display = '' ;
		if ( oEditor && !document.all ){
			if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
				oEditor.MakeEditable() ;
		}
	}else{
		document.getElementById(DataTextarea).value = oEditor.GetXHTML() ;
		eTextareaDiv.style.display = '' ;
		eFCKeditorDiv.style.display = 'none' ;
	}
	document.getElementById("tbleft").style.height = document.getElementById("tbright").style.height = document.getElementById("content1").style.height;
	wlxsd();
}

function CreateEditor(){
	document.getElementById(DataFCKeditor).value = document.getElementById(DataTextarea).value ;
	var oFCKeditor = new FCKeditor( DataFCKeditor ) ;
	oFCKeditor.BasePath = '/fckeditor/' ;
	oFCKeditor.Config['CustomConfigurationsPath'] = '/fckeditor/sample15.config.js' ;
	oFCKeditor.Width = '100%' ;
	oFCKeditor.Height = '250' ;
	oFCKeditor.ReplaceTextarea() ;
}

function FCKeditor_OnComplete( editorInstance ){if(document.getElementById(BtnSwitchTextarea)){document.getElementById(BtnSwitchTextarea).disabled = false ;}}

var ylnr = "";
function ExecuteCommandhf( commandName,d1,d2,d3,d4,d5,d6 ){
	Qhhtml = d1;
	DataTextarea = d2;
	Qhtxt = d3;
	BtnSwitchTextarea = d4;
	DataFCKeditor = d5;
	Focusid = d6
	if ( document.getElementById( Qhhtml ).style.display == 'none' ){
		var oEditor = FCKeditorAPI.GetInstance( DataFCKeditor ) ;
		oEditor.Commands.GetCommand( commandName ).Execute() ;
	}else{
		ylnr = document.getElementById( DataTextarea ).value;
		//window.open('preview.html');
		var shuzu =  getPageSize();
		var B = shuzu[0]*0.8;
		var C = shuzu[1]*0.8;
		var D = (shuzu[0] - B)/2;
		window.open("preview.html",null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D)
	}
}
//-----------------------------------------
function dlandgb(){
	document.getElementById("kj").contentWindow.fraRightFrame.location = "login/dl";
	CloseMsg();
}
//-----------------------------------------
function $(id){ return document.getElementById(id)}
function isIE(){return (document.all && window.ActiveXObject && !window.opera) ? true : false;}

var sWidth,sHeight,hhh,windowWidth,windowHeight;
function getwinh(){
	if (self.innerHeight){//book\txt\20100529javascript 获得页面区域大小的代码\sm.txt
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}else if (document.body){
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
}

function AlertMsg(w, h, title, imgurl, toppx){
var msgw,msgh,msgbg,msgcolor,bordercolor,titlecolor,titlebg;
msgw = w;
msgbg = "#FFF";
msgcolor = "#000";
bordercolor = "#07528C"; 
titlecolor = "#FFF";
//-----------------------------
getwinh();
//-----------------------------
var yScroll;
if(self.pageYOffset) {
	yScroll = self.pageYOffset;
}else if(document.documentElement && document.documentElement.scrollTop){
	yScroll = document.documentElement.scrollTop;
}else if(document.body) {
	yScroll = document.body.scrollTop;
}
//-----------------------------
sWidth = window.screen.availWidth;
var yScrollh;
if (window.innerHeight && window.scrollMaxY){
	yScrollh = window.innerHeight + window.scrollMaxY;
}else if (document.body.scrollHeight > document.body.offsetHeight){
	yScrollh = document.body.scrollHeight;
}else{
	yScrollh = document.body.offsetHeight;
}
if(yScrollh > windowHeight){sHeight = yScrollh}else{sHeight = windowHeight}

if(h == 0){msgh = windowHeight-3; toppx = 1}else{msgh = h;}

//if (isIE()){setSelectState('hidden'); hhh = (sWidth-22)}else{hhh = (sWidth-18)}
/*
var maskObj = document.createElement("div");
maskObj.setAttribute('id','maskdiv');
maskObj.style.position = "absolute";
maskObj.style.top = "0";
maskObj.style.left = "0";
maskObj.style.background = "#000000";
maskObj.style.filter = "Alpha(opacity=70);";
maskObj.style.opacity = "0.3";
maskObj.style.width = sWidth + "px";
maskObj.style.height = sHeight + "px";
maskObj.style.zIndex = "10000";
document.body.appendChild(maskObj);
*/
var msgObj = document.createElement("div") 
msgObj.setAttribute("id","msgdiv");
msgObj.style.position ="absolute";
msgObj.style.top = (yScroll + toppx) + "px";
msgObj.style.left = (windowWidth - msgw) / 2 + "px";
msgObj.style.width = msgw + "px";
msgObj.style.height = msgh + "px";
msgObj.style.fontSize = "12px";
msgObj.style.background = msgbg;
msgObj.style.border = "1px solid " + bordercolor;
msgObj.style.zIndex = "10001";
var thObj = document.createElement("div");
thObj.setAttribute("id","msgth");
thObj.className = "DragAble";
thObj.style.cursor = "move";
thObj.style.padding = "6px 6px";
thObj.style.color = titlecolor;
var titleStr = "<a class='close' title='关闭' onclick='CloseMsg()'>关闭</a>"+"<span>"+ title +"</span>";
thObj.innerHTML = titleStr;
var bodyObj = document.createElement("div");
bodyObj.setAttribute("id","msgbody");
bodyObj.style.padding = "10px";
bodyObj.style.lineHeight = "1.5em";
document.body.appendChild(msgObj);
$("msgdiv").appendChild(thObj);
$("msgdiv").appendChild(bodyObj);
}
function CloseMsg(){
//document.body.removeChild($("maskdiv"));
$("msgdiv").removeChild($("msgth"));
$("msgdiv").removeChild($("msgbody"));
document.body.removeChild($("msgdiv"));
if (isIE()){setSelectState('');}
//if(gdtyinc){gdtyinc = false; document.documentElement.style.overflowY = "auto";document.documentElement.style.overflowX = "hidden";}
}
var ie = document.all;
var nn6 = document.getElementById&&!document.all;
var isdrag = false;
var y,x;
var oDragObj;
function moveMouse(e) {
if (isdrag) {
oDragObj.style.top = (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y)+"px";
oDragObj.style.left = (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x)+"px";
return false;
}
}
function initDrag(e) {
var oDragHandle = nn6 ? e.target : event.srcElement;
var topElement = "HTML";
while (oDragHandle.tagName != topElement && oDragHandle.className != "DragAble") {
oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement;
}   
if (oDragHandle.className=="DragAble") {
isdrag = true;
oDragObj = oDragHandle.parentNode;
nTY = parseInt(oDragObj.style.top);
y = nn6 ? e.clientY : event.clientY;
nTX = parseInt(oDragObj.style.left);
x = nn6 ? e.clientX : event.clientX;
document.onmousemove = moveMouse;
return false;
}   
}   
document.onmousedown = initDrag;
document.onmouseup = new Function("isdrag=false");

function setSelectState(state){
var objl=document.getElementsByTagName('select');
for(var i=0;i<objl.length;i++){objl[i].style.visibility=state;}
}



//============================ script.js =========================================================== 
function Trim(strValue){return strValue.replace(/^\s*|\s*$/g,"");}
function GetCookie(sName){
	var aCookie = document.cookie.split(";");
	for (var i=0; i < aCookie.length; i++){
		var aCrumb = aCookie[i].split("=");
		if (sName == Trim(aCrumb[0])){return unescape(aCrumb[1]);}
	}
	return null;
}
function SetCookie(sName, sValue){document.cookie = sName + "=" + escape(sValue)+";expires=Fri, 31 Dec 2050 23:59:59 GMT;";}
function savecols(){
	if (document.body.offsetWidth>5){
		if(isIE()){jiaozheng = 2}else{jiaozheng=0}
		SetCookie("datacols",(document.body.offsetWidth+jiaozheng)+",*");
	}
}
function showdir(){
	var framecols = "228,*"
	if (GetCookie("datacols")!=null){framecols = GetCookie("datacols");}
	var target = top.document.getElementById("kj").contentWindow;
	target.document.getElementById('FRM2').cols=framecols;
	target.document.getElementById('FRM3').contentWindow.document.getElementById('showtoc').style.display="none";
}

function hidedir(){
	var target = top.document.getElementById("kj").contentWindow;
	//SetCookie("datacols",target.document.getElementById('FRM2').cols);//记忆左边栏宽度，但是刚调好宽度如果没有执行hidedir()过就刷新就无法记忆了，所以还是在dir.asp里记忆好
	target.document.getElementById('FRM2').cols="-5,*";
	target.document.getElementById('FRM3').contentWindow.document.getElementById('showtoc').style.display="block";
}

function showhidentopbar(){//状态栏隐藏/显示
	var target = top.document.getElementById("kj").contentWindow;
	//var target = parent.parent.parent;
	if(target.document.getElementById('FRM1').rows == "75,*"){
		target.document.getElementById('FRM1').rows = "-1,*"
		document.getElementById('showtop').innerHTML="显示导航栏";
		document.getElementById('barlink').style.display="block";
		SetCookie("toprows",target.document.getElementById('FRM1').rows);
	}else{
		target.document.getElementById('FRM1').rows = "75,*";
		document.getElementById('showtop').innerHTML="隐藏导航栏";
		document.getElementById('barlink').style.display="none";
		SetCookie("toprows",target.document.getElementById('FRM1').rows);
	}
}

function getstatus(){//由于记住了上次的状态栏状态，所以再次打开必须处理以下文字的显示状态和是否隐藏
	var target = top.document.getElementById("kj").contentWindow;
	if(target.document.getElementById('FRM1').rows=="75,*"){
		document.getElementById('showtop').innerHTML="隐藏导航栏";
		document.getElementById('barlink').style.display="none";
	}else{
		document.getElementById('showtop').innerHTML="显示导航栏";
		document.getElementById('barlink').style.display="";
	}
	if(target.document.getElementById('FRM2').cols=="-5,*"){
		document.getElementById('showtoc').style.display="block";
	}else{
		document.getElementById('showtoc').style.display="none";
	}
}
//function syn(){top.location.reload();}//整个页面刷新
function syn(){top.document.getElementById("kj").contentWindow.fraLeftFrame.fraDeeptree.location.reload();}//dir目录导航刷新
function synhome(){top.document.getElementById("kj").contentWindow.fraRightFrame.location.reload();}//home刷新
function synhomeclose(){top.document.getElementById("kj").contentWindow.fraRightFrame.location.reload(); top.CloseMsg();}//home刷新并关闭弹出DIV窗口
//function fuzhi(){//给cs3赋值
//	var target = document.getElementById("kj").contentWindow.document.getElementById('FRM4').contentWindow;
//	target.document.getElementById('showtoc').innerHTML="OKOKOK";
//}
//------------------------------------------------------------
function overs(obj,css){obj.className = css;}
function outrs(obj,css){obj.className = css;}

var linkid = "";//上一个点击过的对象
function oversl(obj,css){obj.className = css;}
function outrsl(obj,css1,css2){if(obj == linkid){obj.className = css2;}else{obj.className = css1;};}
function outrsdown(obj,css1,css2){
	if(linkid != "" && linkid != obj){linkid.className = css1;}//清除上一个的颜色，使之恢复原状
	linkid = obj; obj.className = css2;
}



//----------------------------------------------------------------------
var nr = "";//test
var i = 0;
function wlxsd(){
	getwinh();
	var divleft = document.getElementById('tbleft');
	var divright = document.getElementById('tbright');
	var contenth = windowHeight - 205;
	i++;
	if(i < 5){timer2 = window.setTimeout("wlxsd()",2000);}else{window.clearTimeout(timer2);}
	//nr = nr + "abc<br>"; document.getElementById('rnr').innerHTML = nr; //window.setTimeout("wlxsd()",1000);//test

	if(divleft.scrollHeight <= contenth && divright.scrollHeight <= contenth){
		divright.style.height = divleft.style.height = contenth+'px';
	}else{
		if(divleft.scrollHeight > divright.scrollHeight){
			divright.style.height = divleft.style.height = divleft.scrollHeight+'px';
		}else{
			divright.style.height = divleft.style.height = divright.scrollHeight+'px';
		}
	}
}
//26+80+29+10+10+(1+10+20+15)+1

//----------------------------
function strtougao(mlid){//更新投稿按钮
	//document.getElementById("tougao").innerHTML = "<a href='list_"+mlid+"_listadd' class='daohangmuen' onfocus=this.blur()>投稿</a>";
	window.document["shsd"].asFunctougao(mlid);
}
function getlists(urlss,page,ssxm,mlid){
	if (mlid == ""){
		alert("对不起，板块参数错误")
		return false;	
	}
	if(page == ""){page = 1}
	document.getElementById("listnr").innerHTML = "<br><br><br><div align=center style='color:#ff0000;font-size:14px;'><IMG SRC='images/loading2.gif' align=absMiddle BORDER=0><br><br>正在获取列表，请稍候......</div>";
	showshget('shsd',urlss+'|listnr|'+page+'|'+ssxm+'|'+mlid);
}
//-----------------------------------------
function getfiledown(w,h,title,id,rmlid){
	AlertMsg(w, h, title, "", 51);
	showshget('shsd','z_down|msgbody|'+id+'|'+rmlid);
}
//----------------------------
function addBookmark() {//加入收藏
	var sTitle = document.title;
	var sURL = parent.location.href;
	try{window.external.addFavorite(sURL, sTitle);}
	catch (e){
		try{window.sidebar.addPanel(sTitle, sURL, "");}
		catch (e){
			alert("加入收藏失败，请使用Ctrl+D进行添加");
		}
	}
}
function SetHome(){//设为首页
	var vrl = window.location;
	try{document.links[0].style.behavior='url(#default#homepage)'; document.links[0].setHomePage(vrl);}
	catch(e){
		if(window.netscape) {
			try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}  
			catch (e){ 
				alert("抱歉！您的浏览器不支持直接设为首页。请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为“true”，点击“加入收藏”后忽略安全提示，即可设置成功。");  
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage',vrl);
		}
	}
}
function shouye(){SetHome()}
//----------------------------
function tougaosd(mlid){window.location.href="list_"+mlid+"_listadd"}

//----------------------------
function getPageSize() {
var windowWidth, windowHeight;
if (self.innerHeight){
	windowWidth = self.innerWidth;
	windowHeight = self.innerHeight;
}else if (document.documentElement && document.documentElement.clientHeight){
	windowWidth = document.documentElement.clientWidth;
	windowHeight = document.documentElement.clientHeight;
}else if (document.body){
	windowWidth = document.body.clientWidth;
	windowHeight = document.body.clientHeight;
}
arrayPageSize = new Array(windowWidth, windowHeight);
return arrayPageSize;
}










