﻿$(function() {
    $('#areadialog').dialog({
        autoOpen: false,
        resizable: false,
        width: 480,
        height: 480
    });
});

function OnpenAreaDialog() {
    $('#areadialog').dialog('open');
}
function AreaClose() {
    $("#selAreaIdByBox").val(document.getElementById("areamyFrame").contentWindow.document.getElementById("HidRegionId").value.Trim());
    $("#selAreaNameByBox").text(document.getElementById("areamyFrame").contentWindow.document.getElementById("HidAreaName").value.Trim());
    $("#hidSelAreaNameByBox").val(document.getElementById("areamyFrame").contentWindow.document.getElementById("HidAreaName").value.Trim());
    $("#selAreaLayer").val(document.getElementById("areamyFrame").contentWindow.document.getElementById("HidAreaLayer").value.Trim());
    $('#areadialog').dialog('close');
}
String.prototype.Trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function IsShowTop(num, name) {
    for (var i = 1; i <= 4; i++) {
        if (i == num) {
            document.getElementById("top" + i).className = "top_bg9 hong14c";
            document.getElementById("SelType").value = name;
        }
        else {
            document.getElementById("top" + i).className = "top_bg5 hei14c";
        }
    }
}

$(function() {
    var f = false;
    /* userAgent是否存在360chrome */
    if (navigator.userAgent.toLowerCase().indexOf("360chrome") > -1) {
        f = true;
    }
    try {
        /* 判断浏览器的路径是否存在360se，如果无法获取，则非360浏览器 */
        if (window.external && window.external.twGetRunPath) {
            var r = external.twGetRunPath();
            if (r && r.toLowerCase().indexOf("360se") > -1) f = true;
        }
    } catch (e) {
        f = false;
    }
    if ($.browser.msie) {
        $("#datelist").addClass("STYLE1");
        if ($.browser.version == '6.0') {
            $("#datelist").css("marginLeft", "92");
        }
        else if ($.browser.version == '7.0') {
            $("#datelist").css("marginLeft", "92");
        }
        else if ($.browser.version == '8.0') {
            $("#datelist").css("marginLeft", "502");
        }
        if ($.browser.version == '8.0' && f) {
            $("#datelist").css("marginLeft", "92");
        }
    }
    else {
        $("#datelist").addClass("STYLE2");
    }
});

function isshowdate() {
    $("#datelist").css("display", "block");
}

function hide() {
    $("#datelist").css("display", "none");
}

function selectdate(count, name) {
    $("#selSearchDate").val(count);
    $("#seldate").text(name);
    $("#datelist").css("display", "none");
}


