var curircmd = null, curircmdlist = null, curircmdIdx = null, curircmdIdxlist = null;
var ibox1obj = null, ibox1obj1 = null, ibox2obj = null, ibox2obj1 = null, ibox3obj = null, ibox3obj1 = null, ibox4obj = null, ibox4obj1 = null;

function initIrcmd() {
    $("#ircmd_nav a").bind("click", function (e) {     
        if (curircmd == null)
            curircmd = $("#ircmd_nav a:first");
        curircmd.attr("class", "");
        $(this).attr("class", "cur");
        curircmd = $(this);
        //list
        if (curircmdlist == null)
            curircmdlist = $("#" + $("#ircmd_nav a:first").attr("name"));
        curircmdlist.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        curircmdlist = $("#" + _name);
    });

    $("#ircmdIdx_nav li").bind("mousemove", function (e) {
        if (curircmdIdx == null)
            curircmdIdx = $("#ircmdIdx_nav li:first");
        curircmdIdx.attr("class", "");
        $(this).attr("class", "cur");
        curircmdIdx = $(this);
        //list
        if (curircmdIdxlist == null)
            curircmdIdxlist = $("#" + $("#ircmdIdx_nav li:first").attr("name"));
        curircmdIdxlist.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        curircmdIdxlist = $("#" + _name);
    });
   
}

function initBox() {
    //box bind
    $("#ibox_id1 a").bind("click", function (e) {
        if (ibox1obj == null)
            ibox1obj = $("#ibox_id1 a:first");
        ibox1obj.attr("class", "");
        $(this).attr("class", "cur");
        ibox1obj = $(this);
        //list
        if (ibox1obj1 == null)
            ibox1obj1 = $("#" + $("#ibox_id1 a:first").attr("name"));
        ibox1obj1.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        ibox1obj1 = $("#" + _name);
    });
    //box2 bind
    $("#ibox1_nav li").bind("mousemove", function (e) {
        if (ibox2obj == null)
            ibox2obj = $("#ibox1_nav li:first");
        ibox2obj.attr("class", "");
        $(this).attr("class", "cur");
        ibox2obj = $(this);
        //list
        if (ibox2obj1 == null)
            ibox2obj1 = $("#" + $("#ibox1_nav li:first").attr("name"));
        ibox2obj1.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        ibox2obj1 = $("#" + _name);
    });  
    //box3 bind
    $("#ibox2_nav li").bind("mousemove", function (e) {
        if (ibox3obj == null)
            ibox3obj = $("#ibox2_nav li:first");
        ibox3obj.attr("class", "");
        $(this).attr("class", "cur");
        ibox3obj = $(this);
        //list
        if (ibox3obj1 == null)
            ibox3obj1 = $("#" + $("#ibox2_nav li:first").attr("name"));
        ibox3obj1.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        ibox3obj1 = $("#" + _name);
    }); 
    //box4 bind
    $("#ibox3_nav li").bind("mousemove", function (e) {
        if (ibox4obj == null)
            ibox4obj = $("#ibox3_nav li:first");
        ibox4obj.attr("class", "");
        $(this).attr("class", "cur");
        ibox4obj = $(this);
        //list
        if (ibox4obj1 == null)
            ibox4obj1 = $("#" + $("#ibox3_nav li:first").attr("name"));
        ibox4obj1.css("display", "none");
        _name = $(this).attr("name");
        $("#" + _name).css("display", "");
        ibox4obj1 = $("#" + _name);
    }); 
}