 /************************************************************
	功    能:打开一个模式窗口（窗口位于屏幕中心，并将当前页面对象传递给打开的模式窗口）
	输入参数:
			UrlPage：窗口URL
			Width：宽度px
			Height：高度px
	author  :crazyrain
	data    :2004-11-23
	************************************************************/
	 function showModalDialogScreenCenter(UrlPage,Width,Height)
	 {
	 	return showModalDialogScreenCenterEx(UrlPage,window,Width,Height);
	 }
	 function showModalDialogScreenCenterEx(UrlPage,Param,Width,Height)
	 {   
	 	var Left=(window.document.body.clientWidth-Width)/2+window.screenLeft;
		var Top=(window.document.body.clientHeight-Height)/2+window.screenTop;
		//产生随机数
		var n=Math.round(Math.random()*(1000-1))+1;
		if(/\?/.test(UrlPage))
			UrlPage+='&Randomicity='+n;
		else UrlPage+='?Randomicity='+n;
		var returnValue=showModalDialog(UrlPage, Param,"dialogWidth="+Width+"px; dialogHeight="+Height+"px;center=yes;status=no;help=no;resizable=no");	
	 	if(returnValue==null)returnValue=window.refresh;
	 	return returnValue;
	 }
	/************************************************************
	功    能:打开一个模式窗口（窗口位于当前页面中心，并将当前页面对象传递给打开的模式窗口）
	输入参数:
			UrlPage：窗口URL
			Width：宽度px
			Height：高度px
	author  :crazyrain
	data    :2004-11-23
	************************************************************/
	  function showModalDialogWindowCenter(UrlPage,Width,Height)
	 {
		return showModalDialogWindowCenterEx(UrlPage,window,Width,Height);
	 }
	  function showModalDialogWindowCenterEx(UrlPage,Param,Width,Height)
	 {
		var Left=(window.document.body.clientWidth-Width)/2+window.screenLeft;
		var Top=(window.document.body.clientHeight-Height)/2+window.screenTop;
		//产生随机数
		var n=Math.round(Math.random()*(1000-1))+1;
		if(/\?/.test(UrlPage))
			UrlPage+='&Randomicity='+n;
		else UrlPage+='?Randomicity='+n;
		var returnValue=showModalDialog(UrlPage, window,"dialogWidth="+Width+"px; dialogHeight="+Height+"px;dialogTop="+Top+"px;dialogLeft="+Left+"px;status=no;help=no;resizable=no");	
	 	if(returnValue==null)returnValue=window.refresh;
	 	return returnValue;
	 };
	/************************************************************
	功    能:打开一个新窗口（窗口位于当前页面中心）
	输入参数:
			UrlPage：窗口URL
			Width：宽度px
			Height：高度px
	author  :crazyrain
	data    :2004-11-23
	************************************************************/
	 function OpenWindowScreenCenter(UrlPage,Width,Height)
	 {
	
	 	var Left=(window.screen.availWidth-Width)/2;
		var Top=(window.screen.availHeight-Height)/2;	
		window.open(UrlPage,'_black',"width="+Width+", height="+Height+",top="+Top+",left="+Left+", menubar=no, scrollbars=no, resizable=yes, location=no, status=yes");
	 };
	 /************************************************************
	功    能:打开一个新窗口（窗口位于屏幕中心）
	输入参数:
			UrlPage：窗口URL
			Width：宽度px
			Height：高度px
	author  :crazyrain
	data    :2004-11-23
	************************************************************/
	 function OpenWindowWindowCenter(UrlPage,Width,Height)
	 {
	  	var Left=(window.document.body.clientWidth-Width)/2+window.screenLeft;
		var Top=(window.document.body.clientHeight-Height)/2+window.screenTop;	
		window.open(UrlPage,'_black',"width="+Width+", height="+Height+",top="+Top+",left="+Left+", menubar=no, scrollbars=no, resizable=yes, location=no, status=yes");
	 };
	/************************************************************
	功    能:检查浏览器版本
	输入参数:
			
	author  :王颖异
	data    :2007-04-09
	************************************************************/
	 function CheckBrowser()
	{ 
	  var app=navigator.appName;
	  var verStr=navigator.appVersion;
	  if (app.indexOf('Netscape') != -1) {
	    alert("友情提示：\n    你使用的是Netscape浏览器，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。");
	  }
	  else if (app.indexOf('Microsoft') != -1) {
	    if (verStr.indexOf("MSIE 3.0")!=-1 || verStr.indexOf("MSIE 4.0") != -1 || verStr.indexOf("MSIE 5.0") != -1 || verStr.indexOf("MSIE 5.1") != -1)
	      alert("友情提示：\n    您的浏览器版本太低，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。");
	  }
	}
	/************************************************************
	功    能:是否有空格
	输入参数:
			
	author  :王颖异
	data    :2007-04-09
	************************************************************/
	
	function isspacestring(mystring)
	{ var istring=mystring;
	  var temp,i,strlen;
	  temp=true;
	  strlen=istring.length;
	  for (i=0;i<strlen;i++)
	  {
	    if ((istring.substring(i,i+1)!=" ")&(temp))
	     { temp=false;  }
	  }
	 return temp;
	}
	/************************************************************
	功    能:首字空格检查
	输入参数:
			
	author  :王颖异
	data    :2007-04-09
	************************************************************/
	
	function firstisspace(mystring)
	{ var istring=mystring;
	  var temp,i,strlen;
	  temp=false;
	    if (istring.substring(0,1)==" ")
	     { temp=true;  }
	 return temp;
	}
	/************************************************************
	功    能:检查用户输入
	输入参数:
			
	author  :王颖异
	data    :2007-04-09
	************************************************************/
	function check_input(theForm)
	{
	
	   if ((theForm.logname.value == "")|(firstisspace(theForm.logname.value)))
	  {
	    alert("请输入用户名.不能以空格开头");
	    theForm.logname.focus();
	    return (false);
	  }
	
	  if ((theForm.password.value == "")|(isspacestring(theForm.password.value)))
	  {
	    alert("请输入密码.");
	    theForm.password.focus();
	    return (false);
	  }
	   if ((theForm.rand.value == "")|(isspacestring(theForm.rand.value)))
	  {
	    alert("请输入验证吗.");
	    theForm.rand.focus();
	    return (false);}
	}
	//实现页面刷新功能
	  function refresh()
	{
		location.reload();
		
		
	
	}
	function showlist(id,c){
	i=0;
	while(i<c){
		i=i+1;
		var whichEl = eval("sub"+id+""+i);
		if(whichEl.style.display == "none"){
			eval("img"+id+".src=\"Img/nofollow.gif\"");
			eval("sub"+id+""+i+".style.display=\"\";");
		}else{
			eval("img"+id+".src=\"Img/plus.gif\"");
			eval("sub"+id+""+i+".style.display=\"none\";");
		}
	}
	//eval(id+".style.display=\"none\";");
} 
	function makevisible(cur,which){
	var i;
	if (which==0)
	for(i=cur.filters.alpha.opacity;i<100;i++){
		cur.filters.alpha.opacity=i;
	}
	
	
	else
	for(i=cur.filters.alpha.opacity;i>50;i--){
		cur.filters.alpha.opacity=i;
	}
	
	
	}
