﻿// JScript 文件


function GetSearchParm(textid,mytype)
{
   switch(mytype)
   {
       case 5 :
       {
            window.location.replace( "http://www.botrip.com/home/hotels.aspx?cityid=" + GetTextBoxValue(textid) + "&star=" + GetTextBoxValue(textid + "_star"));
            break;
       }
       case 6 :
       {
            window.location.replace("http://www.botrip.com/home/cars.aspx?cityid=" + GetTextBoxValue(textid));
            break;
       }
       case 7 :
       {
            window.location.replace("http://www.botrip.com/home/receive.aspx?cityid=" + GetTextBoxValue(textid));
            break;
       }
       case 8 :
       {
            window.location.replace("http://www.botrip.com/home/trains.aspx?bincity=" + GetTextBoxValue(textid + "1") + "&endcity=" + GetTextBoxValue(textid + "2") );
            break;
       }
   }
}


//用在搜索 
//mytype  
//type 与 mytype 是有区别的，type 指出的是 用于 拼合 WHERE 字符串的时候 判断的类型，而 mytype 用仅仅用于 区分 哪个搜索
function GetSearch(mytype)
{
      switch(mytype)
      {
           case 1 ://一日游 ，大巴，城市，特色，天数
           {
                window.location.replace("http://www.botrip.com/home/routes.aspx?chanPinLeiBie=1&lvYouXingShi=1&guanLianChengShi=" + GetTextBoxValue("select_dabayiriyou_city") + 
                                        "&lvYouTeSe=" + GetRadioListValue("radio_dabayiriyou_lvyoutese") + 
                                        "&lvYouTianShu=" + GetRadioListValue("radio_dabayiriyou_lvyoutianshu"));
                
                break;
           }
           case 2 ://一日游 ，单走，城市，特色，天数
           {
               window.location.replace("http://www.botrip.com/home/routes.aspx?chanPinLeiBie=1&lvYouXingShi=2&guanLianChengShi=" + GetTextBoxValue("select_danzouyiriyou_city") + 
                                        "&lvYouTeSe=" + GetRadioListValue("radio_danzouyiriyou_lvyoutese") + 
                                        "&lvYouTianShu=" + GetRadioListValue("radio_danzouyiriyou_lvyoutianshu"));
                                        
                break;
           }
           case 3 ://多日游 ，旅游类别，旅游形式
           {
               window.location.replace("http://www.botrip.com/home/multi-day-tours.aspx?chanPinLeiBie=2&lvYouXingShi=" + GetRadioListValue("radio_duoriyou_lvyouxingshi") + 
                                        "&lvYouLeiBie=" + GetRadioListValue("radio_dabayiriyou_lvyouleibie"));
               break;
           }
           case 4 ://在描述中搜索
           {
                window.location.replace("http://www.botrip.com/home/routes.aspx?keyword=" + GetTextBoxValue("txt_keyword"));
                break;
           }
           
           case 5 ://自建游
           {
                window.location.replace("http://www.botrip.com/home/shopping-1.aspx?cityid=" + GetTextBoxValue("select_diy_tours"));
                break;
           }
       }
}



//guanLianChengShi  城市
//lvYouTeSe    特色
//chanPinLeiBie=1  一日游

//lvYouXingShi=1 大巴游
//lvYouXingShi = 2 单走

//lvYouTianShu   旅游天数

//lvYouLeiBie   旅游类别(多日)


//http://www.botrip.com

function GetSearchVThree(mytype)
{
      switch(mytype)
      {
           case 1 ://一日游 ，大巴，城市，特色，天数
           {
                window.location.replace("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi=" + GetTextBoxValue("select_dabayiriyou_city") + 
                                        "&lvYouTeSe=" + GetRadioListValue("radio_dabayiriyou_lvyoutese") + 
                                        "&lvYouTianShu=" + GetRadioListValue("radio_dabayiriyou_lvyoutianshu"));
                break;
           }
           case 2 ://一日游 ，单走，城市，特色，天数
           {
               window.location.replace("http://www.botrip.com/home/routes_list.aspx?searchtype=2&guanLianChengShi=" + GetTextBoxValue("select_danzouyiriyou_city") + 
                                        "&lvYouTeSe=" + GetRadioListValue("radio_danzouyiriyou_lvyoutese") + 
                                        "&lvYouTianShu=" + GetRadioListValue("radio_danzouyiriyou_lvyoutianshu"));
                                        
                break;
           }
           case 3 ://多日游 ，旅游区域，旅游形式
           {
               var  region = GetRadioListValue("radio_duoriyou_region");
               if( region == "2" )
               {
                    window.location.replace("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=176&lvYouXingShi=" + GetRadioListValue("radio_duoriyou_lvyouxingshi"));
               }
               else
               {
                    window.location.replace("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=" + GetTextBoxValue("select_duoriyou_quyu_cityid") + 
                                            "&lvYouXingShi=" + GetRadioListValue("radio_duoriyou_lvyouxingshi"));
               }
             
               break;
           }
           case 4 ://在描述中搜索
           {
                window.location.replace("http://www.botrip.com/home/routes_list.aspx?searchtype=4&keyword=" + GetTextBoxValue("txt_keyword"));
                break;
           }
           
           case 5 ://自建游
           {
                window.location.replace("http://www.botrip.com/home/shopping-1.aspx?cityid=" + GetTextBoxValue("select_diy_tours"));
                break;
           }
       }
}

function SearchIsShow()
{
       var  region = GetRadioListValue("radio_duoriyou_region");
       if( region == "2" )
       {
           document.getElementById("div_display_Region").style.display="none";
       }
       else
       {
           document.getElementById("div_display_Region").style.display="";
       }
               
}


function SearchShowDivVFour()
{
       var  region = GetRadioListValue("Radio_search_vfour");
       
       document.getElementById("div_vfour_1").style.display="none";
       document.getElementById("div_vfour_2").style.display="none";
       document.getElementById("div_vfour_3").style.display="none";
       document.getElementById("div_vfour_4").style.display="none";
       
       document.getElementById("div_vfour_" + region).style.display="";   
}

function SearchShowDivVFour_link(myv)
{
      switch(myv)
      {
        case 1:
        {
             var  selv = GetRadioListValue("Radio_search_city_bus_tour");
             switch(selv)
             {
                case "1":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi=71&lvYouTeSe=0&lvYouTianShu=0");
                    return;
                }
                case "2":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi=73&lvYouTeSe=0&lvYouTianShu=0");
                    return;
                }
                case "3":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi=72&lvYouTeSe=0&lvYouTianShu=0");
                    return;
                }
                case "4":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi=74&lvYouTeSe=0&lvYouTianShu=0");
                    return;
                }
             }
             break;
        }
        case 2:
        {
             var scity = GetTextBoxValue("Select_search_private_tour");
             var selv = GetRadioListValue("Radio_search_private_tour");
             switch(selv)
             {
                case "1":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=2&guanLianChengShi="+ scity +"&lvYouTeSe=0&lvYouTianShu=2");
                    return;
                }
                case "2":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=2&guanLianChengShi="+ scity +"&lvYouTeSe=0&lvYouTianShu=1");
                    return;
                }
                case "3":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=2&guanLianChengShi="+ scity +"&lvYouTeSe=0&lvYouTianShu=0");
                    return;
                }
             }
             break;
        }
        case 3:
        {
             var scity = GetTextBoxValue("Select_package_tour");
             var selv = GetRadioListValue("Radio_search_package_tour");
             switch(selv)
             {
                case "1":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi="+ scity +"&lvYouXingShi=3");
                    return;
                }
                case "2":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi="+ scity +"&lvYouXingShi=4");
                    return;
                }
                case "3":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi="+ scity +"&lvYouXingShi=0");
                    return;
                }
             }
             break;
        }
        case 4:
        {
             var selv = GetRadioListValue("Radio_search_multi_tour");
             switch(selv)
             {
                case "1":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=3");
                    return;
                }
                case "2":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=4");
                    return;
                }
                case "3":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=0");
                    return;
                }
             }
             break;
        }
      }
}

//隐藏自建游酒店 问题
function SearchIsShowHotel(myradio,stryesid)
{
       var  region = GetRadioListValue(myradio);
       if( region == stryesid )
       {
           document.getElementById("div_display_Region_hotel").style.display="";
       }
       else
       {
           document.getElementById("div_display_Region_hotel").style.display="none";
       }
               
}


function SearchShowDivVFive_link(myv)
{
      switch(myv)
      {
        case 1:
        {
             var scity = GetTextBoxValue("select_search_1");
             window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=1&guanLianChengShi="+scity+"&lvYouTeSe=0&lvYouTianShu=0");
             break;
        }
        case 2:
        {
             var scity = GetTextBoxValue("select_search_2");
             window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=2&guanLianChengShi="+scity+"&lvYouTeSe=0&lvYouTianShu=0");
             break;
        }
        case 3:
        {
             var scity = GetTextBoxValue("select_search_3");
             window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi="+scity+"&lvYouXingShi=0");
             break;
        }
        case 4:
        {
             var selv = GetRadioListValue("Radio_search_4");
             switch(selv)
             {
                case "1":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=3");
                    return;
                }
                case "2":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=4");
                    return;
                }
                case "3":
                {
                    window.open("http://www.botrip.com/home/routes_list.aspx?searchtype=3&guanLianChengShi=184&lvYouXingShi=0");
                    return;
                }
             }
             break;
        }
     }
}