document.writeln('<script type="text/javascript" src="http://resource.elong.com/webunion/searchboxjs/cities.js"></script>');
document.writeln('<script type="text/javascript" src="http://resource.elong.com/webunion/searchboxjs/jquery.datePicker.min-2.1.2.js"></script>');
document.writeln('<link href="http://resource.elong.com/webunion/searchboxjs/jquery.datePicker.css" rel="stylesheet" type="text/css" />');

document.writeln('<style type="text/css">');
document.writeln('#searchbox_elong *{padding:0;margin:0; font-size:12px; font-family:Arial, Helvetica, sans-serif; line-height:1.5em;}');
document.writeln('#searchbox_elong img{border:0;}');
document.writeln('/*set width*/');
document.writeln('#searchbox_elong{min-width:200px;width:200px;}');
document.writeln('#searchbox_elong .title_l,#searchbox_elong .title_r,#searchbox_elong .footer_l,#searchbox_elong .footer_r{width:6px;height:34px;background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/bg.gif) no-repeat; overflow:hidden;}');
document.writeln('#searchbox_elong .title_r{background-position:-6px 0px;}');
document.writeln('#searchbox_elong .footer_l{background-position:0px -34px;height:6px;}');
document.writeln('#searchbox_elong .footer_r{background-position:-6px -34px;height:6px;}');
document.writeln('#searchbox_elong .footer_bg{border-bottom:1px solid #2960c4;background:#e4f2ff;height:5px;overflow:hidden;clear:both;margin:0;padding:0;}');
document.writeln('#searchbox_elong .title_box{background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/title_bg.gif) repeat-x;height:34px;overflow:hidden;}');
document.writeln('#searchbox_elong .title_bg{padding-top:8px; background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/title_bg.gif) repeat-x;height:26px;overflow:hidden;}');
document.writeln('#searchbox_elong .title_bg a{float:left;cursor:pointer;margin-left:5px;}');
document.writeln('#searchbox_elong .hotel_a,#searchbox_elong .hotel_b,#searchbox_elong .flight_a,#searchbox_elong .flight_b{background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/bg.gif) no-repeat;width:62px;height:26px;}');
document.writeln('#searchbox_elong .hotel_a{background-position:-12px -26px;}');
document.writeln('#searchbox_elong .hotel_b{background-position:-12px 0px;}');
document.writeln('#searchbox_elong .flight_a{background-position:-12px -78px;}');
document.writeln('#searchbox_elong .flight_b{background-position:-12px -52px;}');
document.writeln('#searchbox_elong .e_logo{background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/bg.gif) 0px -127px no-repeat;width:74px;height:17px;overflow:hidden;margin-top:5px;}');
document.writeln('/*set height*/');
document.writeln('#searchbox_elong #elong_cont{border-left:1px solid #2960c4; border-right:1px solid #2960c4; background:#e4f2ff;width:auto;height:240px; overflow:hidden;}');
document.writeln('#searchbox_elong dl{margin:8px auto 5px;clear:both;zoom:1;width:93%;padding-left:5px;}');
document.writeln('#searchbox_elong dt{float:left;width:35%;display:inline;text-align:center;height:23px;line-height:23px;}');
document.writeln('#searchbox_elong dd{float:left;width:64%;_width:62%;display:inline;height:23px;line-height:23px;text-align:left;}');
document.writeln('#searchbox_elong dd.city_link{height:auto; line-height:1.5em;padding-top:2px;}');
document.writeln('#searchbox_elong dd.city_link a{float:left;width:25px;min-width:25px;margin-right:13px;color:#013091; _display:inline; text-decoration:underline;}');
document.writeln('#searchbox_elong dd.city_link a:hover{color:#d02e2e; text-decoration:underline;}');
document.writeln('#searchbox_elong dd select{font-size:12px;*font-family:"宋体";width:95%;_width:96%;height:20px;_height:18px;border:1px solid #7f9db9;*margin-top:-3px;_margin-top:0px;}');
document.writeln('#searchbox_elong dd input{padding-left:1%;height:15px;line-height:15px;width:93%;_width:94%;border:1px solid #7f9db9;margin-top:2px;*margin-top:-2px;_margin-top:0px;}');
document.writeln('#searchbox_elong .searchbtn{margin:0px auto;width:66px;height:25px;clear:both; text-align:center;padding-top:6px;*margin-top:-5px;}');
document.writeln('#searchbox_elong .searchbtn input{width:66px;height:21px;border:none;margin:0;padding:0; background:url(http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/bg.gif) 0px -105px no-repeat;cursor:pointer;}');
document.writeln('');
document.writeln('');
document.writeln('</style>');
document.writeln('<div id="searchbox_elong">');
document.writeln('  <table width="100%" border="0" cellspacing="0" cellpadding="0">    ');
document.writeln('    <tr>');
document.writeln('      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.writeln('        <tr>');
document.writeln('          <td width="6" class="title_l">&nbsp;</td>');
document.writeln('          <td class="title_box"><div class="title_bg"><a id="h_switch"><img src="http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/blank.gif" class="hotel_b" id="hotel_icon" alt="酒店查询" /></a><a id="f_switch"><img src="http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/blank.gif" class="flight_a" id="flight_icon" alt="机票查询" /></a><a href="#" style="float:right;" title="艺龙旅行网"><img src="http://resource.elong.com/webunion/searchboxjs/diy/airhotel/blue/images/blank.gif" class="e_logo" alt="艺龙旅行网" /></a></div></td>');
document.writeln('          <td width="6" class="title_r">&nbsp;</td>');
document.writeln('        </tr>');
document.writeln('      </table></td>');
document.writeln('    </tr>');
document.writeln('    <tr>');
document.writeln('      <td valign="top">');
document.writeln('      <div id="elong_cont">');
document.writeln('        <div id="h_blk" style="display:block;">');
document.writeln('        <form onsubmit="pageTracker._linkByPost(this)"  id="hotel" action="http://travel.elong.com/hotels/Search.aspx" method="get" target="_blank">');
document.writeln('        <input type="hidden" id="hotelcampaign_id" name="campaign_id" value="" />');
document.writeln('        <input type="hidden" name="srhType" value="0" />  ');
document.writeln('        <input type="hidden" name="RoomNum" value="1" />');
document.writeln('        <input type="hidden" name="PersonNum" value="1" />');
document.writeln('          <dl>');
document.writeln('              <dt class="raCityName">城&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;市：</dt>');
document.writeln('              <dd class="raCityName">');
document.writeln('                <select id="hotelCities" name="raCityName">');
document.writeln('                  <option value="">Beijing 北京</option>');
document.writeln('                </select>');
document.writeln('              </dd>');
document.writeln('              <dt class="CheckInDate">入店日期：</dt>');
document.writeln('              <dd class="CheckInDate">');
document.writeln('                <input id="CheckInDate" class="date-pick" name="CheckInDate" type="text" value="" />');
document.writeln('              </dd>');
document.writeln('              <dt class="CheckOutDate">离店日期：</dt>');
document.writeln('              <dd class="CheckOutDate">');
document.writeln('                <input id="CheckOutDate" class="date-pick" name="CheckOutDate" type="text" value="" />');
document.writeln('              </dd>');
document.writeln('              <dt class="Price">价格范围：</dt>');
document.writeln('              <dd class="Price">');
document.writeln('                <select name="Price">');
document.writeln('                  <option value="-1"  selected>不限</option>');
document.writeln('                  <option value="801">800以上</option>');
document.writeln('                  <option value="800">600--800元</option>');
document.writeln('                  <option value="600">400--600元</option>');
document.writeln('                  <option value="400">250--400元</option>');
document.writeln('                  <option value="250">250以下</option>');
document.writeln('                </select>');
document.writeln('              </dd>');
document.writeln('              <dt class="Star">酒店等级：</dt>');
document.writeln('              <dd class="Star">');
document.writeln('                <select name="Star">');
document.writeln('                  <option value="-1">不限</option>');
document.writeln('                  <option value="5">五星/豪华</option>');
document.writeln('                  <option value="4">四星/高档</option>');
document.writeln('                  <option value="3">三星/舒适</option>');
document.writeln('                  <option value="12">三星以下/经济</option>');
document.writeln('                </select>');
document.writeln('              </dd>');
document.writeln('              <dt class="HotelName">酒店名称：</dt>');
document.writeln('              <dd class="HotelName">');
document.writeln('                <input id="HotelName" name="HotelName" type="text" value="" />');
document.writeln('              </dd> ');
document.writeln('              <dt class="HotCities">热点城市：</dt>');
document.writeln('              <dd id="hotcities" class="HotCities city_link"><a href="javascript:;"  title="北京">北京</a><a href="javascript:;"  title="上海">上海</a><a href="javascript:;"  title="广州">广州</a><a href="javascript:;"  title="深圳">深圳</a><a href="javascript:;"  title="杭州">杭州</a><a href="javascript:;"  title="南京">南京</a><a href="javascript:;"  title="成都">成都</a><a href="javascript:;"  title="武汉">武汉</a></dd>             ');
document.writeln('            </dl>');
document.writeln('            <div class="searchbtn"><input type="submit" value=" " /></div>');
document.writeln('        </form>');
document.writeln('        </div>');
document.writeln('        <div id="f_blk" style="display:none;">');
document.writeln('            <form onsubmit="pageTracker._linkByPost(this)"  id="form2" action="http://travel.elong.com/flights/TSearch.aspx" method="get" target="_blank">');
document.writeln('            <input type="hidden" id="aircampaign_id" name="campaign_id" value="" />');
document.writeln('            <input type="hidden" name="g" value="result" />');
document.writeln('            <input type="hidden" name="FLY_TYPE" value="0" />');
document.writeln('              <dl>');
document.writeln('              <dt class="DEPART_CITY">出发城市：</dt>');
document.writeln('              <dd class="DEPART_CITY">');
document.writeln('                <select id="fromCities" name="DEPART_CITY">');
document.writeln('                  <option value="">Beijing 北京</option>');
document.writeln('                </select>');
document.writeln('              </dd>');
document.writeln('              <dt class="DEST_CITY">到达城市：</dt>');
document.writeln('              <dd class="DEST_CITY">');
document.writeln('                <select id="toCities" name="DEST_CITY"><option value="" selected="selected">Shanghai 上海</option></select>');
document.writeln('              </dd>');
document.writeln('              <dt class="FLY_DATE">出发日期：</dt>');
document.writeln('              <dd class="FLY_DATE">');
document.writeln('                <input class="date-pick"  id="FLY_DATE" name="FLY_DATE" type="text" value="" />');
document.writeln('              </dd>');
document.writeln('              <dt class="FLY_TIME">出发时间：</dt>');
document.writeln('              <dd class="FLY_TIME">');
document.writeln('                <select name="FLY_TIME">');
document.writeln('                <option value="">全天</option><option value="00:01-12:00">00:01-12:00</option><option value="12:00-18:00">12:00-18:00</option><option value="18:00-24:00">18:00-24:00</option>');
document.writeln('                </select>');
document.writeln('              </dd>');
document.writeln('              <dt class="FCY">舱位等级：</dt>');
document.writeln('              <dd class="FCY">');
document.writeln('                <select name="FCY"><option value="1" selected="selected">经济舱</option><option value="8">商务舱</option><option value="16">头等舱</option></select>');
document.writeln('              </dd>');
document.writeln('              <dt class="DELEVER_CITY">送票城市：</dt>');
document.writeln('              <dd class="DELEVER_CITY">');
document.writeln('                <select id="DELEVER_CITY" name="DELEVER_CITY">');
document.writeln('                  <option value="">Beijing 北京</option>');
document.writeln('                </select>');
document.writeln('              </dd> ');
document.writeln('            </dl>');
document.writeln('            <div class="searchbtn"><input type="submit" value=" " /></div>');
document.writeln('            </form>');
document.writeln('      </div>');
document.writeln('      </div>');
document.writeln('      </td>');
document.writeln('    </tr>');
document.writeln('    <tr>');
document.writeln('      <td height="6" colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">        ');
document.writeln('        <tr>');
document.writeln('          <td class="footer_l"></td>');
document.writeln('          <td><div class="footer_bg">&nbsp;</div></td>');
document.writeln('          <td class="footer_r"></td>');
document.writeln('        </tr>');
document.writeln('      </table></td>');
document.writeln('    </tr>');
document.writeln('  </table>');
document.writeln('</div>');
document.writeln('');


var len=5;
$(function(){	
	$("#h_switch").click(function () {
	    $("#hotel_icon").removeAttr("class")
	    $("#hotel_icon").addClass("hotel_b")	
	    $("#flight_icon").removeAttr("class")
	    $("#flight_icon").addClass("flight_a")	
	    $("#h_blk").show();
	    $("#f_blk").hide();
	});
	
	$("#f_switch").click(function () {
	    $("#flight_icon").removeAttr("class")
	    $("#flight_icon").addClass("flight_b")	
	    $("#hotel_icon").removeAttr("class")
	    $("#hotel_icon").addClass("hotel_a")	
	    $("#f_blk").show();
	    $("#h_blk").hide();
	});	
	
	sethoteloptions();
	sethotcities();
	setairoptions();
	
	$("#elong_cont").height(boxheight-40);
	$("#elong_cont").width(parseInt(boxwidth));
	$("#hotelcampaign_id").val(campaign_id);
	$("#aircampaign_id").val(campaign_id);
	
});

//hoteloptions
function sethoteloptions(){
    var all="CheckInDate,CheckOutDate,Price,Star,HotelName,HotCities";
    var alloptions = all.split(",");
    jQuery.each(alloptions, function() {
        $("."+this).hide();        
    });
    
	if(hoteloptions=="") return ;

    var options = hoteloptions.split(",");
    jQuery.each(options, function() {
        $("."+this).show();        
    });
}

//http://travel.elong.com/hotels/Search.aspx?campaign_id=4000013&srhType=0&raCityName=%u5317%u4EAC
function gethotellink(city){
    return "http://travel.elong.com/hotels/Search.aspx?campaign_id="+ campaign_id +"&srhType=0&raCityName=" + escape(city);
}

//hotcities
function sethotcities(){
	if(hotcities=="") return ;

    var html='';	
    var options = hotcities.split(",");
    jQuery.each(options, function() {
        html = html +  '<a href="'+ gethotellink(this) +'" target="_blank">'+unescape(this)+'</a>'; 
    });    
    $("#hotcities").html(html);
}

//airoptions
function setairoptions(){
    var all="FLY_DATE,FLY_TIME,FCY,DELEVER_CITY";
    var alloptions = all.split(",");
    jQuery.each(alloptions, function() {
        $("."+this).hide();        
    });
    
	if(airoptions=="") return ;    
		var options = airoptions.split(",");
        jQuery.each(options, function() {
            $("."+this).show();        
        });
   
}

$(function(){
   if(parseInt(boxwidth)>295 && parseInt(boxwidth)>255){
		$(".date-pick").datePicker({
		clickInput:true,
		startDate:(new Date()).asString()
		});	
  }
})

//google-analytics
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-11239288-2");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
} catch(err) {}


