var module = "game";
$("#banner li").click(function(){
    $("#banner li").removeClass("leftcurr");
    $("#banner li").removeClass("rightcurr");
    $("#banner li").removeClass("centercurr");
    
    if ($(this).attr("title") == "game")
    {
        $(this).addClass("leftcurr");
    }
    else if ($(this).attr("title") == "article")
    {
        $(this).addClass("rightcurr");
    }
    else
    {
        $(this).addClass("centercurr");
    }
    module = $(this).attr("title");
});
function startSearch()
{
    if ($("#s").val() == "ÇëÊäÈë¹Ø¼ü×Ö" || $("#s").val() == "")
    {
        return false;
    }
    else
    {
        location.href = "/" + module + "/?s=" + encodeURIComponent($("#s").val().replace(/[\/_]/g," "));
	}
}
function startScreen()
{
    var screenCount = $(".screenlist li").length;
    $("#screenpage").html(1 + "/" + screenCount);
    showScreen(screenCount, 1);
}
function showScreen(count,startIndex)
{
    if (count > 1)
    {
        $(".screenlist li").hide();
        $(".screenlist li:eq(" + (startIndex-1) + ")").fadeIn("slow");
        
        $("#screenpage").html(startIndex + "/" + count);
        startIndex++;
        if (startIndex > count){startIndex = 1;}
        window.setTimeout("showScreen(" + count + "," + startIndex + ")", 3000);
    }
    else
    {
        $(".screenlist li").show();
    }
}
function addFav()
{
   if (document.all)
   {
      window.external.addFavorite(location.href,document.title);
   }
   else if (window.sidebar)
   {
      window.sidebar.addPanel(document.title, location.href, "");
   }
} 
function setHomepage()   
{   
 if (document.all)   
    {   
        document.body.style.behavior='url(#default#homepage)';   
        document.body.setHomePage(location.href);   
    }   
    else if (window.sidebar)   
    {   
    if(window.netscape)   
    {   
         try  
         {     
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");     
         }     
         catch (e)     
         {     
            alert(e);     
         }   
    }    
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);   
    prefs.setCharPref('browser.startup.homepage',location.href);   
 }   
}