﻿function ShowCityTool()
{
	if(hCityP.HpptRequest.responseText=="")
{
  alert('查無方案');
  return false;
}

   var i=0;
   var CityStr=hCityP.HpptRequest.responseText;
   /* var CityStr=hCityP.HpptRequest.responseText.split('_|');   
   for (i=1;i<CityStr.length;i++)
   {
      CityStr[i]=CityStr[i].split('_,'); 	
   }
   */
  var tmps = new Array();
  /*
  var Temp1;
  var Temp2;
  var Temp3;
  var Temp4;
  var Temp5;
  var TempImgSrc1="";
  var TempStr1="";
  var TempImgSrc2="";
  var TempStr2="";
  var TimeDiff;
  var TimeH;
  var TimeM;
  var q=0;
  */
  var MapH = parseInt(document.body.clientHeight);
  MapH=MapH-updo-25;
  var MapW = 679;
  var MapW2=710;
  var qbg="FFFFFF";
  tmps.push('<div align="left" border="0" style="position:absolute;left:240px;top:5px;background:#FFFFFF;height:'+MapH+'px;overflow-y:auto;"><table width="735" border="0" cellpadding="0" cellspacing="2" bgcolor="#99CCFF"><tr>');
  tmps.push('<td style="height:'+MapH+'px;" ></td>');
  tmps.push('<td style="height:'+MapH+'px; width:'+MapW2+'px; background:#ececec;" valign="top">');
  tmps.push(CityStr);
  /*
   ////////////
  tmps.push('<table width="'+MapW2+'" border="0" cellpadding="0" cellspacing="1" style="" ><tr>');
  tmps.push('<td style="background-color:#FFFFFF"><table width="'+MapW2+'" border="0" cellspacing="0" cellpadding="0">');
  tmps.push('<tr><td height="11" background="./images/City/top.jpg"></td></tr>');
  tmps.push('<tr><td><table width="'+MapW2+'" border="0" cellspacing="0" cellpadding="0">');
  tmps.push('<tr><td width="10">&nbsp;</td>');
  tmps.push('<td><img src="./images/City/trans_title.png" alt="" width="114" height="24" /></td>');
  tmps.push('<td width="130" align="left">&nbsp;</td></tr>');
  tmps.push('</table></td></tr><tr><td height="5"></td></tr>');
  tmps.push('<tr><td><table width="'+MapW2+'" border="0" cellspacing="0" cellpadding="0">');
//  tmps.push('<tr><td width="10" height="20">&nbsp;</td>');
//  tmps.push('<td width="65" valign="middle"><img src="./images/City/starttime.jpg" width="60" height="14" /></td>');
//  tmps.push('<td width="140" valign="middle"><span class="active">'+CityStr[1][3]+'</span></td>');
//  tmps.push('<td width="50" valign="middle"><img src="./images/City/startplace.jpg" width="46" height="14" /></td>');
//  tmps.push('<td width="140" valign="middle" class="active">'+CityStr[1][1]+'</td>');
//  tmps.push('<td width="50" valign="middle"><img src="./images/City/goal.jpg" width="46" height="14" /></td>');
//  tmps.push('<td valign="middle" class="active">'+CityStr[1][2]+'</td></tr>');
  tmps.push('<tr><td height="20">&nbsp;</td><td colspan="6" valign="middle"><span class="activeCity">資料來源:運研所陸海空客運資訊中心</span></td></tr>');
  tmps.push('</table></td></tr><tr><td height="5">&nbsp;</td></tr>');
  tmps.push('<tr><td><table width="'+MapW+'" border="0" align="center" cellpadding="0" cellspacing="1" style="background-color:#999999">');
  tmps.push('<tr><td style="background-color:#FFFFFF"><table width="'+MapW+'" border="0" cellpadding="0" cellspacing="0">');
  tmps.push('<tr><td align="center" style="background-color:#bae6e9" class="form_titleCity">方案</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">起站</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">迄站</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">出發時間</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">到達時間</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">旅行時間</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">轉乘次數</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">票價</td>');
  tmps.push('<td align="center" style="background-color:#bae6e9" class="form_titleCity">說明</td></tr>');
                
                for (q=2;q<CityStr.length;q++)
                {
                   if(q%2==0)
                   {
                      qbg="FFFFFF";
                   }
                   else
                   {
                      qbg="edf5f5";
                   }
                   
                   if(CityStr[q][0]==0)
                    {
		                  Temp1=CityStr[q][11].split(':');
		                  Temp2=CityStr[q][12].split(':');
		                  TimeDiff = (new Date(0,0,0,Temp2[0],Temp2[1],0).valueOf()-new Date(0,0,0,Temp1[0],Temp1[1],0).valueOf())/1000;
		                  if(TimeDiff<0)
		                   {
                              TimeDiff = (new Date(2009,10,11,Temp2[0],Temp2[1],0).valueOf()-new Date(2009,10,10,Temp1[0],Temp1[1],0).valueOf())/1000;
		                   }
		                  TimeH=parseInt(parseInt(TimeDiff)/3600);
		                  TimeM=parseInt((parseInt(TimeDiff)-(parseInt(TimeH)*3600))/60);
                          TimeH=Math.abs(TimeH);
                          TimeM=Math.abs(TimeM);
                          
                          tmps.push('<tr><td height="1" colspan="9" style="background-color:#666666"></td></tr>');
                          tmps.push('<tr><td align="center" style="background-color:#'+qbg+'" ><a class="login_txtCity" href="javascript:void(0);">'+parseInt(q-1)+'</a></td>');
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="login_txtCity">'+CityStr[q][5]+'</td>');    //出發地
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="login_txtCity">'+CityStr[q][8]+'</td>');    //目的地
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="activeCity">'+CityStr[q][11]+'</td>');      //出發時間
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="activeCity">'+CityStr[q][12]+'</td>');      //抵達時間
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="login_txtCity">'+TimeH+':'+TimeM+'</td>');  //抵達時間-出發時間
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="login_txtCity">1</td>');
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="login_txtCity">'+CityStr[q][15]+'</td>');   //總票價
                          tmps.push('<td align="center" style="background-color:#'+qbg+'"  class="activeCity">'+CityStr[q][2]+'</td></tr>');
                    }
                    
                   if(CityStr[q][0]==1)
                    {
                          Temp1=CityStr[q][11].split(':');
		                  Temp2=CityStr[q][26].split(':');
		                  TimeDiff = (new Date(0,0,0,Temp2[0],Temp2[1],0).valueOf()-new Date(0,0,0,Temp1[0],Temp1[1],0).valueOf())/1000;
		                  if(TimeDiff<0)
		                   {
                             TimeDiff = (new Date(2009,10,11,Temp2[0],Temp2[1],0).valueOf()-new Date(2009,10,10,Temp1[0],Temp1[1],0).valueOf())/1000;
		                   }
		                  TimeH=parseInt(parseInt(TimeDiff)/3600);
		                  TimeM=parseInt((parseInt(TimeDiff)-(parseInt(TimeH)*3600))/60);   
		                  TimeH=Math.abs(TimeH);
                          TimeM=Math.abs(TimeM);
		                  
                          tmps.push('<tr><td height="1" colspan="9" style="background-color:#666666"></td></tr>');
                          tmps.push('<tr><td align="center" bgcolor="#'+qbg+'"><a class="login_txtCity" href="javascript:void(0);">'+parseInt(q-1)+'</a></td>');
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="login_txtCity">'+CityStr[q][5]+'</td>');    //出發地
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="login_txtCity">'+CityStr[q][22]+'</td>');    //目的地
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="activeCity">'+CityStr[q][11]+'</td>');      //出發時間
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="activeCity">'+CityStr[q][26]+'</td>');      //抵達時間
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="login_txtCity">'+TimeH+':'+TimeM+'</td>');  //抵達時間-出發時間
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="login_txtCity">2</td>');
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="login_txtCity">'+CityStr[q][28]+'</td>');   //總票價
                          tmps.push('<td align="center" bgcolor="#'+qbg+'" class="activeCity">'+CityStr[q][2]+'、'+CityStr[q][16]+'</td></tr>');
                    }
                }
                
              tmps.push('</table></td></tr></table></td></tr>');
    
               for (q=2;q<CityStr.length;q++)
                {
                   
                   if(CityStr[q][0]==0)
                    {
                      tmps.push('<tr><td height="10">&nbsp;</td></tr>');
                      tmps.push('<tr><td><table width="'+MapW+'" border="0" align="center" cellpadding="0" cellspacing="1" style="background-color:#999999" >');
                      tmps.push('<tr>');
                      tmps.push('<td style="background-color:#FFFFFF"><table width="'+MapW+'" border="0" cellspacing="0" cellpadding="0">');
                      tmps.push('<tr>');
                      tmps.push('<td height="25" colspan="4" valign="middle" bgcolor="b5dee1"><table width="'+MapW+'" border="0" cellspacing="0" cellpadding="0">');
                      tmps.push('<tr>');
                      tmps.push('<td width="5">&nbsp;</td>');
                      tmps.push('<td><img src="./images/City/case.png" width="15" height="9" /><span class="form_titleCity">方案'+(q-1)+'</span></td>');
                      
                      tmps.push('<td width="80">&nbsp;</td>');
                      tmps.push('<td width="5">&nbsp;</td></tr>');
                      tmps.push('</table></td></tr>');
                      tmps.push('<tr><td align="center" style="background-color:#bae6e9; width:150px;" class="form_titleCity">起迄站</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:100px;" class="form_titleCity">時間</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:100px;" class="form_titleCity">運具</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:350px;" class="form_titleCity">說明</td></tr>');
                      tmps.push('<tr><td height="1" colspan="4" style="background-color:#9999FF" ></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[1][1]+'<br />'+CityStr[q][5]+'</td>');
                      tmps.push('<td align="center" class="activeCity">&nbsp;<br />&nbsp;</td>');
                      tmps.push('<td align="center">&nbsp;</td>');
                      if(CityStr[1][0]==2 && q==2)  //起點為台北縣市
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[1][1]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[q][5]+'</font ><br />詳細搭車方式請參考左方的搭車方案</td>');
                       }
                      else if(CityStr[1][0]==2) 
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[1][1]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[q][5]+'</font><br />詳細搭車方式請先點選<font style=\"color:#913093;\">市區其它方案</font><br />圖示後再參考左方的搭車方案</td>');
                       }
                      else 
                       { 
                         tmps.push('<td align="center">&nbsp;</td>');
                       }
                    
                      tmps.push('</tr><tr class="login_txtCity"><td height="1" colspan="4" align="center" style="background-color:#9999FF"></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][5]+'<br />'+CityStr[q][8]+'</td>');
                      tmps.push('<td align="center" class="activeCity">'+CityStr[q][11]+'<br />'+CityStr[q][12]+'</td>');
                        
                        if(CityStr[q][2].indexOf("台鐵") != -1)
                         {
                           TempImgSrc1="./images/City/train.gif";
                         }
                        else if(CityStr[q][2].indexOf("高鐵") != -1)
                         {
                           TempImgSrc1="./images/City/hsr.gif";
                         }
                        else if((CityStr[q][2].indexOf("基隆港務局") != -1)||(CityStr[q][2].indexOf("臺華輪") != -1)||(CityStr[q][2].indexOf("臺馬輪") != -1)||(CityStr[q][2].indexOf("花蓮港務局") != -1))
                         {
                           TempImgSrc1="./images/City/ship.gif";
                         } 
                        else if((CityStr[q][2].indexOf("航空") != -1)||(CityStr[q][2].indexOf("長榮國際儲運") != -1))
                         {
                           TempImgSrc1="./images/City/air.gif";
                         } 
                        else
                         {
                           TempImgSrc1="./images/City/bus.gif";
                         }
                      
                      TempStr1="由"+CityStr[q][11]+"時在"+CityStr[q][5]+"花<font style=\"color:red;\">"+CityStr[q][14]+"元 </font><br />搭乘<font style=\"color:red;\">"+CityStr[q][2]+"</font>在"+CityStr[q][12]+"時抵達"+CityStr[q][8];
                        
                      tmps.push('<td align="center"><img src="'+TempImgSrc1+'" width="24" height="24" /></td>');  
                      tmps.push('<td align="center" class="login_txtCity">'+TempStr1+'</td></tr>');  
                      tmps.push('<tr class="login_txtCity"><td height="1" colspan="4" align="center" style="background-color:#9999FF"></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][8]+'<br />'+CityStr[1][2]+'</td>'); //哪裡到哪裡
                      tmps.push('<td align="center">&nbsp;<br />&nbsp;</td>');    //時間
                      tmps.push('<td align="center">&nbsp;</td>');                //搭乘的運具的圖片
                      if(CityStr[1][0]==1 && q==2)  //迄點為台北縣市
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[q][8]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[1][2]+'</font ><br />詳細搭車方式請參考左方的搭車方案</td>');
                       }
                      else if(CityStr[1][0]==1) 
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[q][8]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[1][2]+'</font><br />詳細搭車方式請先點選<font style=\"color:#913093;\">市區其它方案</font><br />圖示後再參考左方的搭車方案</td>');
                       }
                      else 
                       { 
                         tmps.push('<td align="center">&nbsp;</td>');
                       }
                      tmps.push('</tr></table></td>');
                      tmps.push('</tr></table></td></tr>');
                      tmps.push('<tr><td height="5"></td></tr>');                    
                    }
                    
                   if(CityStr[q][0]==1)
                    {
                      tmps.push('<tr><td height="10">&nbsp;</td></tr>');
                      tmps.push('<tr><td><table width="'+MapW+'" border="0" align="center" cellpadding="0" cellspacing="1" style="background-color:#999999" >');
                      tmps.push('<tr><td style="background-color:#FFFFFF"><table width="'+MapW+'" border="0" cellspacing="0" cellpadding="0">');
                      tmps.push('<tr><td height="25" colspan="4" valign="middle" bgcolor="b5dee1"><table width="'+MapW+'" border="0" cellspacing="0" cellpadding="0">');
                      tmps.push('<tr><td width="5">&nbsp;</td><td><img src="./images/City/case.png" width="15" height="9" /><span class="form_titleCity">方案'+(q-1)+'</span></td>');
                      
                      tmps.push('<td width="80">&nbsp;</td>');
                      tmps.push('<td width="5">&nbsp;</td></tr></table></td></tr>');
                      tmps.push('<tr><td align="center" style="background-color:#bae6e9; width:150px;" class="form_titleCity">起迄站</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:100px;" class="form_titleCity">時間</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:100px;" class="form_titleCity">運具</td>');
                      tmps.push('<td align="center" style="background-color:#bae6e9; width:350px;" class="form_titleCity">說明</td></tr>');
                      tmps.push('<tr><td height="1" colspan="4" style="background-color:#9999FF" ></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[1][1]+'<br />'+CityStr[q][5]+'</td>');
                      tmps.push('<td align="center" class="activeCity">&nbsp;<br />&nbsp;</td>');
                      tmps.push('<td align="center">&nbsp;</td>');
                      if(CityStr[1][0]==2 && q==2)  //起點為台北縣市
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[1][1]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[q][5]+'</font ><br />詳細搭車方式請參考左方的搭車方案</td>');
                       }
                      else if(CityStr[1][0]==2) 
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[1][1]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[q][5]+'</font><br />詳細搭車方式請先點選<font style=\"color:#913093;\">市區其它方案</font><br />圖示後再參考左方的搭車方案</td>');
                       }
                      else 
                       { 
                         tmps.push('<td align="center">&nbsp;</td>');
                       }
                      tmps.push('</tr><tr class="login_txtCity"><td height="1" colspan="4" align="center" style="background-color:#9999FF"></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][5]+'<br />'+CityStr[q][8]+'</td>');
                      tmps.push('<td align="center" class="activeCity">'+CityStr[q][11]+'<br />'+CityStr[q][12]+'</td>');
                        
                        if(CityStr[q][2].indexOf("台鐵") != -1)
                         {
                           TempImgSrc1="./images/City/train.gif";
                         }
                        else if(CityStr[q][2].indexOf("高鐵") != -1)
                         {
                           TempImgSrc1="./images/City/hsr.gif";
                         }
                        else if((CityStr[q][2].indexOf("基隆港務局") != -1)||(CityStr[q][2].indexOf("臺華輪") != -1)||(CityStr[q][2].indexOf("臺馬輪") != -1)||(CityStr[q][2].indexOf("花蓮港務局") != -1))
                         {
                           TempImgSrc1="./images/City/ship.gif";
                         } 
                        else if((CityStr[q][2].indexOf("航空") != -1)||(CityStr[q][2].indexOf("長榮國際儲運") != -1))
                         {
                           TempImgSrc1="./images/City/air.gif";
                         } 
                        else
                         {
                           TempImgSrc1="./images/City/bus.gif";
                         }
                      
                      TempStr1="由"+CityStr[q][11]+"時在"+CityStr[q][5]+"花<font style=\"color:red;\">"+CityStr[q][29]+"元</font> <br />搭乘<font style=\"color:red;\">"+CityStr[q][2]+"</font>在"+CityStr[q][12]+"時抵達"+CityStr[q][8];
                        
                      tmps.push('<td align="center"><img src="'+TempImgSrc1+'" width="24" height="24" /></td>');  
                      tmps.push('<td align="center" class="login_txtCity">'+TempStr1+'</td></tr>');  
                      tmps.push('<tr class="login_txtCity"><td height="1" colspan="4" align="center" style="background-color:#9999FF"></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][8]+'<br />'+CityStr[q][19]+'</td>'); //哪裡到哪裡
                      tmps.push('<td align="center">&nbsp;<br />&nbsp;</td>');                                          //時間
                      tmps.push('<td align="center"><img src="./images/City/walk.gif" width="24" height="24" /></td>');    //搭乘的運具的圖片
                      tmps.push('<td align="center" class="login_txtCity">由'+CityStr[q][8]+'步行約'+CityStr[q][14]+'公尺到達'+CityStr[q][19]+'</td></tr>');     //說明
                      tmps.push('<tr><td height="1" colspan="4" style="background-color:#9999FF" ></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][19]+'<br />'+CityStr[q][22]+'</td>');
                      tmps.push('<td align="center" class="activeCity">'+CityStr[q][25]+'<br />'+CityStr[q][26]+'</td>');
                      
                       if(CityStr[q][16].indexOf("台鐵") != -1)
                         {
                           TempImgSrc2="./images/City/train.gif";
                         }
                        else if(CityStr[q][16].indexOf("高鐵") != -1)
                         {
                           TempImgSrc2="./images/City/hsr.gif";
                         }
                        else if((CityStr[q][16].indexOf("基隆港務局") != -1)||(CityStr[q][16].indexOf("臺華輪") != -1)||(CityStr[q][16].indexOf("臺馬輪") != -1)||(CityStr[q][16].indexOf("花蓮港務局") != -1))
                         {
                           TempImgSrc2="./images/City/ship.gif";
                         } 
                        else if((CityStr[q][16].indexOf("航空") != -1)||(CityStr[q][16].indexOf("長榮國際儲運") != -1))
                         {
                           TempImgSrc2="./images/City/air.gif";
                         } 
                        else
                         {
                           TempImgSrc2="./images/City/bus.gif";
                         }
                      
                      TempStr2="由"+CityStr[q][25]+"時在"+CityStr[q][19]+"花<font style=\"color:red;\">"+CityStr[q][30]+"元</font> <br />搭乘<font style=\"color:red;\">"+CityStr[q][16]+"</font>在"+CityStr[q][26]+"時抵達"+CityStr[q][22];
                        
                      tmps.push('<td align="center"><img src="'+TempImgSrc2+'" width="24" height="24" /></td>');  
                      tmps.push('<td align="center" class="login_txtCity">'+TempStr2+'</td></tr>'); 
                      tmps.push('<tr><td height="1" colspan="4" style="background-color:#9999FF" ></td></tr>');
                      tmps.push('<tr><td align="center" class="login_txtCity">'+CityStr[q][22]+'<br />'+CityStr[1][2]+'</td>');
                      tmps.push('<td align="center" class="activeCity">&nbsp;<br />&nbsp;</td>');
                      tmps.push('<td align="center">&nbsp;</td>');
                      if(CityStr[1][0]==1 && q==2)  //迄點為台北縣市
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[q][22]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[1][2]+'</font ><br />詳細搭車方式請參考左方的搭車方案</td>');
                       }
                      else if(CityStr[1][0]==1) 
                       {
                         tmps.push('<td align="center" class="login_txtCity" ><font style=\"color:red;\">'+CityStr[q][22]+'</font >->');
                         tmps.push('<font style=\"color:red;\">'+CityStr[1][2]+'</font><br />詳細搭車方式請先點選<font style=\"color:#913093;\">市區其它方案</font><br />圖示後再參考左方的搭車方案</td>');
                       }
                      else 
                       { 
                         tmps.push('<td align="center">&nbsp;</td>');
                       }
                      tmps.push('</tr></table></td></tr></table></td></tr><tr><td height="5"></td></tr>');     
                    } 
                }    
               
   tmps.push('</table>');  //這段好像有漏 
   tmps.push('</td></tr></table>');
    */
   tmps.push('</td></tr></table>');  //這段好像有漏
   tmps.push('</div>');
  //////////////////////////
    document.getElementById("HtmlDiv").innerHTML =tmps.join('');
    
    DivHeight();
}


function SetLinkFinish16()
{
    var s = '火車站';
	var temps=new Array();
  	var tmps = hCityP.HpptRequest.responseText.split('|_'); 
  	if(tmps =='' || tmps==null ||tmps=='undefined') {
  	 document.getElementById('HtmlDiv').innerHTML='<div style="position: absolute;left:400px;top:150px"><font>'+((Lang=='CHT')?'查無符合班次資訊，請重新查詢。':'Does not have information ,please to choose other options.')+'</font></div>';
  	 if(document.getElementById('InCusDiv')!=null)
  	 document.getElementById('InCusDiv').innerHTML='<input type="submit" name="Submit" value="'+lag[103]+'" onclick="GetRail()" />';      	
  	}       
        else
        {
  	for(var i=0;i<tmps.length-1;i++)
  	  		tmps[i]=tmps[i].split('&_'); 
  	  	if($("#radio5[@checked]").val()=='on')	 
  	    temps.push('<div align="left" style="position: absolute; left: 280px;top:5px;">起點：'+tmps[0][6]+'火車站　　　　　迄點：'+tmps[0][8]+'火車站　　　　　　　　　　　　　　　　　');
  	    else
  	    temps.push('<div align="left" style="position: absolute; left: 280px;top:5px;">起點：'+document.getElementById('RD20').value+s+'　　　　　迄點：'+document.getElementById('RD21').value+s+'　　　　　　　　　　　　　　　　　');
  	    
  	    temps.push('<a onclick="RailEarlyLast(-1);" style="cursor:pointer;"><img src="./images/'+Lang+'/route/early_time.jpg" onmouseover="this.src=\'./images/'+Lang+'/route/early_time_f2.jpg\';" onmouseout="this.src=\'./images/'+Lang+'/route/early_time.jpg\';"/></a>　　');
  	    temps.push('<a onclick="RailEarlyLast(1);"  style="cursor:pointer;"><img src="./images/'+Lang+'/route/later_time.jpg" onmouseover="this.src=\'./images/'+Lang+'/route/later_time_f2.jpg\';" onmouseout="this.src=\'./images/'+Lang+'/route/later_time.jpg\';"/></a></div>');
  	    temps.push('<div id="GetTDiv" style="position: absolute; left: 280px;top:40px; height:350px; overflow-y:auto;">');
  	    temps.push('<table class="apha_bg" width="700" border="0" cellpadding="0" cellspacing="1" bgcolor="#99CCFF">');
  	    
        temps.push('<tr><td class="font_title style12" ><table width="700" border="0" cellpadding="4" cellspacing="1" bgColor="#cccccc">');
        temps.push('<tr  class="table_font" bgColor="#8ce2ff" style="padding:3px;"><td width="50" bgcolor="#9ddce1"><div align="center">車種<br /></div></th>');
        if($("#radio5[@checked]").val()!='on')	
        temps.push('<th width="59" bgcolor="#9ddce1" class="t9"><div align="center">車次<br /></div></th>');
        temps.push('<th width="118" bgcolor="#9ddce1" class="t9"><div align="center">始發站→到達站</div></th>');
        temps.push('<th width="80" bgcolor="#9ddce1" class="t9"><div align="center"><font color="red" >開車時間</font><br /></div></th>');
        temps.push('<th width="85" bgcolor="#9ddce1" class="t9"><div align="center"><font color="red" >到達時間</font><br /></div></th>');
        temps.push('<th width="81" bgcolor="#9ddce1" class="t9"><div align="center">̩Ǜ時間<br /></div></th>');
        temps.push('<th width="138" bgcolor="#9ddce1" class="t9"><div align="center">備註</div></th></tr>');
        for(var j=0;j<tmps.length-1;j++)
      	{ 
      		if(j%2==0) bg='#e6f2f2'; else bg='#FFFFFF';   
        temps.push('<tr><td align="center" bgcolor="'+bg+'" class="t9b">'+tmps[j][2]+'</td>');
        if($("#radio5[@checked]").val()!='on')	
        temps.push('<td bgcolor="'+bg+'" class="t9b"><div align="center">'+tmps[j][3]+'</div></td>');
        temps.push('<td bgcolor="'+bg+'" class="t9b"><div align="center">'+tmps[j][4]+' 至 '+tmps[j][5]+'</div></td>');
        temps.push('<td bgcolor="'+bg+'" class="t9b"><div align="center">'+tmps[j][7]+'</div></td>');
        temps.push('<td bgcolor="'+bg+'" class="t9b"><div align="center">'+tmps[j][9]+'</div></td>');
        temps.push('<td bgcolor="'+bg+'" class="t9b"><div align="center">'+tmps[j][10]+'</div></td>');
        temps.push('<td bgcolor="'+bg+'" class="t9b">');
        
        if(document.getElementById('RD1')==null)
            temps.push(tmps[j][0]+'</td></tr>');
        else
            temps.push('<img src="./images/news/train.gif" width="25" height="24" />'+tmps[j][11]+'</td></tr>');
	    }
        temps.push('</table></td></tr></table></div>');        
  	    
      	document.getElementById('HtmlDiv').innerHTML=temps.join('');
      	if(document.getElementById('InCusDiv')!=null)
      	document.getElementById('InCusDiv').innerHTML='<img src="./images/'+Lang+'/my_e/collect_f2.jpg" style="cursor:pointer;" onclick="Customize(\'Inherit\');" /><input type="submit" name="Submit" value="'+lag[36]+'" onclick="GetRail()" />';      	
      }
    DivHeight();
}
