﻿function firstWordOver(id, firstWord) {
    $(".pinyin_r").find("a").each(function() {
        $(this).removeAttr("class");
    });
    $("#" + id).attr("class", "here");
    pre = id;
    $("#floatFirst").css("display", "block");
    $.ajax({
        type: "POST",
        url: "../Handler/Index.ashx" + "?a=firstWord&f=" + firstWord + "&r=" + Math.random(),
        async: false,
        success: function(msg) {
            $("#container").html("");
            $("#container").html(msg);
        },
        error: function() {
            $(".fuceng").innerHTML = "操作超时，请稍候重试！";
        }
    })
}
var pre = null;
function firstWordOut() {
    
    $(".pinyin_r").find("a").each(function() {
//        if ($("#floatFirst").css("display") == "none") {
            $(this).removeAttr("class");
            //        }
            $("#floatFirst").css("display", "none");
    });
}
function floatFirstOut() {
    $("#floatFirst").css("display", "none");
    $(".pinyin_r").children("a").each(function() {
        $(this).removeAttr("class");
    });
}
function floatFirstOver() {
    $("#"+pre).attr("class", "");
    $("#"+pre).attr("class", "here")
    $("#floatFirst").css("display", "block");
}


function changeList(obj, categoryId, brandId, listId) {
    $(obj).parent().parent().children("li").each(function() {
        $(this).children("a").attr("class", "a_2");
    })
    $(obj).attr("class", "a_01");
    var siteId=$("#siteId").val();
    $.ajax({
        type: "POST",
        url: "../Handler/Index.ashx" + "?a=GetCenterList&categoryId=" + categoryId + "&brandId="+brandId+"&siteId="+siteId+"&r=" + Math.random(),
        async: false,
        success: function(msg) {
            $("#" + listId).html("");
            $("#" + listId).html(msg);
        },
        error: function() {
            $(".fuceng").innerHTML = "操作超时，请稍候重试！";
        }
    })
}

function SelectChange(obj) {

//    return false;
//    var text = escape($(obj).val());
//    var siteId = $("#siteId").val();
//    $.ajax({
//        type: "POST",
//        url: "../Handler/Index.ashx" + "?a=GetProduct&pName=" + text + "&siteId=" + siteId + "&r=" + Math.random(),

//        async: false,
//        success: function(msg) {
//            if (msg!='') {
//                $(".selectDiv").css("display", "block");
//                $(".selectDiv").html("");
//                $(".selectDiv").html(msg);
//            }

//        },
//        error: function() {
//            $(".selectDiv").innerHTML = "操作超时，请稍候重试！";
//            //                            Process = false;
//        }
//    })

}

function CloseSelect(obj) {
    $(".selectDiv").css("display", "none");
}
function doSearch() {
    
    location.href = '/s/?key=' + escape($("#sea_ky").val());
}

function addsea(obj) {
    
    if ($(obj).val() == "") {
        $(obj).val("请输入您想要搜索的产品，如手机 N82");
    }
}
function clearsea(obj) {
    
    if ($(obj).val() == "请输入您想要搜索的产品，如手机 N82") {
        $(obj).val("");
    }
}