﻿// JScript 文件

        var xmlHttp = false;
        function oo(obj){
            return document.getElementById(obj);
        }
       function init(){
            try{
            window.open('App_Form/adLeft.aspx','','Height=333px Width=350px left=0px top=0px edge=Raised center=yes help=no resizable=yes toolbar=no location=no directories=no status=no menubar=no scrollbars=yes unadorned=no');
            //window.open('App_Form/adRight.aspx','','Height=300px Width=300px left='+parseInt(screen.width-310)+' top=0px edge=Raised center=yes help=no resizable=yes toolbar=no location=no directories=no status=no menubar=no scrollbars=yes unadorned=no');
            window.moveTo(0,0);
            window.resizeTo(screen.width,screen.height-27);
            oo("main").style.height=screen.height-600;
            }
            catch(e)
            { return false;}
        }
        function showcontact(){
            window.open('App_Form/companyinfo.aspx','','Height='+parseInt(screen.height)+' Width='+parseInt(screen.width)+' left=0px top=0px edge=Raised center=yes help=no resizable=yes toolbar=no location=no directories=no status=no menubar=no scrollbars=yes unadorned=no');
        }
        function toexcel(con,pr,condition)
        {
            window.open('App_Form/toexcel.aspx?con='+con+'&pr='+pr+'&condition='+condition,'','Height=300px Width=300px left=0px top=0px edge=Raised center=yes help=no resizable=yes toolbar=no location=no directories=no status=no menubar=no scrollbars=yes unadorned=no');
        }
        //创建一个XMLHTTP对象
        function createHttp(){
            @if (@_jscript_version >= 5)
            try {
              xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
              try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e2) {
                xmlHttp = false;
              }
            }
            @end 
            if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
              xmlHttp = new XMLHttpRequest();
            }
        }
        
        //显示品种
    	function DisplayPZ(strNo)
		{
		    try{
	        if (document.all.item("chkList"+strNo).style.display=='none')
	        {
		        document.all.item("chkList"+strNo).style.display='';//显示
	        }
	        else
	        {
	            
		        document.all.item("chkList"+strNo).style.display='none';//不显示
	        }
	        }
	        catch(e)
	        {
	        }
		}
        //选择品种
		function SelPZ(strNo)
		{
		    try
		    {
                if (document.all.item("chk"+strNo).checked==true)
                {
                    for(var i=0;i<document.getElementById("chkList"+strNo).rows.length*2;i++)
                    {
                         try
                         {    
                            document.getElementById("chkList"+strNo+"_"+i).checked=true;
                         }
                         catch(e)
                         {
                            continue;
                         }
  
                    }
                }
                else
                {
                    for(var i=0;i<document.getElementById("chkList"+strNo).rows.length*2;i++)
                    {
                         try
                         {    
                         document.getElementById("chkList"+strNo+"_"+i).checked=false;
                         }
                         catch(e)
                         {
                            continue;
                         }
                    }
                }
           }
	        catch(e)
	        {
	        }
		}
		//重置
		function resetlog(){
		    oo("txtUser").value="";
		    oo("txtPwd").value="";
		    oo("txtValid").value="";
		    oo("txtUser").focus()
		    return false;
		}
		//验证
		function ValidCheck(){
		    oo("lbError").innerHTML=""
		    if (oo("txtUser").value=="")
		    {
		        oo("lbError").innerHTML="请输入用户名。"
		        oo("lbError").style.display="";
		        oo("txtUser").focus();
		        
		        return false;
		    }
		    if (oo("txtPwd").value=="")
		    {
		        oo("lbError").innerHTML="请输入密码。"
		        oo("lbError").style.display="";
		        oo("txtPwd").focus();
		        return false;
		    }
		    if (oo("txtValid").value=="")
		    {
		        oo("lbError").innerHTML="请输入验证码。"
		        oo("lbError").style.display="";
		        oo("txtValid").focus();
		        return false;
		    }
		}
		
		//清空
		function resetbox(){
		    oo("dropName").value = "";
            oo("txtCs11").value  = "";
            oo("txtCs12").value = "";
            oo("txtCs21").value  = "";
            oo("txtCs22").value  = "";
            oo("txtCs31").value  = "";
            oo("txtCs32").value = "";
            oo("txtMater").value  = "";
            oo("dropCD").value = "";
            oo("dropWare").value  = "";
            oo("chk1").checked  = false;
            oo("chk2").checked = false;
            oo("chk3").checked = false;
            oo("chk4").checked = false;
            oo("chk5").checked = false;
            oo("chk6").checked= false;
            oo("chk7").checked = false;

            var inputs = document.all.tags("INPUT");
				for (var i = 0; i < inputs.length; i++)
　　			{　　
　　　				if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList1".length) == "chkList1" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList2".length) == "chkList2" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList3".length) == "chkList3" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList4".length) == "chkList4" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList5".length) == "chkList5" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList6".length) == "chkList6" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}
　　　　　			if (inputs[i].type == "checkbox" && inputs[i].id.substr(0,"chkList7".length) == "chkList7" )
　　　				{
　　　　　				inputs[i].checked = false;
　　　　　			}　　　　　			　　　　　			　　　　　			　　　　　			　　　　　			
　　　　		}
            oo("txtPrice1").value = "";
            oo("txtPrice2").value = "";
            oo("CompareValidator1").style.display="none";
            oo("CompareValidator2").style.display="none";
            oo("CompareValidator3").style.display="none";
            oo("CompareValidator4").style.display="none";
            oo("CompareValidator5").style.display="none";
            oo("CompareValidator6").style.display="none";
            oo("CompareValidator7").style.display="none";
            oo("CompareValidator8").style.display="none";
            oo("lbinfo").style.display="none";
            oo("imgwait").style.display="none";
            return false;
        }
        //显示登录界面
        function showlogin(){
            oo("tblogin").style.display="";
            oo("tbhead").style.display="";
            oo("tbbottom").style.display="";
            oo("tbsearch1").style.display="";
            oo("tbsearch").style.display="none";
            oo("tblogo").style.display="none";
            oo("tbresult").style.display="none";
            oo("txtUser").focus();
            oo("lbinfo").style.display="none";
            oo("imgwait").style.display="none";
        }
        //显示高级查询界面
        function showsearch(){
            
            oo("tbhead").style.display="none";
            oo("tbbottom").style.display="none";
            oo("tblogin").style.display="none";
            oo("tbsearch1").style.display="none";
            oo("tblogo").style.display="none";
            oo("tbresult").style.display="none";
            oo("tbsearch").style.display="";
            oo("lbinfo").style.display="none";
            oo("imgwait").style.display="none";
        }
        function showresult(type){
 
            try{
            oo("gView").style.display="none";
            }
            catch(e)
            {
            }
            oo("lbinfo").style.display="";
            oo("lbinfo").innerHTML="系统正在查询数据，请稍等......";
            oo("imgwait").style.display="";
            oo("tbhead").style.display="none";
            oo("tbbottom").style.display="none";
            oo("tblogin").style.display="none";
            oo("tblogo").style.display="none";
            if (type=="1")
            {
                oo("tbsearch").style.display="none";
                oo("tbsearch1").style.display="";
                }
            else{
                oo("tbsearch1").style.display="none";
                oo("tbsearch").style.display="";
                }
            oo("tbresult").style.display="";
        }
        
        var glb={}
        
        //中间菜单选择
		function MidMenu_sel(main,itype){
			glb.menu_Mid=oo(main)
			if(itype==0)//移出
				glb.menu_Mid.style.backgroundPosition=""
			else//移入
			{
				//glb.menu_Mid.className="bt4"
				glb.menu_Mid.style.backgroundPosition="0 19"
			}
		}