var Startime,Endtime;
var now =new Date()
Startime=now.getTime();
function Forum()
{
	this.Forum_copyright='';
	this.Version='';
	this.stylelist='';
	this.Manage='';
	this.link= new Array();
	this.linkpic=new Array();
	this.Forum_skin=new Array();
	this.Forum_skinid=new Array();
	this.Stats=''
	this.FindUser= new Boolean();
	this.FindUser=false;
	this.Master=new Boolean();
	this.Master=false;
	this.GroupName=new Array()
	this.UserHidden='2';
	this.UserID='0';
	this.ErrInfo=new Array();
	this.sendmsgnum=0;
	this.list=new Array();
	this.GroupList=new Array();
	this.Alllist=new Array();
	this.currentpage=1
	this.BoardType='';
	this.plus_type=new Array();
	this.Mainpage=new Array();
	this.Styles='';
	this.guestnum='';
	this.onlinenum='';
	this.allonline='';
}
var Dvbbs=new Forum();
function links(type) {
	this.type=type
}
function bbslist(bbstype)
{
	this.bbstype=bbstype
	this.boardid=new Array();
	this.BoardType=new Array();
	this.readme=new Array();
	this.BoardMaster=new Array();
	this.lastbbsnum=new Array();
	this.lasttopicnum=new Array();
	this.indexIMG=new Array();
	this.todayNum=new Array();
	this.LastPost=new Array();
	this.Orders=new Array();
	this.sid=new Array();
	this.ParentID=new Array();
	this.ParentStr=new Array();
	this.Depth=new Array();
	this.RootID=new Array();
	this.Child=new Array();
	this.Board_Setting=new Array();
	this.HaveNew=new Array();
	this.IsShow= new Array();
}

Dvbbs.BoardID=0;

function Showpic() {
  arrArg = Showpic.arguments;
  return (arrArg[0]==null || arrArg[0] == ''? '' : 
      '<img src='+arrArg[0]+
      (arrArg[1]==null ? '' : ' title="'+arrArg[1]+'"')+
      (arrArg[2]==null ? '' : ' width='+arrArg[2])+
      (arrArg[3]==null ? '' : ' height='+arrArg[3])+
      ' border=0 align=absmiddle>');
}

//一般标题过滤
function FilterBadWord(str) {
  if(str=='')
    return str;

	var Bword,tmpstr='';
	for (iii=0;iii<Dvbbs.Badwords.length ;iii++ )	{	
		Badword=Dvbbs.Badwords[iii];
		Bword=eval('/'+Badword+'/gi');
		for (q=0;q<Badword.length;q++)
			tmpstr+='*';
		str=str.replace(Badword,tmpstr)
		tmpstr='';
	}	
	return str;
}

function FilterJS(str) {
  if(str=='')
    return str;

  str=str.replace(/(&#)/gi,"<I>&#</I>");
  str=str.replace(/(javascript)/gi,"<I>javascript</I>");
  str=str.replace(/(jscript:)/gi,"<I>jscript:</I>");
  str=str.replace(/(js:)/gi,"<I>js:</I>");
  str=str.replace(/(value)/gi,"<I>value</I>");
  str=str.replace(/(about:)/gi,"<I>about:</I>");
  str=str.replace(/(file:)/gi,"<I>file:</I>");
  str=str.replace(/(ment.cookie)/gi,"<I>ment.cookie</I>");
  str=str.replace(/(vbscript:)/gi,"<I>vbscript:</I>");
  str=str.replace(/(vbs:)/gi,"<I>vbs:</I>");
  str=str.replace(/( on(mouse|exit|error|click|key))/gi,"<I> on$2</I>");
  return str;
}

function dvhtmlencode(str) {
  if(str=='')
    return str;

  str=FilterJS(str);
  str=str.replace(/  /g,'&nbsp;&nbsp;');
	str=str.replace(/>/g,'&#62;');
	str=str.replace(/</g,'&#60;');
	str=str.replace("/",'&#47;');
	str=str.replace(/\r/gi,'');
	str=str.replace(/\n/gi,'');
	str=str.replace(/\'/g,'&#39;');
	str=str.replace(/\"/g,'&#34;');
	str=str.replace(/'/g,'&#39;');
	str=str.replace(/"/g,'&#34;');
  str=FilterBadWord(str);

	return str;
}

//针对js特效菜单中的过滤
function vhtmlencode(str) {
  if(str=='')
    return str;

	str=str.replace(/  /g,'&nbsp;&nbsp;');
	str=str.replace(/\r/gi,'<br>');
	str=str.replace(/\n/gi,'<br>');
	str=str.replace(/\'/g,'‘');
	str=str.replace(/>/g,'》');
	str=str.replace(/</g,'《');
	str=str.replace(/&gt;/gi,'》');
	str=str.replace(/&lt;/gi,'《');
	str=str.replace(/&quot;/gi,'“');
	str=str.replace(/&#34/g,'“');
	str=str.replace(/&#39/g,'‘');
	str=str.replace(/'/g,'‘');
	str=str.replace(/"/g,'“');
  str=FilterBadWord(str);

  return str;
}

//下拉菜单相关代码
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -5;
 var space = 1;
 var isvisible;
 var global = window.document
 global.fo_currentMenu = null

function HideMenu() {
 	var mX;
 	var mY;
 	var vDiv;
 	var mDiv;
	if (isvisible == true) {
		vDiv = document.all("menuDiv");
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)) {
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
	}
}

function ShowMenu(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	vMnuCode = '<table id=submenu style="width:'+tWidth+';" onmouseout="HideMenu()"><tr><td nowrap style="padding: 3px">'+vMnuCode+'</td></tr></table>';

	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+4;
	t = vSrc.offsetTop + topMar + h + space-2;
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}

	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
}
 
 

