/* This launches the php script to check the mail, and if there is some sends it to the message script so that a new message can appear in the message bar. */ var mail=new Object(); mail.Mailbox=function(userId){ this.userId=userId; if (userId){ this.checkMail(); } } mail.Mailbox.prototype={ checkMail:function(){ var checker=new net.ContentLoader("libs/ajax.php?action=checkmail&userid="+this.userId, this.gotMail); }, gotMail:function(){ var mailNum=this.req.responseText; if (mailNum && mailNum!='0'){ var newMail=new msg.Message("mailMsg0"+msgId, "You have "+mailNum+" messages", null, null, "images/msg_mail.png"); } this.reloadMail(); msgId++; }, reloadMail:function(){ self=this; setTimeout("self.checkMail()", 10*1000); } };