<!-- 

function SearchKeywords(form)
{
	var title=escape(trim(form.Title.value));
	var action=trim(form.Type.value);
	var AreaID=trim(form.AreaID.value);
	if(action=="")
	{
		alert("请选择栏目!");
		form.Type.focus();
		return false;
	}
	else if(title=="")
	{
		alert("请输入标题!");
		form.Title.focus();
		return false;
	}
	else
	{		
		document.location=action+"?City="+escape("上海")+"&AreaID="+AreaID+"&title="+title;
	}
}
 
 function SearchPlane()
 {
 var line=trim(document.frmPlane.line.value);
 var offCity=trim(document.frmPlane.offCity.value);
 var landCity=trim(document.frmPlane.landCity.value);
 var offCity2=trim(document.frmPlane.offCity2.value);
 var landCity2=trim(document.frmPlane.landCity2.value);
 if((offCity=="")&&(landCity=="")&&(offCity2!="")) offCity=offCity2;
 if((offCity=="")&&(landCity=="")&&(landCity2!="")) landCity=landCity2;
	if (CheckPlane())
	{		
		document.frmPlane.Off_City.value=offCity;
 		document.frmPlane.Land_City.value=landCity;
		document.frmPlane.target='_blank';
		document.frmPlane.submit();
		
	}
 }
 function Search_Plane(topic,type,keywords)
 {
	document.frmPlane.topic.value=topic;
	document.frmPlane.type.value=type;
	document.frmPlane.keywords.value=keywords;
	document.frmPlane.target='_blank';
	document.frmPlane.submit();
 } 
 
 function SearchTrain()
 {
 var ChuFa=trim(document.frmTrain.txtChuFa.value);
 var DaoDa=trim(document.frmTrain.txtDaoDa.value);
 var CheZhan=trim(document.frmTrain.txtCheZhan.value);
 var CheCi=trim(document.frmTrain.txtCheCi.value);
  if (CheckTrain())
  {
  	  document.frmTrain.Chu_Fa.value=ChuFa;
  	  document.frmTrain.Dao_Da.value=DaoDa;
  	  document.frmTrain.Che_Zhan.value=CheZhan;   
  	  document.frmTrain.Che_Ci.value=CheCi;  
	  document.frmTrain.target='_blank';
	  document.frmTrain.submit();
  }
 }
 
function Search_Train(topic,type)
{
  	
  	 document.frmTrain.topic.value=topic;   
     	 document.frmTrain.type.value=type;  
	 document.frmTrain.target='_blank';
	 document.frmTrain.submit(); 	
}

 function StayPlane(str)
 {
	switch(str)
	{
		case "line":
		
			document.frmPlane.offCity.value="";
			document.frmPlane.landCity.value="";
			document.frmPlane.offCity2.value="";
			document.frmPlane.landCity2.value="";			
			break;
		case "City":			
			document.frmPlane.line.value="";
			document.frmPlane.offCity2.value="";
			document.frmPlane.landCity2.value="";		
			break;
		case "offCity":			
				document.frmPlane.line.value="";
				document.frmPlane.offCity.value="";
				document.frmPlane.landCity.value="";	
				document.frmPlane.landCity2.value="";			
			break;
		case "landCity":
			
			document.frmPlane.line.value="";
			document.frmPlane.offCity.value="";
			document.frmPlane.landCity.value="";	
			document.frmPlane.offCity2.value="";			
			break;
	}	
}
  
  function StayTrain(str)
  {	
	switch(str)
	{
		case "Zhan":			
			document.frmTrain.txtCheCi.value="";
			document.frmTrain.txtCheZhan.value="";			
			break;
		case "CheCi":		
			document.frmTrain.txtChuFa.value="";
			document.frmTrain.txtDaoDa.value="";
			document.frmTrain.txtCheZhan.value="";		
			break;
		case "CheZhan":			
			document.frmTrain.txtChuFa.value="";
			document.frmTrain.txtDaoDa.value="";
			document.frmTrain.txtCheCi.value="";		
			break;
	 }	
 }	
 
 function CheckPlane()
{
	if(trim(document.frmPlane.offCity.value)!=""&&trim(document.frmPlane.landCity.value)=="")
	{
		alert("请输入到达地!");
		document.frmPlane.landCity.value="";
		document.frmPlane.landCity.focus();
		return false;
	}
	if(trim(document.frmPlane.landCity.value)!=""&&trim(document.frmPlane.offCity.value)=="")
	{
		alert("请输入出发地!");
		document.frmPlane.offCity.value="";
		document.frmPlane.offCity.focus();
		return false;
	}
	if(trim(document.frmPlane.offCity.value)==""&&trim(document.frmPlane.landCity.value)==""&&trim(document.frmPlane.line.value)==""&&trim(document.frmPlane.offCity2.value)==""&&trim(document.frmPlane.landCity2.value)=="")
	{
		alert("请输入查询条件!");
		document.frmPlane.line.value="";
		document.frmPlane.line.focus();
		return false;
	}
	return true;
}	

function CheckTrain()
{
	if(trim(document.frmTrain.txtChuFa.value)!=""&&trim(document.frmTrain.txtDaoDa.value)=="")
	{
		alert("请输入到达地!");		
		document.frmTrain.txtDaoDa.value="";
		document.frmTrain.txtDaoDa.focus();
		return false;
	}
	if(trim(document.frmTrain.txtDaoDa.value)!=""&&trim(document.frmTrain.txtChuFa.value)=="")
	{
		alert("请输入出发地!");		
		document.frmTrain.txtChuFa.value="";
		document.frmTrain.txtChuFa.focus();
		return false;
	}
	if(trim(document.frmTrain.txtCheCi.value)==""&&trim(document.frmTrain.txtChuFa.value)==""&&trim(document.frmTrain.txtCheZhan.value)==""&&trim(document.frmTrain.txtDaoDa.value)=="")
	{
		alert("请输入查询条件!");
		document.frmTrain.txtChuFa.value="";
		document.frmTrain.txtChuFa.focus();
		return false;
	}
	return true;
}

//预定机票
function bookPlane(offCity,type)
{
	//var topic=document.form1.topic.value;
	var url;
	if(type==1)//1为首页
		 url="Search/bookPlane.aspx?City=上海&offCity="+offCity;	
	else
		 url="../Search/bookPlane.aspx?City=上海&offCity="+offCity;
	window.open(url,'Plane');
}

function bookTrain(offCity,type)
{
	var url;
	if(type==1)//1为首页
		 url="Search/bookTrain.aspx?City=上海&offCity="+offCity;	
	else
		 url="../Search/bookTrain.aspx?City=上海&offCity="+offCity;
	window.open(url,'Train');
}

function bookSpecialPlane(title,keywords)
{
	var url="../Search/bookPlane.aspx?City=上海&topic=&type=&title="+title+"&keywords="+keywords;
	window.open(url,'Plane');
}

function bookSpecialPlane2(title,keywords)
{
	var url="Search/bookPlane.aspx?City=上海&topic=&type=&title="+title+"&keywords="+keywords;
	window.open(url,'Plane');
}

/**********************************/
/******       截取空格       ******/
/**********************************/ 
function trim(str){
    	var i = 0;
        while ((i < str.length)&&((str.charAt(i) == " ")||(str.charAt(i) == "　"))){i++;}
    	var j = str.length-1;
    	while ((j >= 0)&&((str.charAt(j) == " ")||(str.charAt(j) == "　"))){j--;}
    	if( i > j ) 
    		return "";
    	else
    		return str.substring(i,j+1);
}

function isNum(str){
	var reg=/^\d+$/;
	return reg.test(str);
}

//-->