﻿// 判断浏览器
function isBrowser() {
    var isIE = !!window.ActiveXObject;
    var isIE6 = isIE && !window.XMLHttpRequest;
    var isIE8 = isIE && !!document.documentMode;
    var isIE7 = isIE && !isIE6 && !isIE8;
    if (isIE) {
        if (isIE6) {
            return 'IE6';
        } else if (isIE8) {
            return 'IE8';
        } else if (isIE7) {
            return 'IE7';
        }
    }
    else {
        return 'FF';
    }
}
// 头部 分站点 以及 头部菜单的搜索 下拉列表功能
function Domain_and_Type() {
    $("#sortDiv").click(function() {
        $('#drop_domain').hide();
        if (isBrowser() == "IE6")
            $('#drop_sort').animate({ opacity: "show" }, 800);
        else
            $('#drop_sort').animate({ opacity: "show", left: "368" }, 800);
    });
    $("#domainDiv").click(function() {
        $('#drop_sort').hide();
        if (isBrowser() == "IE6")
            $('#drop_domain').animate({ opacity: "show" }, 800);
        else
            $('#drop_domain').animate({ opacity: "show", left: "478" }, 800);
    });
    $(".head__domainDiv").click(function() {
        $('#drop_head_domainlist').animate({ opacity: "show" }, 800);
    });
    if (window.addEventListener) {
        document.addEventListener("click", function(event) {
            var ev = event || window.event;
            var el = ev.srcElement || ev.target;
            if (el.className == "td_mymenu_old td_mymenu_o" || el.className == "td_mymenu_old") return;
            drop_Hide();

        }, false);
    } else {
        document.attachEvent("onclick", function(event) {
            var ev = event || window.event;
            var el = ev.srcElement || ev.target;
            if (el.className == "td_mymenu_old td_mymenu_o" || el.className == "td_mymenu_old") return;
            drop_Hide();
        });
    }
}
function drop_Hide() {
    if (document.getElementById('drop_head_domainlist') != null && document.getElementById('drop_head_domainlist').style.display != 'none')
        $('#drop_head_domainlist').animate({ opacity: "hide" }, 800);
    if (document.getElementById('drop_sort') != null && document.getElementById('drop_sort').style.display != 'none')
        $('#drop_sort').animate({ opacity: "hide" }, 800);
    if (document.getElementById('drop_domain') != null && document.getElementById('drop_domain').style.display != 'none')
        $('#drop_domain').animate({ opacity: "hide" }, 800);
}