// JScript 文件

//隐藏左边的导航栏
function hid()
{
	var objEvent = event.srcElement;
	if(window.parent.fset.cols == "149,6,*")
	{
		window.parent.fset.cols = "0,8,*";
		objEvent.src = "image/rightHid.gif";
	}
	else
	{
		window.parent.fset.cols = "149,6,*";
		objEvent.src = "image/leftHid.gif";
	}
}

//弹出窗口
  function show(Type)
  {
     window.open("Show.aspx?Type=" + Type,"_blank","width=500,height=500,scrollbars=yes,status=no,resizable=yes,top=50");
  }

     //打开子窗口，并得到返回的值

    var sender;
    
    function GetPath()
    { 
        sender = window.open("select.aspx?FormName=form1&id=TextBox1","sender","width=500,height=500,scrollbars=yes,status=yes,resizable=yes,top=50"); 
    }
    
    function setPath(FormName,id,p)
    {
      eval('var theform = document.' + FormName + ';');
      theform.elements[id].value = p;
      sender.close();
    }
    
    //验证文件类型
     function validFile(uploadfileobj)
            {
               
                var obj = document.getElementById(uploadfileobj);
                var b = true;
                var s = obj.value.match(/[^\.]+$/);
                if(s == null)
                {
                    b = false;
                }
                else
                {
                    s = s.toString().toLowerCase()
                    switch(s)
                    {
                        case "aspx":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "asp":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "cs":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "vb":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "js":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "scc":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "dll":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "pdb":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "css":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "skin":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "exe":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "vbs":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "jscript":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "java":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "bat":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "asa":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "config":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "asax":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "sln":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "sou":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        case "vsscss":
                            alert("文件格式不正确!");
                            b = false;
                        break;
                        default:
                            b = true;
                        break;
                    }
                }
                 return b;
            }
    
