function newsopen(name, link) 
{
        win = window.open(link, name ,'left=100, top=80, width=300,height=200');
        win.focus();
}

function personwin(ps)
{
	var newurl = "indextxl.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'left=100, top=80, width=400,height=400');
	win.focus();
}

function bbswin1(ps)
{
	var newurl = "kehuxinxi.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function bbswin2(ps)
{
	var newurl = "shebeixinxi_q.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function bbswin3(ps)
{
	var newurl = "shebeixinxi_g.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function bbswin4(ps)
{
	var newurl = "cailiaoxinxi_q.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function bbswin5(ps)
{
	var newurl = "cailiaoxinxi_g.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function sb_bbs_user(ps)
{
	var newurl = "sb_useredit.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=110, top=40, width=440,height=460');
	win.focus();
}

function gcyjwin3(ps)
{
	var newurl = "other1.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=640,height=540');
	win.focus();
}
function gcyjwin4(ps)
{
	var newurl = "qixiadata.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=753,height=600');
	win.focus();
}
function gcyjwin0(ps)
{
	var newurl = "other.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=640,height=540');
	win.focus();
}

function gcyjwin5(ps)
{
	var newurl = "showdata1.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=640,height=540');
	win.focus();
}
function gcyjwin6(ps)
{
	var newurl = "study.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=640,height=540');
	win.focus();
}
function gcyjwin1(ps)
{
	var newurl = "newsshow.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=640,height=540');
	win.focus();
}

function gcyjwin2(ps)
{
	var newurl = "showdata.asp?id=" + ps;
	win=window.open(newurl, 'SmallWin', 'scrollbars=yes,left=100, top=2, width=700,height=540');
	win.focus();
}

function newsopen_url(name, link) 
{
        win = window.open(link, name ,'left=100, top=80, width=600,height=600');
        win.focus();
}

function submit_form(form)
{
	form.submit();
}

function resert_form(form)
{
	form.resert();
}

function submit(newvalue)
{
	if (newvalue == 1)
	{
		url ="question.php?subject="+document.question.subject.value+"&u=&p=";
		var win = window.open(url, "SmallWin", "scrollbars=yes,resizeable=yes,width=600,height=400");
		win.focus();
	}
	else
	{
		document.search_question.action="search_question.php";
		document.search_question.submit();
	};
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,objson,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
  { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; 
    }

	var newtop=0
	var newleft=0
	if (navigator.appName == "Netscape") {
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
	}
	else
	{
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
	}

	layerName = args[0];

	eval('var curElement='+layerRef+'["'+layerName+'"]')
	eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
	eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
	eval('height=curElement'+styleSwitch+'.height')
	eval('width=curElement'+styleSwitch+'.width')
	width=parseInt(width)
	height=parseInt(height)
	if (event.clientX > (document.body.clientWidth - 5 - width))
	{
	newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
	}
	else
	{
	newleft=document.body.scrollLeft + event.clientX
	}
	eval('curElement'+styleSwitch+'.pixelLeft=newleft')

	if (event.clientY > (document.body.clientHeight - 5 - height))
	{
	newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
	}
	else
	{
	newtop=document.body.scrollTop + event.clientY
	}
	eval('curElement'+styleSwitch+'.pixelTop=newtop')

}

//以下三个是翻页和切换使用的JS函数，为了统一和使用方便
//所有翻页时变量内容都套在"form2"中
function switchto(n)
{
	document.form2.segno.value = 0;
	document.form2.pageno.value = 0;
	document.form2.showpart.value = n;
	document.form2.submit();
}

function showpage(n)
{
	document.form2.pageno.value = n;
	document.form2.submit();
}

function showseg(n)
{
	document.form2.pageno.value = 0;
	document.form2.segno.value  = n;
	document.form2.submit();
}