﻿// JScript 文件
//确认
function myConfirm(Message)
{
	if (Message!="")
	{
		if (confirm(Message))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}



function myGoBack(Message)
{
	if (Message!="")
	{
		if (confirm(Message))
		{
			history.go(-1);
		}
		else
		{
		    return false;
		}
	}
}

function windowOpener_SelectTemplate(PermissionID,ProjectTypeID)
{	
	var	controlSelectTemplate=showModalDialog("../Security/SelectTemplate.aspx?PermissionID="+PermissionID+"&ProjectTypeID="+ProjectTypeID,"", "dialogWidth:30em; dialogHeight:12.3em; status:0; scrollbars:1, resizable:1");
}


function windowOpener_SetCondition(RolePermissionID,ProjectTypeID)
{	
	var	controlSetCondition=showModalDialog("../Security/SetCondition.aspx?RolePermissionID="+RolePermissionID+"&ProjectTypeID="+ProjectTypeID,"", "dialogWidth:45em; dialogHeight:39.7em; status:0; scrollbars:1, resizable:1");
}

function ExpCollGroup(groupName, imgName)
{
    if (browseris.nav)
        return;
    viewTable = document.getElementById("titl"+groupName).parentNode;
    tbodyTags = viewTable.getElementsByTagName("TBODY");
    numElts = tbodyTags.length;
    len = groupName.length;
    img = document.getElementById(imgName);
    srcPath = img.src;
    index = srcPath.lastIndexOf("/");
    imgName = srcPath.slice(index+1);
    if (imgName =='plus.gif')
    {
        fOpen = true;
        displayStr = "";
        img.src = '../Images/minus.gif';
    }
    else
    {
        fOpen = false;
        displayStr = "none";
        img.src = '../Images/plus.gif';
    }
    for(var i=0;i<numElts;i++)
    {
        var childObj = tbodyTags[i];
        if ( (childObj.id !=null)
                    && (childObj.id.length > len +4)
                    && (groupName == childObj.id.slice(4).substr(0,len)) )
        {
            if (fOpen)
            {
                index = childObj.id.indexOf("_", len+4);
                if (index!=-1)
                {
                    index = childObj.id.indexOf("_", index+1);
                    if (index!=-1)
                        continue;
                }
            }
            childObj.style.display = displayStr;
            if (fOpen && childObj.id.substr(0,4) == "titl")
            {
                imgObj = document.getElementById("img_" + childObj.id.slice(4));
                imgObj.src = '../Images/plus.gif';
            }
        }
    }
}

//打开模态窗口选择管理代码父节点
function OpenModalDialogInDataDict()
{
    var	controlDataDict=window.showModalDialog('../DataDict/GetParentNode.aspx',window, "dialogWidth:28em; dialogHeight:32em; status:0; help:0; scroll:yes;resizable:yes");
}

//验证控件中输入的是不是数字
function JHshNumberText()
{
    if ( !((window.event.keyCode >= 48) && (window.event.keyCode <= 57)))
    {
        alert("只能输入数字");	
        return false;
    }
}
function JHshdecimalText()
{
    if ( !((window.event.keyCode >= 46) && (window.event.keyCode <= 57)))
    {
        if (window.event.keyCode != 13)
        {
            window.event.keyCode = 0 ;
            alert("只能输入数字");
        }
    }
} 

function JHshNumberText(ControlID)
{
    if ( !((window.event.keyCode >= 48) && (window.event.keyCode <= 57)))
    {
        if (window.event.keyCode != 13)
        {
            window.event.keyCode = 0 ;
            alert("只能输入数字");
        }
        else
        {
            document.all(ControlID).focus();
            document.all(ControlID).click();	
            return false;
        }
    }
}

function PressEnterGo(elementid,e)
{
    if(window.event) // IE
    {
        keynum = window.event.keyCode;
    }
    else if(e.which) // Netscape/Firefox/Opera
    {
        keynum = e.keyCode;
    }
    if(keynum==13)
    {
        if(document.all)     
        {
            //这两句话很重要缺少的话执行会出错
            event.keyCode = 9;
            event.returnValue = false;
            
            document.getElementById(elementid).click();
        }   
        else   
        {
//            alert('firefox');
            var e = document.createEvent('MouseEvent');
            e.initEvent('click',false,false);
            document.getElementById(elementid).dispatchEvent(e);
        }
    }
}

function IgnoreEnterEvent(e)
{
    if(window.event) // IE
    {
        keynum = window.event.keyCode;
    }
    else if(e.which) // Netscape/Firefox/Opera
    {
        keynum = e.keyCode;
    }
    if(keynum==13)
    {
        if(document.all)     
        {
            window.event.keyCode = 9;   
        }   
        else   
        {
            e.preventDefault();
            return false;
        }
    }
}

function getCalendarWindow(elementid,url)
{
    var controlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(elementid) != -1)
        {
            controlID = document.forms[0].elements[i].id.replace(elementid,'');
            break;
        }
    }
    var objCalendar=document.getElementById(controlID+elementid);
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:250px; dialogHeight:260px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
		    objCalendar.value =controlWindow;
		    objCalendar.fireEvent("onblur");
//		    objCalendar.focus();
	    } 
    }
    else//FireFox
    {
        var strPara = "height=250,width=260,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            window.document.getElementById(controlID+elementid).value=strResult;
            window.document.getElementById(controlID+elementid).fireEvent("onblur");
//            window.document.getElementById(controlID+elementid).focus();
        }
//        window.onclick=function(){DialogWin.focus()};
//        event.cancelBubble = true;
    }
}

function OpenModalDialogNormal(url,height,width,scroll)
{
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:"+height+"; dialogHeight:"+width+"; status:0; help:0; scroll:"+scroll+";resizable:no");
    }
    else//FireFox
    {
        var strPara = "height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scroll="+scroll+",resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
    }
}

function RefreshParentFormByModalDialog()
{
    window.dialogArguments.location.reload();
}

function OpenModalDialog(elementid,url,height,width,scroll)
{
    var controlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(elementid) != -1)
        {
            controlID = document.forms[0].elements[i].id.replace(elementid,'');
            break;
        }
    }
    var objCalendar=document.getElementById(controlID+elementid);
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:"+height+"; dialogHeight:"+width+"; status:0; help:0; scroll:"+scroll+";resizable:no");
        if (controlWindow!=null)	
	    {
		    objCalendar.value =controlWindow;
		    objCalendar.focus();
	    } 
    }
    else//FireFox
    {
        var strPara = "height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scroll="+scroll+",resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            window.document.getElementById(controlID+elementid).value=strResult;
            window.document.getElementById(controlID+elementid).focus();
        }
//        window.onclick=function(){DialogWin.focus()};
//        event.cancelBubble = true;
    }
}

function OpenModalDialogTwoControl(elementid1,elementid2,url,height,width,scroll)
{
    var controlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(elementid2) != -1)
        {
            controlID = document.forms[0].elements[i].id.replace(elementid2,'');
            break;
        }
    }
    var objControl1=document.getElementById(controlID + elementid1);
    var objControl2=document.getElementById(controlID + elementid2);
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:"+height+"; dialogHeight:"+width+"; status:0; help:0; scroll:"+scroll+";resizable:no");
        
        if (controlWindow!=null)	
	    {
	        var ReturnResult =controlWindow.split("|");	
		    objControl1.value =ReturnResult[1];
		    objControl2.value =ReturnResult[0];
	    } 
    }
    else//FireFox
    {
        var strPara = "height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scroll="+scroll+",resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            var ReturnResult =strResult.split("|");	
            window.document.getElementById(controlID+elementid1).value=ReturnResult[1];    
            window.document.getElementById(controlID+elementid2).value=ReturnResult[0];    
        }
    }
}

//上传附件
function UploadAttachment(Element_AttID,Element_AttTitle,Url)
{
    var ControlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(Element_AttID) != -1)
        {
            ControlID = document.forms[0].elements[i].id.replace(Element_AttID,'');
            break;
        }
    }
    var objElement_AttID=document.getElementById(ControlID+Element_AttID);
    var objElement_AttTitle=document.getElementById(ControlID+Element_AttTitle); 
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url+"&ID="+objElement_AttID.value,window, "dialogWidth:500px; dialogHeight:380px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
	        var ReturnResult =controlWindow.split("|");	
		    objElement_AttID.value =ReturnResult[0];		    
		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=380,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url+"&ID="+window.document.getElementById(ControlID+Element_AttID).value,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {    
            var ReturnResult =strResult.split("|");	
            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];          
            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    }
}

//删除附件
function DeleteAttachment(Element_AttID,Element_AttTitle,Url)
{
    var ControlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(Element_AttID) != -1)
        {
            ControlID = document.forms[0].elements[i].id.replace(Element_AttID,'');
            break;
        }
    }
    var objElement_AttID=document.getElementById(ControlID+Element_AttID);
    var objElement_AttTitle=document.getElementById(ControlID+Element_AttTitle); 
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url+"&ID="+objElement_AttID.value,window, "dialogWidth:500px; dialogHeight:280px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
	        if (controlWindow=="True")
	       { 	
		        objElement_AttID.value ="0";
		        objElement_AttTitle.value="";
		   } 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=280,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url+"&ID="+objElement_AttID.value,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            if (strResult=="True")
	       { 	
		        window.document.getElementById(ControlID+Element_AttID).value="0";
                window.document.getElementById(ControlID+Element_AttTitle).value="";     
		   }                             
        }
    }
}
function AttachmentUrl(Element_AttID)
{
    var ControlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(Element_AttID) != -1)
        {
            ControlID = document.forms[0].elements[i].id.replace(Element_AttID,'');
            break;
        }
    }
    var objElement_AttID=document.getElementById(ControlID+Element_AttID);   
    if(window.document.all)//IE
    {
   if (objElement_AttID.value!=0)
   {
    window.location.href='../DownloadAttachment.aspx?ID='+ objElement_AttID.value;
   } 

    }
    else//FireFox
    {
   if (window.document.getElementById(ControlID+Element_AttID).value!=0) 
   {
        window.location.href='../DownloadAttachment.aspx?ID='+ window.document.getElementById(ControlID+Element_AttID).value;
        }
    }
}

function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,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; }
}


//*********Div实时滚动函数*********
function ScrollDiv(elementId)
{
    var posX,posY;
    if (window.innerHeight) {
        posX = window.pageXOffset;
        posY = window.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop) {
        posX = document.documentElement.scrollLeft;
        posY = document.documentElement.scrollTop;
    }
    else if (document.body) {
        posX = document.body.scrollLeft;
        posY = document.body.scrollTop;
    }

    var ad=document.getElementById(elementId);
    ad.style.top=(posY+82)+"px";
    ad.style.right=(posX+20)+"px";
    setTimeout("ScrollDiv('"+elementId+"')",180);
}
//*********Div实时滚动函数*********

function ExceedCapitalConfirm(element,strHelp)
{
    if (verifyDecimal92Help(element.value))
    {
        if(parseFloat(element.value)>1000)
        {
            alert(strHelp);
//            if (!confirm(strHelp))
//	        {
//		        element.value = "";
//		        element.focus();
//	        }
	    }
    }
}

function verifyDecimal92Help(strData)
{
    var pattern = /^\s*\d{1,9}(\.\d{1,2})?\s*$/;
    if(pattern.test(strData))
    {
        return true;
    }
    else
    {
        return false;
    }
}

function SelectBatch(elementid,url)
{
    var controlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(elementid) != -1)
        {
            controlID = document.forms[0].elements[i].id.replace(elementid,'');
            break;
        }
    }
    var objCalendar=document.getElementById(controlID+elementid);
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:500px; dialogHeight:550px; status:0; help:0; scroll:auto;resizable:auto");
        if (controlWindow!=null)	
	    {
		    objCalendar.value =controlWindow;
		    objCalendar.fireEvent("onblur");
//		    objCalendar.focus();
	    } 
    }
    else//FireFox
    {
        var strPara = "height=550,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=auto,resizable=auto,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            window.document.getElementById(controlID+elementid).value=strResult;
            
            window.document.getElementById(controlID+elementid).fireEvent("onblur");
        }
    }
}

function GetCheckResult(elementid,url)
{
    var controlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(elementid) != -1)
        {
            controlID = document.forms[0].elements[i].id.replace(elementid,'');
            break;
        }
    }
    var objCalendar=document.getElementById(controlID+elementid);
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(url,window, "dialogWidth:350px; dialogHeight:280px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
		    objCalendar.value =objCalendar.value+controlWindow;
		    objCalendar.fireEvent("onblur");
//		    objCalendar.focus();
	    } 
    }
    else//FireFox
    {
        var strPara = "height=550,width=300,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            window.document.getElementById(controlID+elementid).value=window.document.getElementById(controlID+elementid).value+strResult;
            
            window.document.getElementById(controlID+elementid).fireEvent("onblur");
        }
    }
}

function changedate(getdate)
{
    var transition_month=getdate.substr(0,getdate.lastIndexOf('-'));
    var month=transition_month.substr(transition_month.lastIndexOf('-')+1,transition_month.length);
    if (month.indexOf('0')==0)
    {
        month=month.substr(1,month.length);
    }
    // 下面操作获得日期
    var day=getdate.substr(getdate.lastIndexOf('-')+1,getdate.length);
    var day=day.substr(0,day.lastIndexOf(' '));

    if (day.indexOf('0')==0)
    {
        day=day.substr(1,day.length);
    }
    if (month<10)
    {
        month="0"+month;
    }
    if (day<10)
    {
        day="0"+day;
    }
    document.write(month+"-"+day);
}


function ChkAllSelect()
{
    for (var i=0;i<document.forms[0].length;i++)
    {
        var e=document.forms[0].elements[i];
	    if ((e.name.indexOf('GriChk')>=0) && (e.type=='checkbox'))
	    {
		    e.checked=document.forms[0].GriAllChk.checked;
		    ChkProjects(e);
	    }
    }
}
function ChkProjects(ChkElement)
{
    var SelectProjects="";
    var element;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf("HidPageCheck") >= 0)
        {
            element = document.forms[0].elements[i];
        }
    }
    SelectProjects = element.value;
    
    if(SelectProjects == "")
    {
        if(ChkElement.checked)
        {
            SelectProjects = ChkElement.value+ ",+";
        }
        else
        {
            SelectProjects = ChkElement.value+ ",-";
        }
    }
    else
    {
        if(SelectProjects.indexOf(ChkElement.value) >= 0)
        {
            if(ChkElement.checked)
            {
                if(SelectProjects.indexOf(ChkElement.value + ",-") >= 0)
                {
                    SelectProjects = SelectProjects.replace(ChkElement.value + ",-",ChkElement.value + ",+");
                }
            }
            else
            {
                if(SelectProjects.indexOf(ChkElement.value + ",+") >= 0)
                {
                    SelectProjects = SelectProjects.replace(ChkElement.value + ",+",ChkElement.value + ",-");
                }
            }
        }
        else
        {
            if(ChkElement.checked)
            {
                SelectProjects += "|" + ChkElement.value+ ",+";
            }
            else
            {
                SelectProjects += "|" + ChkElement.value+ ",-";
            }
        }
    }
    element.value = SelectProjects;
    return;
}

function ChkAllBatch()
{
    for (var i=0;i<document.forms[0].length;i++)
    {
        var e=document.forms[0].elements[i];
	    if ((e.name.indexOf('GriChk')>=0) && (e.type=='checkbox'))
	    {
		    e.checked=document.forms[0].GriAllChk.checked;
		    ChkItems(e);
	    }
    }
}

////
function CheckFormAllItem()
{
    for (var i=0;i<document.forms[0].length;i++)
    {
        var e=document.forms[0].elements[i];
	    if ((e.name.indexOf('GriChk')>=0) && (e.type=='checkbox'))
	    {
		    e.checked=document.forms[0].GriAllChk.checked;
		   
	    }
    }
}

////
function ChkItems(ChkElement)
{
    var SelectProjects="";
    var element;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf("HidPageCheck") >= 0)
        {
            element = document.forms[0].elements[i];
        }
    }
    SelectProjects = element.value;
    
    if(SelectProjects == "")
    {
        if(ChkElement.checked)
        {
            SelectProjects = ChkElement.value;
        }
    }
    else
    {
        if(SelectProjects.indexOf(ChkElement.value) >= 0)
        {
            if(!ChkElement.checked)
            {
                if(SelectProjects.indexOf(ChkElement.value + ",") >= 0)
                {
                    SelectProjects = SelectProjects.replace(ChkElement.value + ",", "");
                }
                else if(SelectProjects.indexOf("," + ChkElement.value) >= 0)
                {
                    SelectProjects = SelectProjects.replace("," + ChkElement.value, "");
                }
                else
                {
                    SelectProjects = "";
                }
            }
        }
        else
        {
            if(ChkElement.checked)
            {
                SelectProjects += "," + ChkElement.value;
            }
        }
    }
    element.value = SelectProjects;
    return;
}


function SelectBatchForStat(Element_AttID,Element_AttTitle,Url)
{
    var ControlID;
    for(var i=0;i<document.forms[0].elements.length;i++)
    {
        if(document.forms[0].elements[i].id.indexOf(Element_AttID) != -1)
        {
            ControlID = document.forms[0].elements[i].id.replace(Element_AttID,'');
            break;
        }
    }
    var objElement_AttID=document.getElementById(ControlID+Element_AttID);
    var objElement_AttTitle=document.getElementById(ControlID+Element_AttTitle); 
    if(window.document.all)
    {
        var controlWindow=window.showModalDialog(Url,window, "dialogWidth:500px; dialogHeight:320px; status:0; help:0; scroll:auto;resizable:auto");
        if (controlWindow!=null)	
	    {
	        var ReturnResult =controlWindow.split("|");	
		    objElement_AttID.value =ReturnResult[0];
		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=320,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=auto,resizable=auto,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {
            var ReturnResult =strResult.split("|");	
            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];
            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    }
}
//分配专家
function SelectExperts(Url)
{
    var ControlID;    
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url,window, "dialogWidth:1000px; dialogHeight:800px; status:0; help:0; scroll:auto;resizable:auto");
        if (controlWindow!=null)	
	    {
//	        var ReturnResult =controlWindow.split("|");	
//		    objElement_AttID.value =ReturnResult[0];		    
//		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=800,width=800,status=no,toolbar=no,menubar=no,location=no,scroll=auto,resizable=auto,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {    
//            var ReturnResult =strResult.split("|");	
//            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];          
//            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    }
   } 
   
function SetExpertReviewDate(Url)
{
    var ControlID;    
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url,window, "dialogWidth:500px; dialogHeight:300px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
//	        var ReturnResult =controlWindow.split("|");	
//		    objElement_AttID.value =ReturnResult[0];		    
//		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=300,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {    
//            var ReturnResult =strResult.split("|");	
//            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];          
//            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    } 
}


function SelectGroup(Url)
{
    var ControlID;    
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url,window, "dialogWidth:600px; dialogHeight:500px; status:0; help:0; scroll:auto;resizable:auto");
        if (controlWindow!=null)	
	    {
//	        var ReturnResult =controlWindow.split("|");	
//		    objElement_AttID.value =ReturnResult[0];		    
//		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=500,width=600,status=no,toolbar=no,menubar=no,location=no,scroll=auto,resizable=auto,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {    
//            var ReturnResult =strResult.split("|");	
//            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];          
//            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    }
   } 
   
   
function JudgeDataLength(element,maxlength)
{
    var intLength=0
    fData = element.value
    for (var i=0;i<fData.length;i++)
    {
        if ((fData.charCodeAt(i) < 0) || (fData.charCodeAt(i) > 255))
            intLength=intLength+2
        else
            intLength=intLength+1    
    }
    if(intLength>maxlength)
    {
        alert('输入的文字太多超出允许范围，请核对！');
        element.focus()
    }
}



function GetStatValue(Url)
{
    var ControlID;    
    if(window.document.all)//IE
    {
        var controlWindow=window.showModalDialog(Url,window, "dialogWidth:500px; dialogHeight:300px; status:0; help:0; scroll:no;resizable:no");
        if (controlWindow!=null)	
	    {
//	        var ReturnResult =controlWindow.split("|");	
//		    objElement_AttID.value =ReturnResult[0];		    
//		    objElement_AttTitle.value=ReturnResult[1]; 
	    } 
    }
    else//FireFox
    {
        var strPara = "height=300,width=500,status=no,toolbar=no,menubar=no,location=no,scroll=no,resizable=no,dialog=yes";
        window.myAction=this;
        var DialogWin=window.open(Url,"myOpen",strPara,true);
        this.returnAction=function(strResult)
        {    
//            var ReturnResult =strResult.split("|");	
//            window.document.getElementById(ControlID+Element_AttID).value=ReturnResult[0];          
//            window.document.getElementById(ControlID+Element_AttTitle).value=ReturnResult[1];  
        }
    } 
}


function ChangeRadioButtonListColor(e)
{
    e.style.backgroundColor = "LightSteelBlue";
}