﻿function showImg(a) { var b = $(".content_sale .ad").height(); $(".slider").stop(!0, !1).animate({ top: -b * a }, 1e3), $(".num li").removeClass("on").eq(a).addClass("on") } function CheckEndData() { var a = $("#InDate2").DatePickerGetDate(); a.setDate(a.getDate() - 45); if (a.valueOf() > now) { alert("\u79bb\u5e97\u65e5\u671f\u5fc5\u987b\u572845\u5929\u4ee5\u5185"); return !1 } return !0 } function ShowCity() { var a = $("#City").val(); $.getJSON("/Hotel/GetCity", { city: a, page: CPageIndex }, function (b) { var c = ""; totalIndex = b.Citys.length - 1, totalPage = b.TotalPage, CPageIndex = b.Page, b.Citys.length > 0 ? ($("#cities_body").html(""), $.each(b.Citys, function (a, b) { c += "<div class='cl", a == nowIndex && (c += " hove"), c += " ' cid=\"" + b.CityID + '"   cname="' + b.CityName + "\"><span class='n'>" + b.CityName + "</span><span class='sf'>" + b.SName + "</span><span class='py'>" + b.PinYin + "</span></div>" }), $("#cities_body").html(c), $.each($("#cities_body > div"), function (a, b) { $(b).bind("mouseover", function () { nowIndex = a, $(b).addClass("hove") }), $(b).bind("mouseleave", function () { $(b).removeClass("hove") }), $(b).bind("click", function () { $("#hdCity").val($(b).attr("cid")), $("#City").val($(b).attr("cname")), $("#citysList").hide(), $("#hdArea").val(""), $("#Area").val("<\u5168\u90e8>") }) }), b.TotalPage > 1 ? (CPageIndex <= 1 ? c = "\u4e0a\u4e00\u9875&nbsp;&nbsp;&nbsp;&nbsp;" : c = "<a href='#' onclick='SetNewIndex(" + b.Page + "-1);return false;'>\u4e0a\u4e00\u9875</a>&nbsp;&nbsp;&nbsp;&nbsp;", c += b.Page + "/" + b.TotalPage, CPageIndex >= b.TotalPage ? c += "&nbsp;&nbsp;&nbsp;&nbsp;\u4e0b\u4e00\u9875" : c += "&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick='SetNewIndex(" + b.Page + "+1);return false;'>\u4e0b\u4e00\u9875</a>", $("#cities_bottom").html(c)) : $("#cities_bottom").html(""), $("#cities_body").attr("has", "true")) : $("#cities_top").html("\u5bf9\u4e0d\u8d77\uff0c\u627e\u4e0d\u5230\uff1a<span style='color:red'>" + a + "</span>"), $("#citysList").show() }) } function Fkey(a) { if (a.which == 38) if (nowIndex > 0) { var b = $("#cities_body > div"); $(b[nowIndex]).removeClass("hove"), nowIndex -= 1, $(b[nowIndex]).addClass("hove") } else CPageIndex > 1 && (CPageIndex--, nowIndex = 7, ShowCity()); else if (a.which == 40) if (nowIndex < totalIndex) { var b = $("#cities_body > div"); $(b[nowIndex]).removeClass("hove"), nowIndex += 1, $(b[nowIndex]).addClass("hove") } else CPageIndex < totalPage && (nowIndex = 0, CPageIndex++, ShowCity()); else CPageIndex = 1, ShowCity(), SetTip() } function SetTip() { $("#cities_top").html("\u6309\u201c<span style='color:red'>" + $("#City").val() + "</span>\u201d\u5b57\u7b26\u68c0\u7d22\uff1a") } function ShowCity2() { $("#cities_body").attr("has") == "false" ? ShowCity() : $("#citysList").show(), $("#cities_top").html("\u8f93\u5165\u4e2d\u6587/\u62fc\u97f3\u6216\u2191\u2193\u9009\u62e9.") } function SetNewIndex(a) { nowIndex = 0, CPageIndex = a, ShowCity() } function ShowArea() { var a = $("#hdCity").val(); $.getJSON("/Hotel/GetArea", { cityID: a }, function (a) { $("#divAreaDetail").html(""); var b = "<table>"; $.each(a.Area, function (a, c) { a % 3 == 0 && (b += "<tr>"), b += "<td v='" + c.AreaID + "' type='1'>" + c.AreaName + "(" + c.C + ")" + "</td>", a % 3 == 2 && (b += "</tr>") }), b += "</table>", $("#divAreaDetail").html(b), $("#divRegionDetail").html(""), b = "<table>", $.each(a.Region, function (a, c) { a % 3 == 0 && (b += "<tr>"), b += "<td v='" + c.ID + "' type='2'>" + c.Name + "(" + c.C + ")" + "</td>", a % 3 == 2 && (b += "</tr>") }), b += "</table>", $("#divRegionDetail").html(b), $.each($("#divArea td"), function (a, b) { $(b).bind("mouseover", function () { $(b).css("background-color", "#cbe6f9") }), $(b).bind("mouseout", function () { $(b).css("background-color", "") }), $(b).bind("click", function () { $("#hdArea").val($(b).attr("v")), $("#hdType").val($(b).attr("type")), $("#Area").val($(b).text()), $("#divArea").hide() }) }), $("#divArea").show() }) } var CPageIndex = 1, nowIndex = 0, totalIndex = 0, totalPage = 0; $(function () { $("#City").keyup(function (a) { Fkey(a) }), $(document).click(function (a) { a.target.id != "City" && a.target.id != "citysList" && $(a.target).parent().attr("id") != "citysList" && $("#citysList").hide(), a.target.id != "Area" && a.target.id != "divArea" && $(a.target).parent().attr("id") != "divArea" && $("#divArea").hide() }) }); var now = new Date; $(function () { var a = new Date(now.getYear(), now.getMonth(), now.getDate()); $("#InDate").DatePicker({ date: now, current: now, format: "Y-m-d", starts: 0, calendars: 2, position: "right", onBeforeShow: function () { $("#InDate").val() != "" && $("#InDate").DatePickerSetDate($("#InDate").val(), !0) }, onRender: function (b) { return { disabled: b.valueOf() < a.valueOf(), className: b.valueOf() == a.valueOf() ? "datepickerSpecial" : !1} }, onChange: function (a, b) { $("#InDate").val(a), $("#InDate").DatePickerHide(), $("#InDate2").DatePickerShow() } }), $("#InDate2").DatePicker({ date: now, current: now, format: "Y-m-d", starts: 0, calendars: 2, position: "right", onBeforeShow: function () { $("#InDate").val() != "" && $("#InDate2").DatePickerSetDate($("#InDate").val(), !0) }, onRender: function (b) { return { disabled: b.valueOf() < $("#InDate").DatePickerGetDate(), className: b.valueOf() == a.valueOf() ? "datepickerSpecial" : !1} }, onChange: function (a, b) { $("#InDate2").val(a), $("#InDate2").DatePickerHide() } }) }), $(function () { $("#explore-nav li a").mouseover(function () { var a = $("#explore-nav li a.current").attr("rel"), b = $(this), c = $("#all-list-wrap").height(); $("#all-list-wrap").height(c), $("#explore-nav li a").removeClass("current"), b.addClass("current"); var d = b.attr("rel"); d != a && $("#" + a).fadeOut(300, function () { $("#" + d).fadeIn(); var a = $("#" + d).height(); $("#all-list-wrap").animate({ height: a }) }); return !1 }) }), $(function () { var a = $(".num > li").length, b = 0, c; $(".num li").mouseover(function () { b = $(".num li").index(this), showImg(b) }).eq(0).mouseover() }), $(document).ready(function () { $(".paging").show(), $(".paging a:first").addClass("active"); var a = $(".window").width(), b = $(".image_reel img").size(), c = a * b; $(".image_reel").css({ width: c }), rotate = function () { var b = $active.attr("rel") - 1, c = b * a; $(".paging a").removeClass("active"), $active.addClass("active"), $(".image_reel").animate({ left: -c }, 500) }, rotateSwitch = function () { play = setInterval(function () { $active = $(".paging a.active").next(), $active.length === 0 && ($active = $(".paging a:first")), rotate() }, 3e3) }, rotateSwitch(), $(".image_reel a").hover(function () { clearInterval(play) }, function () { rotateSwitch() }), $(".paging a").click(function () { $active = $(this), clearInterval(play), rotate(), rotateSwitch(); return !1 }) }), $(function () { $("#weiboTitle-nav li a").mouseover(function () { var a = $("#weiboTitle-nav li a.current").attr("rel"), b = $(this), c = $("#weibo-list-wrap").height(); $("#weibo-list-wrap").height(c), $("#weiboTitle-nav li a").removeClass("current"), b.addClass("current"); var d = b.attr("rel"); d != a && $("#" + a).fadeOut(300, function () { $("#" + d).fadeIn(); var a = $("#" + d).height(); $("#weibo-list-wrap").animate({ height: a }) }); return !1 }) })
