﻿// JScript 文件
function Txt(s)
{
    var txt;
    switch (s)
    {
        case "Tidanhao":
            txt=document.getElementById("Ts");
            txt.value="";
            txt=document.getElementById("Xianghao");
            txt.value="";
            txt=document.getElementById("Blno");
            txt.value="";
            break;
        case "Xianghao":
            txt=document.getElementById("Tidanhao");
            txt.value="";
            txt=document.getElementById("Ts");
            txt.value="";
            txt=document.getElementById("Blno");
            txt.value="";
            break;
        case "Ts":
            txt=document.getElementById("Xianghao");
            txt.value="";
            txt=document.getElementById("Tidanhao");
            txt.value="";
            txt=document.getElementById("Blno");
            txt.value="";
            break;
       case "Blno":
            txt=document.getElementById("Xianghao");
            txt.value="";
            txt=document.getElementById("Ts");
            txt.value="";
            txt=document.getElementById("Tidanhao");
            txt.value="";
            break;
     }
}
   
function win_open(s,g)
{	var wtop=(window.screen.availHeight-550)/2
	var wleft=(window.screen.availWidth-700)/2
	var x_win=window.open('../web/xianghao.aspx?q=' +s+'&g='+g, 'x_w','menubar=no,status=no,scrollbars=yes,location=no,width=700,height=500,top=' + wtop + ',left='+ wleft)
	//showModelessDialog("../web/xianghao.aspx")
	x_win.focus()
	
	//if( document.all ) //IE 
    //{ 
    //	var feature="dialogWidth:700px;dialogHeight:500px;status:no;help:no"; 
	    //var x_win=window.showModalDialog('../web/xianghao.aspx?q=' +s+'&g='+g ,null,feature)
	//    var x_win=window.showModelessDialog('../web/xianghao.aspx?q=' +s+'&g='+g ,null,feature)
    //} 
    //else 
    //{ 
        //modelessDialog可以将modal换成dialog=yes 
    //    feature ="width=700,height=500,menubar=no,toolbar=no,location=no,"; 
    //    feature+="scrollbars=no,status=no,modal=yes"; 
    //    window.open('../web/xianghao.aspx?q=' +s+'&g='+g,null,feature); 
   // } 
} 

function win_open_st(s)
{	var wtop=(window.screen.availHeight-550)/2
	var wleft=(window.screen.availWidth-700)/2
	var x_win=window.open('../web/query_xianghao.aspx?q=' +s, 'x_w','menubar=no,status=no,scrollbars=yes,location=no,width=700,height=500,top=' + wtop + ',left='+ wleft)
	x_win.focus()
} 

function chpwd()
{	//alert(document.getElementById("yxweb_online1_3"));
	var wtop=(window.screen.availHeight-180)/2
	var wleft=(window.screen.availWidth-230)/2
	window.open('../web/chpwd.aspx','x_w','menubar=no,status=no,scrollbars=no,location=no,width=230,height=180,top=' + wtop + ',left=' + wleft )
	return false
}	

function close_chpwd(s)
{
	if (s!="")
	{
	    window.alert(s);
	    window.close();
	    //window.opener.location.href=window.opener.location.href;
	    window.opener.location.replace(window.opener.document.referrer);
	 }
	 else
	    window.close();
}	

function Grid_width(vGrid)
{
	var pGrid=null
	var tempGrid=null
	if (document.getElementById){
		pGrid=document.getElementById(vGrid)
		//document.all("line").style.width=pGrid.scrollWidth
		if (document.getElementById("Datagrid2"))
		{
		    document.all("Datagrid2").width=pGrid.scrollWidth
		 }
		 
		 if (document.getElementById("Datagrid3"))
		{
		    document.all("Datagrid3").width=pGrid.scrollWidth
		 }
		}
	else{
		eval('pGrid = ' + vGrid + ';')
	}
}

function cma(strimg,strdiv)
{
    var img=document.getElementById(strimg);
    var div=document.getElementById(strdiv);
    if (img.src.indexOf("down.ico")==-1)
    {
        img.src=img.src.replace("up.ico","down.ico");
        div.style.display="none";
     }
    else
    {
        img.src=img.src.replace("down.ico","up.ico");
        div.style.display="block";
     }
    
 }

