// JScript 文件
/*选择日期控制*/
function ChooseDate1( )
{
if(document.all) {
document.getElementById("txtDate1").click();
}
else
{
var evt = document.createEvent("MouseEvents");
evt.initEvent("click",true,true);
document.getElementById("txtDate1").dispatchEvent(evt);
}
}
function ChooseDate2( )
{
if(document.all) {
document.getElementById("txtDate2").click();
}
else
{
var evt = document.createEvent("MouseEvents");
evt.initEvent("click",true,true);
document.getElementById("txtDate2").dispatchEvent(evt);
}
}
function ChooseDate(id)//id:传进来的textbox id
{if(document.all) {
document.getElementById(id).click();
}
else
{
var evt = document.createEvent("MouseEvents");
evt.initEvent("click",true,true);
document.getElementById(id).dispatchEvent(evt);
}
}
/*日期控制结束*/
//*开始加载$(document.ready())*/
$(function(){
//控制无空白循环begin1
var demo=document.getElementById('demo');
var demo1=document.getElementById('demo1');
var demo2=document.getElementById('demo2');
var t=demo.scrollTop;
demo2.innerHTML=demo1.innerHTML;
function qswhMarquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight ;
else
demo.scrollTop++ ;
}
var MyMar=setInterval(qswhMarquee,40) ;
demo.onmouseover=function() {clearInterval(MyMar);}
demo.onmouseout=function() {MyMar=setInterval(qswhMarquee,40);}
//end1
//begin2
var dem=document.getElementById('dem');
var dem1=document.getElementById('dem1');
var dem2=document.getElementById('dem2');
var t=dem.scrollTop;
dem2.innerHTML=dem1.innerHTML;
function qswhMarquee1(){
if(dem2.offsetTop-dem.scrollTop<=0)
dem.scrollTop-=dem1.offsetHeight ;
else
dem.scrollTop++ ;
}
var MyMar1=setInterval(qswhMarquee1,40) ;
dem.onmouseover=function() {clearInterval(MyMar1);}
dem.onmouseout=function() {MyMar1=setInterval(qswhMarquee1,40);}
//end2
//*搜索宾馆层开始*/
$("#liHotel").click(function(){
var hotel=$("#ulHotel").css("display");
switch(hotel)
{case "none":$("#ulHotel").show();
$("#liHotel").css("cursor","default");
$("#liRoom").css("cursor","pointer");
$("#liCar").css("cursor","pointer");
$("#ulRoom").hide();
$("#ulCar").hide();
$("#imgHotel").attr("src","images/s1/an_36.gif");
$("#imgRoom").attr("src","images/s1/an_38.gif");
$("#imgCar").attr("src","images/s1/an_39.gif");
break;
default:break;
}
});
//*搜索宾馆结束*/
//*搜索房间层开始*/
$("#liRoom").click(function(){
var room=$("#ulRoom").css("display");
switch(room)
{case "none":$("#ulRoom").show();
$("#liRoom").css("cursor","default");
$("#liHotel").css("cursor","pointer");
$("#liCar").css("cursor","pointer");
$("#ulHotel").hide();
$("#ulCar").hide();
$("#imgHotel").attr("src","images/s1/HOTEL.gif");
$("#imgRoom").attr("src","images/s1/house.gif");
$("#imgCar").attr("src","images/s1/an_39.gif");
break;
default:break;
}
});
//*搜索宾房间结束*/
//*搜索汽车层开始*/
$("#liCar").click(function(){
var room=$("#ulCar").css("display");
switch(room)
{case "none":$("#ulCar").show();
$("#liCar").css("cursor","default");
$("#liHotel").css("cursor","pointer");
$("#liRoom").css("cursor","pointer");
$("#ulHotel").hide();
$("#ulRoom").hide();
$("#imgHotel").attr("src","images/s1/HOTEL.gif");
$("#imgRoom").attr("src","images/s1/an_38.gif");
$("#imgCar").attr("src","images/s1/car.gif");
break;
default:break;
}
});
//*搜索宾房间结束*/
/*选择自驾与他驾*/
$("#chbSelf").click(function()
{$("#chbSelf").attr("checked",true);
$("#chbOther").attr("checked",false); }
);
$("#chbOther").click(function(){
$("#chbSelf").attr("checked",false);
$("#chbOther").attr("checked",true);
});
/*自驾与他驾选择结束*/
/*租车button begin*/
$("#btnFindCar").click(function(){
return checkCar();
}
);
/*end*/
});
//*document.ready()加载结束*/
/*验证租车搜索条件*/
function checkCar()
{var flag=true;
if($.trim($("#txtPickUp").val()).length>0&&$.trim($("#txtDropOff").val()).length>0)
{
var checkIn=new Date($("#txtPickUp").val().replace(/\-/g, "\/"));
var checkOut=new Date($("#txtDropOff").val().replace(/\-/g, "\/"));
var today=new Date();
if(checkIn<today)
{showError(2,"The Pick-up Time has Passed");
flag=false;
}
else if(checkIn>=checkOut)
{showError(2,"The Pick-up Time is later than Drop-off Time");
flag=false;
}
else
{clearError(2);
}
}
else
{
showError(2,"The Pick-up Time and Drop-off Time can not be empty");
flag=false;
}
return flag;
}
/*租车搜索结束*/
//*验证搜索订单条件不能为空*/
function checkOrder(){
var condition0=$("#SearchOrder").val();
var flag=true;
if($.trim(condition0).length<=0)
{showError(1,"Search condition cannot be empty");
flag=false;
}
if(flag==true)
{
clearError(1);
}
return flag;
}
//end
//*验证酒店搜索条件*/
function checkHotel()
{
var flag=true;
if($.trim($("#txtDate1").val()).length>0&&$.trim($("#txtDate2").val()).length>0)
{
var checkIn=new Date($("#txtDate1").val().replace(/\-/g, "\/"));
var checkOut=new Date($("#txtDate2").val().replace(/\-/g, "\/"));
var price=$("#txtPrice").val();
var num=/^(0|([1-9]\d*))(\.\d+)?$/;
var today=new Date();
// if(checkIn.length==0||checkOut.length==0)
// {showError(0,"The Check In Time and Check Out Time should not be empty");
// flag=false;
// }
if(checkIn<today)
{showError(0,"The Check In Time has Passed");
flag=false;
}
else if(checkIn>=checkOut)
{showError(0,"The Check In Time is later than Check Out Time");
flag=false;
}
else if(!num.test(price)&&price.length>0)
{showError(0,"Please enter a right price!");
flag=false;
}
else
{clearError(0);
}
}
else
{
showError(0,"The Check In Time and Check Out Time can not be empty");
flag=false;
}
if(flag==true)
clearError(0);
return flag;
}
//*错误提示*/
function showError(errorType,errorContent)
{if(errorType==0)
{$("#errorMessage").html(errorContent);
$("#errorMessage").css("color","Red");
$("#errorMessage").show();
}
else if(errorType==1)
{$("#orderError").html(errorContent);
$("#orderError").show();
}
else if(errorType==2)
{$("#errorCar").html(errorContent);
$("#errorCar").css("color","Red");
$("#errorCar").show();
}
}
//*清除错误提示*/
function clearError(errorType)
{if(errorType==0)
{$("#errorMessage").hide();
$("#errorMessage").html("");
}
else if(errorType==1)
{$("#orderError").hide();
$("#orderError").html("");
}
else if(errorType==2)
{$("#errorCar").hide();
$("#errorCar").html("");
}
}
/*验证酒店搜索结束*/
<ul>
<div id="dem" style="overflow:hidden;height:80px; width:120px;padding:0px 0px; margin :0px;" >
<div id="dem1" style="margin:0px;padding:0px 0px;">
<asp:Repeater ID="RPHotCar" runat="server" EnableViewState="false">
<ItemTemplate>
<li><%--<a href='<%#"car_order.aspx?page=1&cid="+Eval("c_id") %>'>--%><%#DataBinder.Eval(Container.DataItem, "c_name").ToString().Length > 20 ? DataBinder.Eval(Container.DataItem, "c_name").ToString().Substring(0, 16) + "..." : DataBinder.Eval(Container.DataItem, "c_name") %><%--</a>--%></li>
</ItemTemplate>
</asp:Repeater></div>
<div id="dem2" style="margin:0px;padding:0px 0px;"></div>
</div>
<%-- <marquee direction="up" scrollAmount="1" height="80" onMouseOver="stop();" onMouseOut="start();">
</marquee>--%>
<li><span><a href="car_list.aspx?page=1">more</a></span></li></ul>
</div></div>
<ul class="bt_bg"> </ul>