ctwice=0;amp='&';refr=20000;rndom=0;ldd=0;onff=1;turing=1;timezone=0

if(typeof document.layers=='object'){window.location='info.php?reason=netscape'}

if(typeof document.all=='object'){use_rnd=1
document.write('<meta http-equiv="Page-Enter" content="revealtrans(duration=0)"><meta http-equiv="Page-Exit" content="revealtrans(duration=0)">')
document.write('<link rel="stylesheet" type="text/css" href="'+skin_dir+'/msie.css" />');}

/* bottom frame accessible */
function cdone(){
if((parent.length!=0)&&(typeof parent.c=='object')&&(typeof parent.c.ldd=='number')&&(parent.c.ldd==1)){
return true}else{return false}}

/* check 'new member' form */
function check_member(n,o){
if(timezone==0&&document.fms.time_offset.value==0){
g=confirm(o);timezone=1
if(g){time_win(0);return false}}
a=document.fms.mail;b=document.fms.name
c=document.fms.pass;d=document.fms.pict
d=d.value.toLowerCase()
if(b.value.length<2){b.value=''}if(c.value.length<2){c.value=''}
if((a.value.indexOf('@')==-1)||(a.value.indexOf('.')==-1)||(a.value.indexOf(' ')!=-1)||(a.value.length<8)){a.value=''}
if((d.indexOf('.gif')==-1)&&(d.indexOf('.jpg')==-1)&&(d.indexOf('.png')==-1)&&(d.indexOf('.jpeg')==-1)||(document.fms.pict.value==null)||(d=='http://')){document.fms.pict.value=''}
if((a.value!='')&&(b.value!='')&&(c.value!='')&&turing_number()){return true}
else{alert(n);return false}}

/* check login form */
function check_login(n){
a=document.fms.name;b=document.fms.pass
if((a.value!='')&&(b.value!='')&&turing_number()){return true}
else{alert(n);return false}}

/* set avatar */
function add_avatar(m){
z=document.fms.pict;x=z.value;if(x==''){x='http://'}
y=prompt(m,x);if(y!=null){z.value=y}return false}

/* add bb code */
function add_bbcode(n){a=document.fms.info;a.value=a.value+n;return false}

/* add smiley */
function add_smiley(z){
if(window.opener&&window.opener.parent.length!=0&&window.opener.cdone()){
obj=window.opener.parent.c.document.fms.entry
tt=obj.value;obj.value=tt+z
window.opener.set_focus();self.close()}return false}

/* preview member */
function preview_member(){crq=document.fms.action
dd=window.open('','prv','height=300,width=310,resizable=1')
document.fms.action='member_view.php';document.fms.target='prv'
document.fms.submit();dd.focus()
setTimeout("document.fms.action=crq;document.fms.target='_self'",500)
return false}

/* stop-reload image */
function sro_image(n,m,o){b=n.src.toString()
if(!n.complete){n.src=skin_dir+'/'+o}else if(b.indexOf(o)!=-1){n.src=m}
else{dd=window.open(m,'img','height=200,width=300,resizable=1,scrollbars=1,status=1');dd.focus()}}

/* print email address */
function print_mail(a,b){document.write('<a href="mailto:'+a+'@'+b+'">'+a+'@'+b+'</a>')}

/* set random number */
function rand_number(){if(use_rnd!=0){rndom=Math.round(99999999*Math.random())}}

/* refresh chat frame */
function chat(m){rand_number()
s=document.fms.room.value;t=document.fms.time_offset.value
u=document.fms.name.value;v=document.fms.xpas.value
j=document.fms.last.value;if(s!=''){
parent.b.location='chat.php?room='+s+amp+'time_offset='+t+amp+'name='+u+amp+'xpas='+v+amp+'last='+j+amp+'r='+rndom}
else if(m==0){parent.b.location='rooms.php?time_offset='+t+amp+'r='+rndom}
else{alert(m)}return false}

/* change refresh rate */
function change_rate(a,b,c,d){refr=a*1000;
document.im0.src=c;document.im1.src=c;
document.im2.src=c;document.im3.src=c;
document.im4.src=c;b.src=d;chat(0)
set_focus();return false}

/* onmouseover/onmouseout 'refresh rate' images */
function over_out(a,b,c){
if(a.src.indexOf(b)==-1){a.src=c}
return true}

/* set refresh timeout */
function set_rtime(){self.scrollTo(0,1000)
if(cdone()){refr=parent.c.refr
nn=setTimeout('parent.c.chat(0)',refr)}
else{url=self.location.toString()
nn=setTimeout('self.location=url',refr)}}

/* clear refresh timeout */
function clear_rtime(){if(typeof nn=='number'){clearTimeout(nn)}}

/* check entry */
function entry_ok(n){
e=document.fms.entry;r=document.fms.room.value
if(e.value.length>0&&r.length>0&&ctwice==0){ctwice=1
if((parent.length!=0)&&(typeof parent.b=='object')&&(typeof parent.b.nn=='number')){parent.b.clear_rtime()}
setTimeout('e.value="";e.focus();ctwice=0',500)
return true}else if(r==''){alert(n)}
else{chat(0)}e.focus();return false}

/* choose room */
function choose_room(q){if(cdone()){
parent.c.document.fms.room.value=q
parent.c.document.fms.last.value=0
parent.c.chat(0);set_focus()}return false}

/* clear room */
function clear_room(){if(cdone()){
parent.c.document.fms.room.value=''}}

/* go to url */
function go_url(o,p,r){
rand_number();if(r==1){amp='?'}
if(p<3&&parent.length!=0){
parent.frames[p].location=o+amp+'r='+rndom}
else{self.location=o+amp+'r='+rndom}return false}

/* logout */
function log_out(o,p){if(cdone()){
r=parent.c.document.fms.room.value
n=parent.c.document.fms.name.value
t=parent.c.document.fms.time_offset.value
clear_room()}else{n=0;r=0;t=0}
if(p<3&&parent.length!=0){rand_number()
parent.frames[p].location=o+'?name='+n+amp+'room='+r+amp+'time_offset='+t+amp+'r='+rndom}
else{parent.location=o+'?name='+n+amp+'room='+r}
return false}

/* pop-up member profile */
function ppm(q){
iq=window.open('member_view.php?who='+q,'mmb','width=290,height=350,resizable=1')
iq.focus();return false}

/* print online user */
function usr(q,a,p){
rt='';if(a!=0){rt='font-style:italic;'}
document.write('<a href="info.php?reason=link" title="'+p+'" style="'+rt+'text-decoration:none" on'+'click="return spm(\''+q+'\')">'+q+'</a><br />')}

/* copy/paste/clear username */
function spm(q){if(cdone()){
parent.c.document.fms.to.value=q
parent.c.document.fms.tt.value=q
set_focus()}return false}

/* focus entry */
function set_focus(){if(cdone()){
parent.c.document.fms.entry.focus()}}

/* set the latest message */
function set_last(r){if(cdone()){parent.c.document.fms.last.value=r}}

/* play sound */
function snd(){if(cdone()&&parent.c.onff==1){
if(typeof document.all=='object'){document.write('<object type="application/x-shockwave-flash" data="'+skin_dir+'/sound.swf" width="1" height="1"><param name="movie" value="'+skin_dir+'/sound.swf"></object>')}
else{document.write('<embed type="application/x-shockwave-flash" src="'+skin_dir+'/sound.swf" quality="high" width="1" height="1" name="movie" pluginspage="http://www.macromedia.com/go/getflashplayer">')}
}}

/* set time */
function time_win(n){rand_number();timezone=1
dd=window.open('time_offset.php?time_offset='+n+amp+'r='+rndom,'offset','width=160,height=390,resizable=1');
dd.focus();return false}

/* set time offset */
function set_offset(n){if(window.opener){
if(window.opener&&window.opener.parent.length!=0&&window.opener.cdone()){
window.opener.parent.c.document.fms.time_offset.value=n;window.opener.parent.c.chat(0)}
else if(window.opener&&window.opener.document.forms.length!=0){window.opener.document.fms.time_offset.value=n}
}self.location='time_offset.php?time_cookie='+n;return false}

/* load history */
function show_hist(a){rand_number()
s=document.fms.room.value;t=document.fms.time_offset.value
u=document.fms.name.value;v=document.fms.xpas.value;if(s!=''){
go_url('history.php?room='+s+amp+'time_offset='+t+amp+'name='+u+amp+'xpas='+v,1,0)}
else{alert(a)}return false}

/* check turing number */
function turing_number(){
if(turing==0||(turing==1&&document.fms.turnum.value.length==4&&!isNaN(document.fms.turnum.value))){return true}
else{document.fms.turnum.value='';return false}}