vBulletin.events.systemInit.subscribe(function(){ragtek_chat.init()});var ragtek_chat={init:function(){YAHOO.util.Event.on("showchat","click",this.send,this,true);this.update()},send:function(a){YAHOO.util.Event.stopEvent(a);YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=showchat",{success:this.showchat,failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout,},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1&do=showchat")},showchat:function(b){YAHOO.util.Dom.get("chatcontainer").innerHTML='<iframe src="ajax.php?do=showchat" height="400px" width="100%"></iframe>'},update:function(){YAHOO.util.Connect.asyncRequest("POST","ajax.php?do=updatechatuser",{success:this.showupdate,failure:vBulletin_AJAX_Error_Handler,timeout:vB_Default_Timeout},SESSIONURL+"securitytoken="+SECURITYTOKEN+"&ajax=1")},showupdate:function(b){if(b.responseXML){YAHOO.util.Dom.get("ragtek_ajaxchater").innerHTML=b.responseXML.getElementsByTagName("template")[0].firstChild.nodeValue;YAHOO.util.Dom.get("chatstatheader").innerHTML=b.responseXML.getElementsByTagName("tableheader")[0].firstChild.nodeValue}setTimeout("ragtek_chat.update()",90000)}};