﻿var AllPageHeaderMenu = "IndexTop";
function Trans(Type) {
    if (Type == "index") document.location.href = "http://www.tuzi88.com/";
    else if (Type == "shuaYouA") document.location.href = "/shuazuan_main.aspx?xushi=1&obj=3";   
    else if (Type == "taocan") document.location.href = "/taocan.aspx";
    else if (Type == "News") document.location.href = "/NewsCenter.aspx";
    else if (Type == "Help") document.getElementById("aHelp").href = "/liu.aspx";
    else if (Type == "Agent") document.getElementById("aAgent").href = "/TotalAgentMember.aspx";
}
var InMenu = null;
function HeaderMoveIn(obj) {
    if (InMenu != null) $("#" + InMenu.id).attr("class", "m2");
    InMenu = obj;
    $("#" + AllPageHeaderMenu).attr("class", "m2");
    $("#" + obj.id).attr("class", "m1");
    if (obj.id == "shuaTaoBaoTop") { TaoBaoListMoveIn(); PaiPaiListMoveOut(); ShouCanListMoveOut(); }
    else if (obj.id == "shuaPaiPaiTop") { PaiPaiListMoveIn(); TaoBaoListMoveOut(); ShouCanListMoveOut(); }
    else if (obj.id == "shouTop") {ShouCanListMoveIn();TaoBaoListMoveOut(); PaiPaiListMoveOut(); }
    else { TaoBaoListMoveOut(); PaiPaiListMoveOut();ShouCanListMoveOut(); }
}
function HeaderMoveOut(obj) {
    $("#" + InMenu.id).attr("class", "m2");
    $("#" + AllPageHeaderMenu).attr("class", "m1");
}
function TaoBaoListMoveIn() {
    $("#dTopTaoBaoList").css("display", "block");
    $("#dTopTaoBaoList").css("left", (RJ_getPoint(document.getElementById("shuaTaoBaoTop")).x - 1).toString() + "px");
    $("#dTopTaoBaoList").css("top", (RJ_getPoint(document.getElementById("shuaTaoBaoTop")).y + 35).toString() + "px");
}
function TaoBaoListMoveOut() {
    $("#dTopTaoBaoList").css("display", "none");
}
function PaiPaiListMoveIn() {
    $("#dPaiPaiList").css("display", "block");
    $("#dPaiPaiList").css("left", (RJ_getPoint(document.getElementById("shuaPaiPaiTop")).x - 1).toString() + "px");
    $("#dPaiPaiList").css("top", (RJ_getPoint(document.getElementById("shuaPaiPaiTop")).y + 35).toString() + "px");
}
function PaiPaiListMoveOut() {
    $("#dPaiPaiList").css("display", "none");
}
function ShouCanListMoveIn() {
    $("#dShouCanList").css("display", "block");
    $("#dShouCanList").css("left", (RJ_getPoint(document.getElementById("shouTop")).x - 1).toString() + "px");
    $("#dShouCanList").css("top", (RJ_getPoint(document.getElementById("shouTop")).y + 35).toString() + "px");
}
function ShouCanListMoveOut() {
    $("#dShouCanList").css("display", "none");
}
function ShowTopShuaZuan(obj) {
    $("#AllTopShauZuan").css("display", "block");
    var x = RJ_getPoint(obj).x;
    document.getElementById("AllTopShauZuan").style.left = (x - 115) + "px";
}
function ShowTopShouCan(obj) {
    $("#AllTopShouCan").css("display", "block");
    $("#AllTopShouCan").css("left", (RJ_getPoint(obj).x - 90).toString() + "px");
}
function DivEvent(e) {
    var evt = arguments[0] || window.event;
    var element = evt.srcElement || evt.target;
    //alert(element.tagName);      //alert(element.id+"_"+element.tagName);    
    var ID = element.id
    if (ID != "Header1_spnZhuaDao") {
        $("#AllTopShauZuan").css("display", "none");
    }
    if (ID != "Header1_spnCanZhuaDao") {
        $("#AllTopShouCan").css("display", "none");
    }
    if (ID != "dTopTaoBaoList") {
        TaoBaoListMoveOut();
    }
    if (ID != "dPaiPaiList") {
        PaiPaiListMoveOut();
    }
    if (ID != "dShouCanList") {
        ShouCanListMoveOut();
    }
}
function SetQqServices() {
    $.ajax({
        url: "/HeaderQQ.aspx",
        data: "Ajax=true&SetQqClientService=true",
        cache: false,
        success: function(html) {
            $("#topQqD").html(html);
            html = "";
        },
        error: function(html) {
            $("#topQqD").html("");
        }
    });    
}
function ShowQqServices() {

    // $("#topQqD").html($("#hTopQ").val());
    if ($.trim($("#topQqD").html()) == "") return;
        //$("#topQqD").html(parent.frames["iFrmQQ"].document.getElementById("frmHeaderQqD").innerHTML);      
        
        $("#topQqD").css("display", "block");
}
function CloseQqServices() {
    $("#topQqD").css("display", "none");
}
function TopTransUrl(action) {
    switch (action) {
        case "login": document.location.href = "/login.aspx"; return;
        case "register": document.location.href = "/Register.aspx"; return;
    }
}
