﻿$(function () {

    //$(".search_text").attr("disabled", "disabled");
    var select = $(".br");
    var values = $(".searchtext").val();
       
    /************************************/
    $(".search_text").focus(function () {
        $(this).removeClass("text_blur");
        $(this).addClass("text_focus");
       
        if ($(this).val() == values) {
            $(this).val("");
        }
    });
    $(".search_text").blur(function () {
        if ($(this).val() == values || $(this).val() == "") {
            $(this).val(values);
            $(this).removeClass("text_focus");
            $(this).addClass("text_blur");
        }
    });
    /************************************/
    $(".box_right").click(function () {

        $("#searchType").attr("value", $("#cate").attr("value"));
        $("#searchForm").submit();
    });


    select.children("span").click(function () {
        select.children("ul").height(0);
        select.children("ul").css("display", "block");
        select.children("ul").animate({ "height": "115" }, 100);
    });

    select.children("ul").hover(
                function () {
                    return false;
                },
                function () {
                    $(this).css("display", "none");
                });

    select.find("li").click(function () {
        select.children("span").text($(this).text());
        select.children("span").attr("value", $(this).text());
        select.children("ul").trigger("mouseout");
    });



    var select1 = $(".phone");
    select1.click(function () {
        select1.children("ul").height(0);
        select1.children("ul").css("display", "block");
        select1.children("ul").animate({ "height": "115" }, 100);
    });

    select1.children("ul").hover(
                function () {
                    return true;
                },
                function () {
                    $(this).css("display", "none");
                });

    select1.find("li").click(function () {
        select1.children("span").text($(this).text());
        select1.children("span").attr("value", $(this).attr("value"));
        select1.children("ul").trigger("mouseout");
        set_cookie({ "system": $(this).attr("system") }, 0);
        //alert(get_cookie("system"));
        location.href = location.href;
    });

});
