function SelectAllCheckboxes(spanChk)
{
	var xState=spanChk.checked;
	var theBox=spanChk;
	elm=theBox.form.elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
		{
			if(elm[i].checked!=xState)
				elm[i].click();
		}
	}
}
//清除页面所有单选框的选择
function RdoClearChecked(rdo)
{
	//rdo.checked=rdo.checked;
	elm=rdo.form.elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="radio" && elm[i].id!=rdo.id)
		{
			elm[i].checked=false;
		}
	}
}

function HighlightRow(chkB)
{
	var xState=chkB.checked;
		
	if(xState)
	{
		chkB.parentElement.parentElement.style.backgroundColor='#DEDFDE';
		chkB.parentElement.parentElement.style.color='black';
	}else 
	{
		chkB.parentElement.parentElement.style.backgroundColor='';
		chkB.parentElement.parentElement.style.color='black';
	}
}

//刷新父窗口页面
function refreshOpenerPage(){
	try{
		window.opener.location.href = window.opener.location.href.replace('#','');
	}catch(e){}
}

//刷新父窗口页面
function refreshParent(){
	try{
		window.opener.location.reload();
	}catch(e){}
}

//聚焦父窗口
function focusOpenerPage(){
	try{
		window.opener.focus();
	}catch(e){}
}

//关闭窗口并聚焦父窗口
function closeWindow(){
	focusOpenerPage();
	window.close();
}

//打开新窗口。窗口风格固定，可指定窗口的宽度与高度。
function openNewWindow(strfileName,intWidth, intHeight){
	var d = Math.floor(Math.random() * 10000000000000000);
	var StrWindowName = d.toString();
	var splashWin = window.open(strfileName,StrWindowName,"toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,top=0,left=0,width=" + intWidth + ",height=" + intHeight )
	var intLeft,intTop;
	intLeft=(screen.availWidth - intWidth)/2;
	intTop= (screen.availheight - intHeight)/2;
	splashWin.moveTo(intLeft,intTop);
	splashWin.focus();
}

//打开新窗口。窗口风格固定，可指定窗口的宽度与高度。
function openFullWindow(strfileName){
	var d = Math.floor(Math.random() * 10000000000000000);
	var StrWindowName = d.toString();
	var splashWin = window.open(strfileName,StrWindowName,"toolbar=1,location=0,directories=0,status=1,fullscreen =0"
	+",menubar=0,scrollbars=1,resizable=1,top=0,left=0,width=" + (screen.availWidth - 10) 
	+ ",height=" + (screen.availHeight - 100) )

	splashWin.moveTo(0,0);
	splashWin.focus();
}

function confirm_del()
{
	if(confirm("您确认删除所选择的数据吗？"))
	{
		return(true);
	}else
	{
		return(false);
	}
}

function confirm_notpass()
{
	if(confirm("确认是否将以上选定内容设置为不通过？"))
	{
		return(true);
	}else
	{
		return(false);
	}
}

// 隐藏所有的dropdownlist和frame
function DispControl(bVisible)
{
	var elm=document.forms[0].elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="select-one")
		{
			if( bVisible == true )
		    	//clearTimeout(tFadeIn);
			   // fadeOut(elm[i]);
				elm[i].style.visibility="";
			if( bVisible == false )
				elm[i].style.visibility="hidden";
				//clearTimeout(tFadeOut);
				//fadeIn(elm[i]);
				
				
			    
		}
	}
}


function fadeOut(dypopLayer){
	if(dypopLayer.filters.Alpha.opacity<100) {
	//	dypopLayer.style.filter=Alpha(Opacity=++);
		tFadeOut=setTimeout("fadeOut()",1);
		}
		//else {
		//	dypopLayer.filters.Alpha.opacity=100;
		//	tFadeWaiting=setTimeout("fadeIn()",1);
		//	}
}

function fadeIn(dypopLayer){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}



 //window.open打开的窗口，取得值后返回parent window
 //@Values表示所有取得的值，中间用"|"格开 如  "Genson|121|ABC"
 //@ParentControls表示parent window需要返回值的控件。如" txtName|txtNo|lblMessage "
 function SetParentControlValues(Values,ParentControls)
  {
     var doc = window.opener.document;
     var array = new Array();
     array = Values.split("|");
     
     var controls =new Array();
     controls = ParentControls.split("|");
     
     
     if(array.length != controls.length)
     {
         alert('参数不对');
         return false;
     }
    
     
     for(i=0;i<array.length;i++)
     {
       try
       {
            // window.document.forms["frmMain"].controls[i].value = array[i];
            
             eval(doc.getElementById(controls[i])).value = array[i];
             //alert(controls[i]);
        }
        catch(e)
        {
          eval(doc.getElementById(controls[i])).innerText = array[i];    
        }
        
       
     }
      window.close();
  
  }



