//打开窗口的函数

function checkAll(name) {
 var el = document.getElementsByTagName('input');
 var len = el.length;
 for(var i=0; i<len; i++)     { 
    if((el[i].type=="checkbox") && (el[i].name==name))    {   
	 el[i].checked = true; 
	         }  
			    }
				 }
function clearAll(name) {     
var el = document.getElementsByTagName('input');     
var len = el.length;     
for(var i=0; i<len; i++)     {         
if((el[i].type=="checkbox") && (el[i].name==name))         
{             
el[i].checked = false;        
}     
} 
} 

function getshuoming(){
	var sm = document.getElementsByName('sshuo');
	var len = sm.length;
	var shuo=sm[0].value;
	for(var i=1;i<len;i++){
	shuo=shuo+'||'+sm[i].value;
	}
	parent.document.add.shuoming.value=shuo;
}


function deltrue()
{
return  window.confirm("你真的要删除吗？"); 
}
function passtrue()
{
return  window.confirm("真的要通过吗？"); 
}



 function validate()
{


if (document.add.t1.value=="")
{
alert ("错误：请填写信息名称！");
return false;}

if (document.add.t2.value=="")
{
alert ("错误：请填写发布者名称！");
return false;}

if (document.add.t5.value=="")
{
alert ("错误：没有内容无法提交！");
return false;}

if ((document.add.istop.checked== true)&&(document.add.t6.value!="jpg"))
{
alert ("错误：没有上传图片或是格式不为JPG！");
return false;}

	var sUser_name = new String(document.add.t2.value);
	var ss="[\u4e00-\u9fa5]";
	var re= new RegExp(ss);
var i;for(i=0;i<sUser_name.length;i++)
	{
		if((sUser_name.charCodeAt(i)<128) || (re.test(sUser_name.charAt(i))==false))
		{
	    		alert("发布者名称必须全部为中文!");
	    		return false
		}
		
	}
	
/*var upload=new String(document.add.t5.value);
if (upload.search("2")==-1)
{
alert("错误：请先上传文件！");
return false;
}*/
return true;
}

 function switchSysBar(){
  if (parseInt(navigator.appVersion)>=4) {
	if (switchPoint.innerText==3){
		switchPoint.innerText=4
		document.all("query").style.display="none"

	}
	else{
		switchPoint.innerText=3
		document.all("query").style.display=""
	}
  }
}

 function viewPage(ipage){
        document.frmList.Page.value=ipage
        document.frmList.submit()        
     }

 function openScript(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,status=no' );
    }

function openScript1(url, width, height) {
        var Win = window.open(url,"_blank",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no,left=5,top=10' );
    }

 function Detail(i,ss){
      var u
      u='newsdetail.asp?news_id='+i+'&wstr="'+ss+'"'
      window.open(u,'_blank','dependent,width=400,height=400')
    }
    
 function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,'width =400,height=400,resizable=1,scrollbars=yes,menubar=no,status=no,left=5,top=10');

    }




 function tt(s){
      alert(s)
    }

function OpenWindow(htmurl,widths,heights)
{
   var paramet = 'toolbar=no,resizable=yes,scrollbars=yes,width='+ widths + ',height=' + heights;
   newWindow = window.open(htmurl,"viewfilm",paramet);
   newWindow.focus();
}

function MM_openBrWindow1(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


//***********默认设置定义.*********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=3000;//显示tShow豪秒后关闭提示
showPopStep=100; 
popOpacity=100; //透明度.Alpha值

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #ffffff;color:#000000; border: 1px #000000 solid;font-color: font-size: 10px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0);}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;


function checklog()
{
if (document.form1.user.value=="")
{
alert ("错误：请输入用户名！");
return false;}
if (document.form1.pass.value=="")
{
alert ("错误：请输入密码！");
return false;}
return true;
}

var waitInterval;
var MDelayTime=220;
function Show_Tabs(tab_index,tab_id){
clearTimeout(waitInterval);
waitInterval=window.setTimeout("ToShowTab("+tab_index+","+tab_id+");",MDelayTime);
}
function ToShowTab(tab_index,tab_id){
clearTimeout(waitInterval);
for(var i=0;i<4;i++){document.getElementById("content_"+tab_index+i).style.display="none";}
document.getElementById("content_"+tab_index+tab_id).style.display="block";
}

