function show_sq(v,cfcity,ddcity,qhbh,qcw,qhkgs,ks,js){
  //var screen_pos_zz=getPageSize();
  try{	
  		document.getElementById("tipsyxq").innerHTML='（该特价机票的有效日期为：'+ks+' 至 '+js+'）';
		document.getElementById("tipstj").style.display="none";
		}catch(e){
		}
  document.getElementById('cfcity').value=cfcity;
  document.getElementById('ddcity').value=ddcity;
  document.getElementById('hbh').value=qhbh;
  document.getElementById('cw').value=qcw;
  document.getElementById('hkgs').value=qhkgs;
   document.getElementById('ks').value=ks;
  document.getElementById('js').value=js;
  try{
  document.getElementById('triptype').value=v;
  }catch(e){
  }
  document.ticketReSearch.triptype.value=v;
   document.getElementById('div1').style.display='';
   
   document.getElementById("tjf").style.display="none";
   document.getElementById("tjz").style.display="none";
   try{
  triptype[v-1].checked=true;
  	}catch(e){
  }
  moveit();
}

function show_gqdiv(){
   document.getElementById('tologin').style.display='';
   gqdiv();
}

function show_sq_no_div(v,cfcity,ddcity,qhbh,qcw,qhkgs,ks,js){
  document.getElementById('cfcity').value=cfcity;
  document.getElementById('ddcity').value=ddcity;
  document.getElementById('hbh').value=qhbh;
  document.getElementById('cw').value=qcw;
  document.getElementById('hkgs').value=qhkgs;
  document.getElementById('ks').value=ks;
  document.getElementById('js').value=js;
  document.getElementById('triptype').value=v;
  document.getElementById("cfdate").value=ks;
  try{
  triptype[v-1].checked=true;
  	
  	}catch(e){
  }
  
  lockScreenticket("正在查询航班数据，请稍候......");
  document.ticketReSearch.submit();
}

function moveit() //这个函数用于把层放到浏览器中间
{
var divId=document.getElementById('div1');
	if(document.documentElement.scrollTop!=0 || document.documentElement.clientWidth!=0){
		divId.style.left=(document.documentElement.clientWidth-divId.clientWidth)/2+document.documentElement.scrollLeft;
		divId.style.top=(document.documentElement.clientHeight-divId.clientHeight)/2+document.documentElement.scrollTop;
	}else{
		divId.style.left=(document.body.clientWidth-divId.clientWidth)/2+document.body.scrollLeft;
		divId.style.top=(document.body.clientHeight-divId.clientHeight)/2+document.body.scrollTop;
	}
}

function gqdiv() //这个函数用于把层放到浏览器中间
{
var divId=document.getElementById('tologin');
	if(document.documentElement.scrollTop!=0 || document.documentElement.clientWidth!=0){
		divId.style.left=(document.documentElement.clientWidth-divId.clientWidth)/2+document.documentElement.scrollLeft;
		divId.style.top=(document.documentElement.clientHeight-divId.clientHeight)/2+document.documentElement.scrollTop;
	}else{
		divId.style.left=(document.body.clientWidth-divId.clientWidth)/2+document.body.scrollLeft;
		divId.style.top=(document.body.clientHeight-divId.clientHeight)/2+document.body.scrollTop;
	}
}

function show_sq_wfc(v,cfcity,ddcity,zzcity,qhbh,hhbh,qcw,qhkgs,zclx,ks,js,pj,fcpj){
 if(zclx=='1'){
 	document.getElementById("tjf").style.display="none";
 		document.getElementById("tjz").style.display="";
 		zclx='3';
 		 document.getElementById('cfcity').value=cfcity;
  document.getElementById('ddcity').value=zzcity;
  document.getElementById('zzcity').value=ddcity;
   try{
  selectTriptype('3');
  }catch(e){
  }
 }else if(zclx=='2'){
 	document.getElementById("tjz").style.display="none";
 		document.getElementById("tjf").style.display="";
 		document.getElementById('hbh').value=qhbh;
 		document.getElementById('hhbh').value=hhbh;
 		 document.getElementById('cfcity').value=cfcity;
  document.getElementById('ddcity').value=ddcity;
  
  try{
  	 selectTriptype('2');
  }catch(e){
  }
  //document.getElementById('zzcity').value=zzcity;
 }else{
 	alert("缺口程不能在此预订,请在黑屏里面操作！");
 	return;
 }
    document.getElementById('ks').value=ks;
  document.getElementById('js').value=js;
  document.getElementById('triptype').value=zclx;
  document.getElementById('cw').value=qcw;
  document.getElementById('hkgs').value=qhkgs;
    document.getElementById('div1').style.display='';
    document.getElementById('ddpj').value=pj;
    document.getElementById('wfcddpj').value=fcpj;
  moveit();

}
function commitBook(){
	 var cfdate=document.getElementById("cfdatezc").value;
	 var zzdate=document.getElementById("zzdatezc").value;
	 var fcdate=document.getElementById("fcdatezc").value; 
  if(cfdate>=document.getElementById('ks').value && cfdate<=document.getElementById('js').value){
	   	document.getElementById("cfdate").value=cfdate;
	   	document.ticketReSearch.cfdate.value=cfdate;
	   	document.getElementById("zzdate").disabled=false;
	   	document.getElementById("fcdate").disabled=false;
	   	document.getElementById("zzdate").value=zzdate;
	   	document.getElementById("fcdate").value=fcdate;
	   	try{
	   	//分销平台里面选择乘机人类型，用来区分平台成人、儿童政策
	   	var contype=document.getElementById("contype").value; 
	   	document.getElementById("contype").value=contype;
	   	lockScreenticket("正在查询航班数据，请稍候......");
	   	}catch(e){};
		document.ticketReSearch.submit();
	}else{
		try{
		document.getElementById("tipstj").style.display="block";
		}catch(e){
		alert("出发日期不在有效日期内！请重新选择！");
		}
	}
}
function drag(o,s)
{
if (typeof o == "string") o = document.getElementById(o);
o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;
o.orig_y = parseInt(o.style.top) - document.body.scrollTop;
o.orig_index = o.style.zIndex;
o.onmousedown = function(a)
{
  this.style.cursor = "move";
  this.style.zIndex = 20;
  var d=document;
  if(!a)a=window.event;
  var x = a.clientX+d.body.scrollLeft-o.offsetLeft;
  var y = a.clientY+d.body.scrollTop-o.offsetTop;
  //author: www.longbill.cn
  d.ondragstart = "return false;"
  d.onselectstart = "return false;"
  d.onselect = "document.selection.empty();"
    
  if(o.setCapture)
   o.setCapture();
  else if(window.captureEvents)
   window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
  d.onmousemove = function(a)
  {
   if(!a)a=window.event;
   o.style.left = a.clientX+document.body.scrollLeft-x;
   o.style.top = a.clientY+document.body.scrollTop-y;
   o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;
   o.orig_y = parseInt(o.style.top) - document.body.scrollTop;
  }
  d.onmouseup = function()
  {
   if(o.releaseCapture)
    o.releaseCapture();
   else if(window.captureEvents)
    window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
   d.onmousemove = null;
   d.onmouseup = null;
   d.ondragstart = null;
   d.onselectstart = null;
   d.onselect = null;
   o.style.cursor = "normal";
   o.style.zIndex = o.orig_index;
  }
}

if (s)
{
  var orig_scroll = window.onscroll?window.onscroll:function (){};
  window.onscroll = function ()
  {
   orig_scroll();
   o.style.left = o.orig_x + document.body.scrollLeft;
   o.style.top = o.orig_y + document.body.scrollTop;
  }
}
} 
function change_place(index,length){
	for(var i=1;i<=length;i++){
		document.getElementById("span_city_"+i).setAttribute("className","index_jp1");
		document.getElementById("TABLE_CITYS_"+i).style.display="none";
	}
	document.getElementById("span_city_"+index).setAttribute("className","index_jp2");
	document.getElementById("TABLE_CITYS_"+index).style.display="";
	
}
function change_place1(index,length,className,className1){
	for(var i=1;i<=length;i++){
		document.getElementById("span_city_"+i).setAttribute("className",className);
		document.getElementById("TABLE_CITYS_"+i).style.display="none";
	}
	document.getElementById("span_city_"+index).setAttribute("className",className1);
	document.getElementById("TABLE_CITYS_"+index).style.display="";
	
}
