modo = 'width='+screen.availWidth+',height='+screen.availHeight; var Elog=0; if (navigator.appName=="Netscape"){ modo +=',screenX=0,screenY=0'; }else{ modo +=',top=0,left=0'; } function abrechat(sala){ if(document.formc.usuario.value.length==0){ alert('Favor Escolher um Apelido'); document.formc.usuario.focus(); }else{ URL='sala.php'; chat=window.open('','BRCHAT',modo); document.formc.sala.value=sala; document.formc.action=URL; document.formc.submit(); URLS = 'saida.php?usuario='; URLS +=document.formc.usuario.value; URLS +='&sala='; URLS +=sala; window.blur(); cteste(); chat.focus(); if(top.location==self.location){window.moveTo(3000,3000);} } } function espiachat(sala){ if(document.formc.usuario.value.length==0){ alert('Favor Escolher um Apelido'); document.formc.usuario.focus(); }else{ URL='espia.php'; chat=window.open('','BRCHAT',modo); document.formc.sala.value=sala; document.formc.action=URL; document.formc.submit(); URLS = 'saida.php?usuario='; URLS +=document.formc.usuario.value; URLS +='&sala='; URLS +=sala; window.blur(); espteste(); chat.focus(); if(top.location==self.location){window.moveTo(3000,3000);} } } function SairJa(){ if(top.location==self.location){window.close();} } function testalog(){ if(chat.closed){ TEX= ''; if(document.getElementById){document.getElementById('ssa').innerHTML=TEX;} else if(document.layers){ document.ssa.document.write(TEX); document.ssa.document.close(); }else{document.all['ssa'].innerHTML=TEX;} clearInterval(CT); } } function cteste(){ CT=setInterval("testalog()",300); } function pteste(){ clearInterval(CT); } function espteste(){ EVT=setInterval("testaesp()",300); } function testaesp(){ if(chat.closed){if(top.location==self.location){window.close();} clearInterval(EVT); }else{ ender=chat.location.href; if(ender.indexOf('sala.php')!=-1){ clearInterval(EVT); cteste();} } }