var is_iexplore = document.all;

//current controls focus index
var channel_cur_ctr_foc = 0;

function headjoyescom_Login(lurl)
{
    var uv = document.getElementById("top_username").value;
    var pv = document.getElementById("top_password").value;
    var uri = document.location.href;
    window.location.href = lurl +"?u="+ escape(uri) +"&user="+ escape(uv) +"&pass="+ escape(pv) +"&fr=head";
}

//so
function headjoyescom_soInner()
{
    var s = document.getElementById("so_sort").value;
    var k = document.getElementById("word").value;
    var uri = "";
    if(k != "")
    {
        switch(parseInt(s))
        {
            case 0 : uri = "index.aspx";
                break;        
            case 1 : uri = "Search_Game.aspx";
                break;
            case 2 : uri = "Search_ring.aspx";
                break;
            case 3 : uri = "Search_Pic.aspx";
                break;
            case 4 : uri = "Search_Ebook.aspx";
                break;
            case 5 : uri = "Search_Theme.aspx";
                break;
            case 6 : uri = "Search_Tool.aspx";
                break; 
            case 7 : uri = "Search_Movie.aspx";
                break;                 
            default : uri = "index.aspx";
                break;
        }
        uri = "http://www.joyes.com/search/"+ uri +"?words="+ escape(k);
        window.location.href = uri;
    }
    else
    {
        channel_cur_ctr_foc = 0;
        document.getElementById("word").focus();
        alert("ÇëÊäÈëËÑË÷¹Ø¼ü×Ö!");
    }
}

//enter
function headjoyescom_mainctlkey()
{
    if(window.event.keyCode == 13)
    {
//        if(channel_cur_ctr_foc == 50001)
//        {
//            //so
//            headjoyescom_soInner();
//        }
        headjoyescom_soInner();
    }
}

if(is_iexplore)
{
    window.document.onkeydown = headjoyescom_mainctlkey;
}