
//ajax调用
var xmlt,isIE;
/*      var mouse_x
      var mouse_y
      window.document.onmousemove=function(evt){
      	evt=evt || window.event;
      	mouse_x=evt.clientX;
      	mouse_y=evt.clientY;

      }
	  */
var mdiv=document.createElement("div"),timeOut98=null,currentDiv;
function rmtips(){
	try {
		if(timeOut98){window.clearTimeout(timeOut98);timeOut98=null}
		if(mdiv){document.body.removeChild(mdiv);}
	}catch(e){
		//alert(e);
	}
		
}
function ycrmtips(){
	window.clearTimeout(timeOut98);
	timeOut98=window.setTimeout('rmtips()',100);
}
//动态生成提示框
function tips(a,b,c,e,f){
	    var html='';
		mdiv.className='zn_room_tips1';
		mdiv.style.width=c+'px'
		mdiv.style.left=(gL(a)-parseInt(mdiv.style.width)/2+e)+'px';		
	    html+=b;
	    mdiv.innerHTML=html;
	    rmtips();		
	    a.onmouseout=ycrmtips;
	    document.body.appendChild(mdiv);	
	    mdiv.style.top=(gT(a)+f)+'px';
}

function _g(id){return document.getElementById(id)}
function gL(x){var l=0;while(x){l+=x.offsetLeft;x=x.offsetParent;}return l}
function gT(x){var t=0;while(x){t+=x.offsetTop;x=x.offsetParent;}return t}
  
	  

 
 //机型开始
 function showFlightType(FlightType,currentThis)
{    
	
	currentDiv=_g(currentThis+'');

     if(window.XMLHttpRequest)
	  {
	   isIE = false;
	   xmlt = new XMLHttpRequest();
	  }
	 else if(window.ActiveXObject)
	 {
		isIE = true;
		xmlt = new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 xmlt.onreadystatechange = showFlightTypeGet;
	 try
	   {
	      xmlt.open("GET", "/flight/getFlightType.asp?FlightCode="+FlightType+"&nocache=" + Math.random(),false);
          xmlt.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");//没有这句就玩不转
		  xmlt.send(null);
	   }
	  catch(e){}
}
function showFlightTypeGet()
{   //alert(xmlt.responseText);
	
   if(xmlt.readyState == 4)
    {
	 if(xmlt.status == 200)
	   {
      	tips(currentDiv,xmlt.responseText,350,10,20);
	   }
	 }
}

 //机型结束



  //退改签开始
 function showVisor(Visor,currentThis)
{    
	currentDiv=_g(currentThis+'');
     if(window.XMLHttpRequest)
	  {
	   isIE = false;
	   xmlt = new XMLHttpRequest();
	  }
	 else if(window.ActiveXObject)
	 {
		isIE = true;
		xmlt = new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 xmlt.onreadystatechange = showVisorGet;
	 try
	   {
	      xmlt.open("GET", "/flight/ShowVisor.asp?"+Visor+"&nocache=" + Math.random(),false);
          xmlt.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");//没有这句就玩不转
		  xmlt.send(null);
	   }
	  catch(e){}
}
function showVisorGet()
{   //alert(xmlt.responseText);
   if(xmlt.readyState == 4)
    {
	 if(xmlt.status == 200)
	   {
			tips(currentDiv,xmlt.responseText,150,20,20);
	   }
	 }
}

 
 //经停开始
function showtransit(scty,ecty,carr,flno,currentThis)
{ 
	currentDiv=_g(currentThis+'');
     if(window.XMLHttpRequest)
	  {
	   isIE = false;
	   xmlt = new XMLHttpRequest();
	  }
	 else if(window.ActiveXObject)
	 {
		isIE = true;
		xmlt = new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 xmlt.onreadystatechange = showtransitget;
	 try
	   {
	      xmlt.open("GET", "/flight/transit.asp?Startcity="+scty+"&Endcity="+ecty+"&carrier="+carr+"&flightNo="+flno+"&nocache=" + Math.random(),false);
          xmlt.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");//没有这句就玩不转
		  xmlt.send(null);
	   }
	  catch(e){}
}
function showtransitget()
{   //alert(xmlt.responseText);
   if(xmlt.readyState == 4)
    {
	 if(xmlt.status == 200)
	   {
			tips(currentDiv,xmlt.responseText,150,20,20);
	   }
	 }
}

