﻿// JScript File

function OnlineUsers(o) {
    GEID("onlineuserslist").innerHTML=o;
}
function DailyRotten(o) {
    GEID("onthisday").innerHTML=o;
}
function initpanels() {
   var s="menumain,onlineusers,onthisday".split(",");
   for(var i=0;i<s.length;i++)  {
    if (readCookie(s[i])=="0")
        showhide(s[i], GEID(s[i]+"ttl"));
   }
}
function GetOnline() {
    Zedheads.GetOnlineUsers(OnlineUsers);
}
function GetDailyRotten(LastID)  {
     Zedheads.GetDailyRotten(LastID,DailyRotten);
}
function setstyle(o)  {
    var style=o.options[o.selectedIndex].value;
   dosetstyle(style);
}
function linkstyle()    {
    alert("This redirects to a URL you can send people, to show them this style.");
    document.location.href="default.aspx?redirecttostyle=true&r="+Math.random();
}
function dosetstyle(s)  {
   if (s=="change")
    return; 
   else
   {
    createCookie("style",s,30);
    eraseCookie("menumain");
    eraseCookie("onlineusers");
    eraseCookie("onthisday");
    reload(); 
   } 
}

if (typeof(Sys) !== 'undefined') {
    Sys.Application.add_load(initpanels);
    Sys.Application.notifyScriptLoaded();
} 