﻿$(function() {
    $("#menu li img").hover(function() {
        var h = $(this).attr("src");
        h = h.replace("mi", "mmi");
        $(this).attr("src", h);
    }, function() {
        var h = $(this).attr("src");
        h = h.replace("mmi", "mi");
        $(this).attr("src", h);
    });

//    $(window).scroll(function() {
//        var $pic = $("#leftpic");
//        var wimHeight = parseInt($pic.css("height"));
//        var top = $(document).scrollTop() + $(window).height() - wimHeight - 50;
//        if (top < 570) { top = 570; }
//        if (top > $("#box").height() - $pic.height()) { top = $("#box").height() - $pic.height(); }
//        $pic.stop();
//        $pic.animate({ top: top }, 800);
//    });

    $("#tb_search").focus(function() {
        if ($(this).val() == "请输入关键字")
        { $(this).val(""); }
    });
    $("#tb_search").blur(function() {
        if ($(this).val() == "")
        { $(this).val("请输入关键字"); }
    });

    $("#bt_search").click(function() {
        var key = $("#tb_search").val();
        if (key == "" || key == "请输入关键字") {
            alert("请输入关键字");
        }
        else {
            location.href = "search.aspx?key=" + key;
        }
    });

    $(".about").mouseover(function() {
        var p = $(this).position();
        $(this).clone().appendTo("#box").attr("id", "clone").html("")
            .css({ position: "absolute", top: p.top, left: p.left, backgroundColor: "#8a8a8a", opacity: "0.1", border: "dotted 1px #000000" })
            .bind("mouseout", function() { $("#clone").remove(); });
    });

    $(".pt img").click(function() { $(this).parent().next(".pc").toggle(500); });

    //$("body").append("<div id='rightpic'><img src='images/rightpic.jpg' alt='联系我们' /></div>");
    //$("#rightpic").css({ position: "fixed", top: "50px", left: "0px" });

})

function domainstr()
{
   var oele = document.getElementsByName("hz");
   var str = "";
   for(var i=0;i<oele.length;i++)
   {
        if(oele[i].checked)
        {
            str+=oele[i].id+"#";
        }
   }  
   document.getElementById("hid_diamon").value = str;
}
