﻿// JScript 文件


function doSearch(winform) {
    /*var url = "rrfind.aspx";
    url += "?checkin=" + $('#txtCheckin').val();
    url += "&checkout=" + $('#txtCheckout').val();
    url += "&adults=" + $('#selGuest').val();
    url += "&rooms=" + $('#selRoom').val();
    url += "&ratecode=" + $('#txtPlanCode').val();

    window.location.href = url;
    */
    var fromDate = $("#txtCheckin").val();
    if (fromDate == "") {
        return false;
    }
    var toDate = $("#txtCheckout").val();
    if (toDate == "") {
        return false;
    }
    $("#fromyear").val(fromDate.split("-")[0]);
    $("#frommonth").val(fromDate.split("-")[1]);
    $("#fromday").val(fromDate.split("-")[2]);

    $("#toyear").val(toDate.split("-")[0]);
    $("#tomonth").val(toDate.split("-")[1]);
    $("#today").val(toDate.split("-")[2]);

    return hhotelDispoprice(winform);
}

function getWeekDay(value) {
    switch (value) {
        case 0: return "日"; break;
        case 1: return "一"; break;
        case 2: return "二"; break;
        case 3: return "三"; break;
        case 4: return "四"; break;
        case 5: return "五"; break;
        case 6: return "六"; break;
    
    }
}

function showDate() {
    var today = new Date();
    var output = "今天是 ";
    output += today.getFullYear()
    output += "年";
    output += today.getMonth() + 1;
    output += "月";
    output += today.getDate();
    output += "日 星期";
    output += getWeekDay(today.getDay());
    $('#showDate').html(output);
}


$(document).ready(function() {

    //$('div.navigation').css({'width' : '650px', 'height' : '65px'});

    var onMouseOutOpacity = 0.67;
    $('#navigation1 ul.thumbs li.img').opacityrollover({
        mouseOutOpacity: onMouseOutOpacity,
        mouseOverOpacity: 1.0,
        fadeSpeed: 'fast',
        exemptionSelector: '.selected'
    });

    var gallery = $('#navigation1').galleriffic({
        delay: 2000,
        numThumbs: 10,
        preloadAhead: 10,
        enableTopPager: true,
        enableBottomPager: true,
        maxPagesToShow: 3,
        imageContainerSel: '#slideshow1',
        controlsContainerSel: '',
        captionContainerSel: '',
        loadingContainerSel: '#loading1',
        renderSSControls: true,
        renderNavControls: true,

        playLinkText: ''
                    , pauseLinkText: ''
                    , prevLinkText: ''
                    , nextLinkText: ''
                    , nextPageLinkText: '&gt;'
                    , prevPageLinkText: '&lt;',

        enableHistory: false,
        autoStart: true,
        syncTransitions: true,
        defaultTransitionDuration: 900,
        onSlideChange: function(prevIndex, nextIndex) {
            // 'this' refers to the gallery, which is an extension of $('#thumbs')
            this.find('ul.thumbs li.img')
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
        },
        onPageTransitionOut: function(callback) {
            this.fadeTo('fast', 0.0, callback);
        },
        onPageTransitionIn: function() {
            this.fadeTo('fast', 1.0);
        }
    });

    showDate();
});



