  //用于动态生成多行数据弹DIV
  function ffx(id)//选择
    {
  var hf=document.getElementById("hf1");
 hf.value=id;

 var t=document.getElementById("t_"+id);
      with (document.getElementById("div_111").style)
      {      
      //display = "block"; left = p[0] + 100 + "px"; top = p[1] + 100 + "px";    
   var pos = getPosition(t);
     display = "block"; left = pos.X -1 + "px"; top = pos.Y+18 + "px";  
   
      }
    }
    
    function ff(text,value)//赋�?
    {
   var hf=document.getElementById("hf1");
     var t=document.getElementById("t_"+hf.value);
   t.value=text;
   var v=document.getElementById("v_"+hf.value);
   v.value=value;

    }
      
    function ffclose()//关闭按钮
    { 
     var dr1=document.getElementById("DropDownList2");
    dr1.selectedIndex=0;

     var l=document.getElementById("ListBox2");
for(i=l.length-1;i>=0;i--) 

{ 

l.remove(i); 
} 


showInfo.hideLayer(event,div_111);
 
    }
    
    
    function listbox_DoubleClick()
    {
    // $("#Button3").click();
    ff_choose();
    
    }

function ff_clear()//清空按钮
{
   var dr1=document.getElementById("DropDownList2");
       dr1.selectedIndex=0;
  var l=document.getElementById("ListBox2");
for(i=l.length-1;i>=0;i--) 
{ 
l.remove(i); 
} 

}

function ff_choose()
{
  var hf=document.getElementById("hf1");
  
  
   var l=document.getElementById("ListBox2");
   
var str_text= "";
var str_value=""; 
if (l.options.length > 0)
{
    for(var i=0;i<l.options.length;i++)   
        {   
          if(l.options[i].selected)   
          {   
			  //str=l.options[i].text+":"+l.options[i].value;
              str_text=l.options[i].text;
              str_value=l.options[i].value;
            break;   
          }
         
         } 
		 if (str_text!="" && str_value!="")
		 {
		   var t=document.getElementById("t_"+hf.value);
    t.value=str_text;
    var v=document.getElementById("v_"+hf.value);
    v.value=str_value;
		// showInfo.hideLayer(event,div_111);
	ffclose(); 
		 }
		 else
	    {
		  alert("请选择教师!!");
		 }

}
else
{
alert('请选择部门!!');
}
//document.getElementById( "select1 ").options[document.getElementById( "select1 ").selectedIndex].text
 

}

  function ffxx()
    {
 
    xmlsend();
 
 
    }
 //---------------------------------------------------------------------   

         var showInfo = new function ()
     { this.showLayer = function (e, id) 
     

     
     { 
     var t=document.getElementById("TextBox1");
       
  
     
     var p = window.event ? [event.clientX, event.clientY] : [e.pageX, e.pageY]; 
     
     with (document.getElementById("div_111").style)
      { 
      
      //display = "block"; left = p[0] + 100 + "px"; top = p[1] + 100 + "px"; 
      
        var pos = getPosition(t);
      
      display = "block"; left = pos.X+1  + "px"; top = pos.Y+19 + "px"; 
      
      
      
      }
       if (window.event) { window.event.cancelBubble = true; } 
       else
        { if (e) { e.preventDefault(); } } };
         this.hideLayer = function (e, id) 
         { with (document.getElementById("div_111").style)
          { display = "none"; }
           if (window.event) 
           { window.event.cancelBubble = true; }
            else
             { if (e) { e.preventDefault(); 
             } 
             }
              };
               }; 
               
        function getPosition(e)
{
    var left = 0;
    var top = 0;
    var scroll = e;
    //璁＄畻浣嶇疆
    while(e)
    {
        left += e.offsetLeft;
        top += e.offsetTop;
        e = e.offsetParent
    }
    //婊氬姩鏉′綅�?
    while(scroll)
    {
        if (scroll.scrollLeft){left = left;}
        if (scroll.scrollTop){top = top;}//scroll.scrollTop
        scroll = scroll.parentElement
    }
    return {X:left,Y:top}
}
function showPosition(e)
{
    var pos = getPosition(e)
    alert(pos.X);
    alert(pos.Y);
}    



