﻿var menuStatu = 1; //case 1:open; case 2:close;
$(document).ready(function () {
    
    MenuInit(); //初始化函数
});


function input() {
    //搜索框
    $(".IndexPageInput")[0].value = "";
    $(".IndexPageInput")[0].style.color = "#333";
}


function MenuInit() {
    

    $(".RSSPanel").hover(function () {
        $(this).find("div").show(100);
    }, function () {
        $(this).find("div").hide(100);
    });

    $("#QuickSearch").hover(function () {
        $(this).find("div").show(100);
        $(this).attr("style", "border-bottom:0");
    }, function () {
        $(this).find("div").hide(100);
        $(this).attr("style", "border-bottom:3px solid #3aacdb");
    });




    $("#menu .l1").hover(function () {
        //鼠标经过时候的样式
        $(this).find("div").show();
        $(this).addClass("hover");
    }, function () {
        //鼠标离开之后的样式
        $(this).find("div").hide();
        $(this).removeClass("hover");
    });

    $("#ImageLinks div").hover(
        function () {
            $(this).find("img").attr("style", "border:3px solid #3aacdb");
            $(this).attr("style", "background:#3aacdb");
            $(this).find("span").attr("style","color:#fff");
        },
        function () {
            $(this).find("img").attr("style", "border:3px solid #d2d2d2");
            $(this).attr("style", "background:#fff");
            $(this).find("span").attr("style", "color:#000");
        }
    );

    $("#NewsList table tr").hover(
        function () {
            $(this).find(".NewsListTitle").attr("style", "background:url(../images/IDI_LINK_BG_1.gif) left no-repeat #ddd");
            $(this).find(".NewsListDate").attr("style","background:#ddd");
        },
        function () {
            $(this).find(".NewsListTitle").attr("style", "background:url(../images/IDI_LINK_BG_1.gif) left no-repeat");
            $(this).find(".NewsListDate").attr("style", "background:#fff");
        }
    );
    $(".NewsBox table tr").hover(
        function () {
            $(this).find(".NewsListTitle").attr("style", "background:url(../images/IDI_LINK_BG_1.gif) left no-repeat #ddd");
            $(this).find(".NewsListDate").attr("style", "background:#ddd");
        },
        function () {
            $(this).find(".NewsListTitle").attr("style", "background:url(../images/IDI_LINK_BG_1.gif) left no-repeat");
            $(this).find(".NewsListDate").attr("style", "background:#fff");
        }
    );

        $("#footer .yy").hover(function () {
            $("#footer .yy .hide").show();
        }, function () {
            $("#footer .yy .hide").hide();
        });
}


function addtag() {
    $("#codetest").attr("value",$("#codetest").attr("value") + "##");
}

function btn_ok() {
    var strArray = $("#codetest").attr("value").split("#");
    var innerHtml = "";
    for (var i = 0; i < strArray.length; i++) {
        if (0 == i % 2) {
            innerHtml += strArray[i];
        } else {
            var src = "App_Module/TwoDimentionCode.aspx?s=" + strArray[i];
            innerHtml += "<span class='codepanel'><img src='images/IDI_CODE.gif' /><div><img src='" + src + "' /><span>使用手机摄像头解码</span></div></span>";
        }
    }
    var tempInfoPanel = innerHtml;
    var tempInfoWindow = new google.maps.InfoWindow({ content: tempInfoPanel });

    //google.maps.event.addListener(marker, 'click', function () {
        tempInfoWindow.open(map, marker);
    //});

    $("#MBlog").html(innerHtml);
    reflashcode();
}
function clear() {
    $("#codetest").attr("value", " ");
}

function reflashcode() {
    $(".codepanel").each(function () {
        $(this).click(function () {
            $(".codepanel div").hide("quick");

            if ($(this).find("div").is(":visible")) {
                //如果已经显示，则神马都不做
            } else {
                //如果未显示，把它显示出来
                $(this).find("div").show("quick");
            }

            $(".codepanel").css("z-index", "1");
            $(this).css("z-index", "65535");
        });
    });

    $(".ReplyPanelCtrl .ReplyImg").click(function () {

        if ($(this).parent().find(".ReplyPanel").is(":visible")) {
            //如果已经显示，则神马都不做
            $(this).parent().find(".ReplyPanel").hide("slow");
        } else {
            //如果未显示，把它显示出来
            $(this).parent().find(".ReplyPanel").show("quick");
        }

        //$(this).find(".ReplyPanel").hide("slow");
    });
}

