if(!document.getElementsByClassName){document.getElementsByClassName=function(cl){var retnode=[];var myclass=new RegExp('\\b'+cl+'\\b');var elem=this.getElementsByTagName('*');for(var i=0;i<elem.length;i++){var classes=elem[i].className;if(myclass.test(classes))retnode.push(elem[i])}return retnode}}if(document.images){var n1=new Image(32,32);n1.src=rootpath+'img/common/coin_on.gif';var n2=new Image(32,32);n2.src=rootpath+'img/common/saw_on.gif';var n3=new Image(32,32);n3.src=rootpath+'img/common/razor_on.gif';var n4=new Image(32,32);n4.src=rootpath+'img/common/egg_on.gif';var n5=new Image(32,32);n5.src=rootpath+'img/common/home_on.gif'}if(typeof init=='function'){window.onload=init}var rtdata,rttime,rtmap,twVia;var loadtime=15000;function rollOver(id,ld,cs,st){var imgid='img'+id;var isrc=document.images[imgid].src;if(typeof st!='undefined'&&st!=null){document.images[imgid].src=(st==1?isrc.replace('_off.','_on.'):isrc.replace('_on.','_off.'))}else{ld=((typeof ld=='undefined')?-1:ld);document.images[imgid].src=((isrc.indexOf('_on.')!=-1&&ld!==0)?isrc.replace('_on.','_off.'):(ld==1?isrc.replace('_off.','_load.'):(ld===0?isrc.replace('_load.','_on.'):isrc.replace('_off.','_on.'))))}if(typeof cs!='undefined'&&cs){document.images[imgid].style.cursor=cs}}function rollOn(id){rollOver(id,null,null,1)}function rollOff(id){rollOver(id,null,null,0)}function displayBlock(b,a){if(b){b.style.display=(a==1)?'block':'none';b.style.visibility=(a==1)?'visible':'hidden'}}function initShareButtons(ar,hidecls){for(var i=0;i<ar.length;i++){var s=document.getElementById('share'+ar[i]['id']);if(typeof addthis!='undefined'&&s)addthis.button('#share'+ar[i]['id'],{ui_click:'true',ui_header_color:'#000',data_track_clickback:true},{url:ar[i]['url'],title:ar[i]['title'],description:ar[i]['description']});else displayBlock(s,0);var f=document.getElementById('fblike'+ar[i]['id']);var u=encodeURIComponent(ar[i]['url']);if(f){var fi=createIFrame(f,'http://www.facebook.com/plugins/like.php?layout=button_count&show_faces=true&width=90&action=like&colorscheme=light&height=21&href='+u,'fblike');if(!fi)displayBlock(f,0);else if(typeof hidecls!='undefined'&&f.className==hidecls)displayBlock(fi,0)}var t=document.getElementById('twlike'+ar[i]['id']);if(t){var ti=createIFrame(t,'http://platform.twitter.com/widgets/tweet_button.html?count=horizontal'+(typeof twVia!='undefined'&&twVia!=''?('&via='+twVia):'')+'&text='+encodeURIComponent(t.title)+'&url='+u,'twlike');if(!ti)displayBlock(t,0);else if(typeof hidecls!='undefined'&&t.className==hidecls)displayBlock(ti,0)}}}function createIFrame(el,src,cls){if(document.createElement){var p=el.parentNode;var i=document.createElement('iframe');i.id=el.id;i.src=src;i.scrolling='no';i.frameBorder=0;i.className=cls;i.allowTransparency=true;p.insertBefore(i,el);p.removeChild(el);return i}}function showJS(){var shEl=document.getElementsByClassName('js');for(var i=0;i<shEl.length;i++){shEl[i].style.display=(shEl[i].localName=='tr'?'table-row':'block')}}function checkLoad(e,c){if(typeof c!='undefined'&&c){clearTimeout(rttime);displayBlock(document.getElementById(e),0);if(!rtdata)displayBlock(document.getElementById('loaderror'),1)}else{rttime=setTimeout('checkLoad(\''+e+'\', true);',loadtime)}}function encHTML(h){return h.replace(/&/gmi,'&amp;').replace(/"/gmi,'&quot;').replace(/>/gmi,'&gt;').replace(/</gmi,'&lt;').replace(/\r\n/gmi,'<br />')}function frmCaptureFlag(f){if(f.cft.options[f.cft.selectedIndex].value=='0'){alert('Please select a team');return false}else{return true}}function frmRaceTo(f){if(f.d.options[f.d.selectedIndex].value=='0'){alert('Please select a destination');return false}else{return true}}function frmFromTo(f){if(f.s.options[f.s.selectedIndex].value=='0'||f.d.options[f.d.selectedIndex].value=='0'){alert('Please select start and destination rooms');return false}else{return true}}function getAJAX(u,l,f){var xmlHttp=getXMLHttp();if(xmlHttp){xmlHttp.onreadystatechange=function(){f(xmlHttp)};xmlHttp.open('GET',u,true);xmlHttp.send(null);checkLoad(l)}else{checkLoad(l,true)}}function getXMLHttp(){var xmlHttp;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return false}}}return xmlHttp}function showRoom(i,m){var f=rootpath+'pop_room.php?i='+i+'&m='+m;window.open(f,'pop_room','height=540,width=560,toolbar=no,scrollbars=yes,menubar=no,resizable=no,location=no,directories=no,status=no,hotkeys=no');return false}function showMap(m,h){var f=rootpath+'pop_map.php?m='+m+(h?'&h='+h:'');window.open(f,'pop_map_'+m,'height=540,width=740,toolbar=no,scrollbars=yes,menubar=no,resizable=no,location=no,directories=no,status=no,hotkeys=no');return false}function showOverlay(state){displayBlock(document.getElementById('overlay'),state);return false}function showTab(tab){var ct=1;var cls;var tabEl=document.getElementById('tab'+ct+'L');while(tabEl){if(ct==tab){cls='on'}else{cls='off'}tabEl.className=('tdtableft'+cls);document.getElementById('tab'+ct+'M').className=('tdtab'+cls);document.getElementById('tab'+ct+'R').className=('tdtabright'+cls);displayBlock(document.getElementById('tabdiv'+ct),(cls=='on'?1:0));ct++;tabEl=document.getElementById('tab'+ct+'L')}return false}function zeroPad(n,l){var s=''+n;while(s.length<l){s=('0'+s)}return s}
