﻿

function menuInit(item, type)
{
    var top = $(item).offset().top + $(item).height();
    var left = $(item).offset().left;
    document.getElementById("menuList").style.left = left.toString()+"px";
    document.getElementById("menuList").style.top = top.toString()+"px";
    $("#menuTable").html(formSelectType(type));
    $("#menuList").show();
}

function formSelectType(type)
{
    var htmlCode = "";
    var temp = $("#subTypeList").find("p")[type];
    var list = $(temp).find("a");
    for(i=0;i<list.size();i++)
    {
        if(type==5)
            htmlCode += "<tr style='background:#091721'><td align='center' width='70px'><a href='"+$(list[i]).attr("href")+"' target='_blank'>"+ $(list[i]).html() +"</a></td></tr>";
        else
            htmlCode += "<tr style='background:#091721'><td align='center' width='70px'><a href='"+$(list[i]).attr("href")+"'>"+ $(list[i]).html() +"</a></td></tr>";
    }
    return htmlCode;
}


function searchOnClick()
{
    var word = escape($("#searchKey").val().replace(/(^\s*)|(\s*$)/g,""));
    var typeList = $("#typeKindList1").find("input[type=checkbox]:checked:enabled");
    var typeStr = "";
    for(i=0;i<typeList.size();i++)
    {
        if(i>0) typeStr+="|";
        typeStr+=escape($(typeList[i]).val());
    }
    window.location='search.aspx?key='+word+'&typeKind='+typeStr;
}
