﻿<!--$(document).ready(function() {
    $.ajax({
        type: "POST",
        //contentType: "application/xml",
        contentType: "application/x-www-form-urlencoded",
        url: "/ajax.asmx/CheckComingIP",
        data: {},
        dataType: 'xml',
        success: function(result) {
            if ($(result).find("boolean").text() == "false") {
                checkDay();
            }
        }
    });
});-->

function checkDay() {
    $.ajax({
        type: "POST",
        //contentType: "application/xml",
        contentType: "application/x-www-form-urlencoded",
        url: "/ajax.asmx/IsDay",
        data: {},
        dataType: 'xml',
        success: function(result) {
            if ($(result).find("boolean").text() == "true") {
                showDay();
            }
            else {
                showNight();
            }
        }
    });
}

function showDay() {
    $('#comingnoticeday').dialog({
        bgiframe: true,
        width: 678,
        height: 269,
        modal: true,
        resizable: false,
        zIndex: 100,
        title: '欢迎光临阳光巴士!'
    });
    $('#comingnoticeday').dialog('open');

    setTimeout(function() { $("#comingnoticeday").dialog("close"); }, 30000);
}

function showNight() {
    $('#comingnoticenight').dialog({
        bgiframe: true,
        width: 678,
        height: 269,
        modal: true,
        resizable: false,
        zIndex: 100,
        title: '晚上好,欢迎光临阳光巴士!'
    });
    $('#comingnoticenight').dialog('open');

    setTimeout(function() { $("#comingnoticenight").dialog("close"); }, 40000);
}
