var xmlhttp, xmlhttpshout;var cur_sort_cellid;var shout_lastStamp;var shout_IP;var shout_timer;var shout_online;var server_timer;var server_IP;var shout_rendered;function getXMLHTTP() {var xmlhttp=false;/*@cc_on @*//*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } }@end @*/if (!xmlhttp && typeof XMLHttpRequest!='undefined') {xmlhttp = new XMLHttpRequest();}return xmlhttp;}function loadShoutXML(ip, stamp) {var stamptxt='';if (stamp!='' && typeof(stamp)!='undefined') {stamptxt='&stamp='+stamp;} else {shout_rendered=false;}shout_IP=ip;xmlhttpshout.open("GET", "/client/shout-xml.php?ip="+ip+stamptxt,true);xmlhttpshout.onreadystatechange=function(){ if (xmlhttpshout.readyState==4) {if (xmlhttpshout.responseText!='') {processShoutXML(xmlhttpshout.responseXML);} else {shout_timer=setTimeout('loadShoutXML("'+ip+'",'+stamp+')', 2500);}}}; xmlhttpshout.send(null);}function sendShoutMessage(ip, stamp, sender, txt) {var stamptxt='';if (stamp!='' && typeof(stamp)!='undefined') {stamptxt='&stamp='+stamp;}shout_IP=ip;xmlhttpshout.open("GET", "/client/shout-xml.php?ip="+ip+stamptxt+'&sender='+escape(sender)+'&message='+escape(txt).replace('+','%2B'),true);xmlhttpshout.onreadystatechange=function(){if (xmlhttpshout.readyState==4) {if (xmlhttpshout.responseText!='') {processShoutXML(xmlhttpshout.responseXML);} else {shout_timer=setTimeout('loadShoutXML("'+ip+'",'+stamp+')', 2500);}}};xmlhttpshout.send(null);}function processShoutXML(responseXML) {var shout;for (var i=0; i ';txt+='
';txt+='
';txt+=' ';txt+='
';txt+='';txt+='';txt+='
';writeWindow(4,txt);shout_rendered=true;}swin=document.getElementById('shout_window');var table=document.getElementById('shoutbox');var curmessage;var row;var defMsg;if (typeof(shout.message)!='undefined') {if (typeof(shout.message.length)=='undefined') {var tmpo=shout.message;shout.message=new Array();shout.message[0]=tmpo;}for (var i=0; i3) {if (curmessage.content.substring(0,3).toLowerCase()=='/me') {tableNewCell(row, ''+htmlspecialchars(curmessage.sender+curmessage.content.substring(3))+'');defMsg=false;}}if (defMsg) tableNewCell(row, ''+htmlspecialchars(curmessage.sender)+': '+htmlspecialchars(curmessage.content));shout_lastStamp=curmessage.stamp;}swin.scrollTop=swin.scrollHeight-swin.clientHeight}if (shout_online!=shout.online) {if (shout.online>1) {writeWindowTitle(4,'Shout Box ('+shout.online+' users online)');} else {writeWindowTitle(4,'Shout Box ('+shout.online+' user online)');}shout_online=shout.online;}if (typeof(shout_lastStamp)=="undefined") shout_lastStamp=1;shout_timer=setTimeout('loadShoutXML(shout_IP, shout_lastStamp)', 2500);}function replaceAll( str, replacements ) {var idx;for ( i = 0; i < replacements.length; i++ ) {idx = str.indexOf( replacements[i][0] );while ( idx > -1 ) {str = str.replace( replacements[i][0], replacements[i][1] );idx = str.indexOf( replacements[i][0] );}}return str;}function htmlspecialchars(txt) {return replaceAll(txt,[['&','|_amp;'],['<','<'],['>','>'],['"','"'],['|_amp;','&']]);}function renderDate(offset) {var nd=new Date(new Date().getTime()-(offset*1000));var txt='';with (nd) {if (getMonth()<9) txt+='0';txt+=(getMonth()+1)+'-';if (getDate()<10) txt+='0';txt+=getDate()+' ';if (getHours()<10) txt+='0';txt+=getHours()+':';if (getMinutes()<10) txt+='0';txt+=getMinutes()+':';if (getSeconds()<10) txt+='0';txt+=getSeconds();}return txt;}function shout_name_keyPress(event) {if (event.keyCode==13) {var win=document.getElementById('shout_scontent');win.focus();return false;}return true;}function shout_content_keyPress(event) {if (event.keyCode==13) {var win=document.getElementById('shout_scontent');var nwin=document.getElementById('shout_sname');if (typeof(shout_timer)!='null') {clearTimeout(shout_timer);}if (nwin.value!='') {sendShoutMessage(shout_IP, shout_lastStamp, nwin.value, win.value);win.value='';win.focus();} else {nwin.focus();}return false;}return true;}function tableNewCell(row, txt) {var cell;cell=row.insertCell(-1);cell.innerHTML=txt;}function loadServerXML(ip) {xmlhttp.open("GET", "/client/server-xml.php?ip="+ip,true);xmlhttp.onreadystatechange=function() {if (xmlhttp.readyState==4) {processServerXML(xmlhttp.responseXML); }};xmlhttp.send(null);server_IP=ip;}function processServerXML(responseXML) {var server;for (var i=0; i'+txt+'  ';}function renderServerGraphs(ip) {var stamp=new Date();var extra=stamp.getDate()+'.'+stamp.getHours()+'.'+Math.floor(stamp.getMinutes()/5);writeWindow(1,'');writeWindow(3,'');}function renderColumnPairs(title, text, c1,c2) {var sizetxt1='', sizetxt2='';if (c1>0) sizetxt1+=' colspan="'+c1+'"';if (c2>0) sizetxt2+=' colspan="'+c2+'"';return ' '+title+' '+text+'';}function getParent(el, pTagName) {if (el == null) return null;else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) {return el;} else {return getParent(el.parentNode, pTagName);}}function table_sort(el,typ) {cur_sort_cellid=el.parentNode.cellIndex;var span;var elp=el.parentNode;for (var i=0; ibb) return 1;if (bb>aa) return -1;return 0;}function renderPlayerWindow(server) {var players=server.players.player; if (typeof(players)!="undefined" && typeof(players.length)!="undefined") { var txt='';txt+='';txt+=renderSHeaderColumn('Name','istr');txt+=renderSHeaderColumn('Score','num');txt+=renderSHeaderColumn('Time','num');txt+=renderSHeaderColumn('Ping','num');txt+=''; for (var i=0; i';txt+='';txt+='';txt+='';txt+=''; }txt+='
'+players[i].score+' '+players[i].duration+' '+players[i].ping+'
'; writeWindow(0,txt); } else { writeWindow(0,'No players found!'); }writeWindowTitle(0,'Players Online ('+server.players.current+'/'+server.players.max+')');}function renderServerInfoWindow(server) {var txt='';txt+='';txt+=renderColumnPairs('Name:',''+server.name+'',1,3);txt+='';txt+=renderColumnPairs('IP:',server.fullip);txt+=renderColumnPairs('Players:',server.players.current+'/'+server.players.max);txt+='';txt+=renderColumnPairs('Game:',server.game.longname);txt+=renderColumnPairs('Average:',server.players.average+'/'+server.players.max);txt+='';txt+=renderColumnPairs('Map:',server.map);txt+=renderColumnPairs('Failed:',server.fail);txt+='';txt+=renderColumnPairs('Game Rank:',server.rank.game);txt+=renderColumnPairs('Ovr Rank:',server.rank.overall);txt+='';txt+=renderColumnPairs('Updated:',server.lastUpdate);txt+=renderColumnPairs('Uptime:',server.uptime+'%');txt+='';txt+='
';writeWindow(2,txt);writeWindowTitle(2,'Server Info');}function processXML(xmlnode) {var cxml=new Object(), txt='', tmpobj, tmpobj2, destname;var curNode;if (xmlnode.childNodes.length>1 || (xmlnode.childNodes.length==1 && xmlnode.childNodes[0].nodeName!='#text')) {for (var i=0; i';txt+='
';txt+='
0) txt+=' style="width: '+(width-8)+'px;"';txt+=' class="windowHeader" onmousedown="dragWindow(event,\'window_'+id+'\')"';txt+=' ondblclick="toggleWindow(event, \'window_'+id+'_content\')">';txt+='';txt+='
'+title+'
';txt+='
0 || height>0 ) {txt+=' style="';if ( width>0 ) txt+='width: '+(width-8)+'px; ';if ( height>0 ) txt+='height: '+(height-28)+'px';txt+='"';}if (scroll>0) {txt+=' class="windowContent_scrollable"';} else {txt+=' class="windowContent"';}txt+=' id="window_'+id+'_content" onclick="document.getElementById(\'window_'+id+'\').style.zIndex = ++dragObj.zIndex;" '+extra+'>';txt+='
';document.write(txt);}function writeWindow(id, txt) {var el=document.getElementById('window_'+id+'_content');el.innerHTML=txt;}function writeWindowTitle(id, txt) {var el=document.getElementById('window_'+id+'_title');el.innerHTML=txt;}function writeAppendWindow(id, txt) {var el=document.getElementById('window_'+id+'_content'); el.innerHTML+=txt;}function writeWindowTopRight(id, txt) {var el=document.getElementById('window_'+id+'_topr');el.innerHTML=txt;}function getWindow(id) {return document.getElementById('window_'+id+'_content');}function setWindowTitleButtons(id, refresh_js) {var topr='';if (refresh_js!='')topr+=' ';topr+='';writeWindowTopRight(id,topr);}var dragObj = new Object();dragObj.zIndex = 0;function dragWindow(event, id) {dragObj.dwin = document.getElementById(id);dragObj.start_mx = event.clientX;dragObj.start_my = event.clientY;dragObj.start_ex = parseInt(dragObj.dwin.style.left, 10);dragObj.start_ey = parseInt(dragObj.dwin.style.top, 10);windowToFront(event, id);document.addEventListener("mousemove", dragMove, true);document.addEventListener("mouseup", dragTerminate, true);dragMove(event);}function dragMove(event) {dragObj.dwin.style.left = (dragObj.start_ex + event.clientX - dragObj.start_mx) + "px";dragObj.dwin.style.top = (dragObj.start_ey + event.clientY - dragObj.start_my) + "px";event.preventDefault();}function dragTerminate(event) {document.removeEventListener("mousemove", dragMove, true);document.removeEventListener("mouseup", dragTerminate, true);}function toggleWindow(event, id) {var content=document.getElementById(id);if (content.style.display=='none') {content.style.display='block';} else {content.style.display='none';}}function windowToFront(event,id) {var dwin=document.getElementById(id);dwin.style.zIndex = ++dragObj.zIndex;}