// JavaScript Document
 function searchclick(sword){

 if(sword==1) {
 if (document.getElementById("sta").value==""){
 alert("请输入专线出发省份");
 return false;}
 if (document.getElementById("sta").value=="请输入专线出发省份"){
   alert("请输入专线出发省或市");
 return false;
   }
 
 if (document.getElementById("ena").value==""){
 alert("请输入专线到达省份");
 return false;
 }
   if (document.getElementById("ena").value=="请输入专线到达省份"){
   alert("请输入专线到达省份");
 return false; 
   }
 
 window.open("search_zxxx.asp?kf="+ escape(document.getElementById("sta").value) +"&kt="+ escape(document.getElementById("ena").value))}
 else if(sword==2) {
    if (document.getElementById("sbsea").value==""){
	alert("请输入您要搜索的设备名称");
	return false;
	}
	if (document.getElementById("sbsea").value=="请输入您要搜索的设备名称"){
	alert("请输入您要搜索的设备名称");
	return false;
	}
 
    var sbqg;
    if (document.getElementsByName("sbgq_sort")[0].checked){
	 sbqg="供";
	}
	else{
	sbqg="求";
	}
  window.open("search_sbxx.asp?k="+ escape(document.getElementById("sbsea").value )+"&kt="+escape(sbqg))
  }
  else if (sword==3){
  
  if (document.getElementById("ccsea").value==""){
	alert("请输入您要搜索的仓储信息");
	return false;
	}
	if (document.getElementById("ccsea").value=="请输入您要搜索的仓储信息"){
	alert("请输入您要搜索的仓储信息");
	return false;
	}
  
       var ccqg;
    if (document.getElementsByName("ccgq_sort")[0].checked){
	 ccqg="供";
	}
	else{
	ccqg="求";
	}
  window.open("search_ccxx.asp?k="+ escape(document.getElementById("ccsea").value) +"&kt="+escape(ccqg))
    }
  
  else if (sword==4){
   if (document.getElementById("comsea").value==""){
	alert("请输入您要搜索的公司名称");
	return false;
	}
	if (document.getElementById("comsea").value=="请输入您要搜索的公司名称"){
	alert("请输入您要搜索的公司名称");
	return false;
	}
   var coma
   
   if (document.getElementById("comarea").value!="全国"){
   coma=document.getElementById("comarea").value;
   }
   else{
   coma="";
   }

  window.open("search_com.asp?k="+ escape(document.getElementById("comsea").value) +"&kt="+escape(coma))
  
  }
  
  
  
}  
function seaopt(obid){
  for (var i=1;i<5;i++)
  {
   document.getElementById("sea_"+i).style.display="none";
  }
  document.getElementById("sea_"+obid).style.display="block";
}



//__________________________________________________________________________________________________
 var closetime;
	  function showCity(textbox){
var tt=document.getElementById(textbox);
var divResult=document.getElementById("areshow")
var ttop  = tt.offsetTop;
var tleft = tt.offsetLeft;
while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
divResult.style.top = ttop+25;
divResult.style.display="block";
divResult.style.position = "absolute";

if (tleft+275>760+(screen.width-760)/2 ) tleft = 760+(screen.width-760)/2-285
		divResult.style.left = tleft;
		divResult.style.visibility = "visible";
		divResult.style.zIndex = 10000;

document.getElementById("chosebox").value=textbox;
closetime = window.setTimeout("hideCity()",8000);
}
function hideCity(){
document.getElementById("areshow").style.display="none";
window.clearTimeout(closetime);
}
function setcity(content){
var whoclick =document.getElementById("chosebox").value;
document.getElementById(whoclick).value=content;
hideCity()
}
//_______________________________________导航时间_____________________________________________________________

var clocktext;
var sec,hr,min;
function CurrentTime() { 
today = new Date(); 
year = today.getYear();  // 修改为today.getFullYear();
month = today.getMonth()+1;
if(month <= 9){month = "0" + month;}
day = today.getDate();
if(day <= 9){day = "0" + day;}
sec = today.getSeconds(); 
hr = today.getHours(); 
min = today.getMinutes(); 
if (hr <= 9) {hr = "0" + hr;} 
if (min <= 9) {min = "0" + min;} 
if (sec <= 9) {sec = "0" + sec;} 
var clocktext = " "+year+"年"+month+"月"+day +"日 "+ hr + ":" + min + ":" + sec ; 
clocktimer = setTimeout("CurrentTime()", 1000); 
var showtime=document.getElementById("time");
showtime.innerHTML = clocktext;   // 修改为showtime.innerHTML = clocktext; 
} 
function test( id , type )
{
	if( type == '1' )
		sta( document.getElementById( id ) );
	else
		ena( document.getElementById( id ) );
}
//-----------------------------------------------------------------------------------
var div_name="div_map";
var source_t;
var runner;
function openW(sh){
win_a=window.showModalDialog(sh,window,'scrollbars=no;resizable=no;help=no;status=no;center=yes;dialogHeight=400px;dialogWidth=450px;dialogTop: '+(screen.availHeight-400)/2+'; dialogLeft: '+(screen.availWidth-520)/2+';');
	if (win_a!=null&&win_a!='undefined'){
		document.getElementById(div_name).style.visibility="hidden";
		source_t.value=win_a;
		document.getElementById("mbDIV").style.display="none";
		
	}
	clearTimeout(runner);
}

function getSheng(str){
	if (str!=null&&str!='undefined'){
		document.getElementById(div_name).style.visibility="hidden";
		source_t.value=str;
		document.getElementById("mbDIV").style.display="none";
		
	}
	
}
function sta(obj){
		document.getElementById('div_map').style.display='block';
		source_t=obj;
		runner=setTimeout('hide_map()',120000);
		document.getElementById(div_name).style.visibility="visible";
		show("mbDIV");
}
function show(ele)
{
  document.getElementById(ele).style.display="";
 
}
function ena(obj){
		document.getElementById('div_map').style.display='block';
		source_t=obj;
		runner=setTimeout('hide_map',5000);
		document.getElementById(div_name).style.visibility="visible";
		show("mbDIV");
}
function hide_map(){
		document.getElementById(div_name).style.visibility="hidden";
}
function aa(){
document.getElementById("mbDIV").style.display="none";
}
function mapHidden(){
document.getElementById('div_map').style.visibility='hidden'
}
