function popupChat() {
        win=window.open("BuggyChat.html", "BuggyChat",
                   "height=480,width=540");
}     


function send()
{
   if (document.UserInfo.NICKNAME.value == null ||
                                        document.UserInfo.NICKNAME.value == "")
   {
        window.alert("You must enter your nick name.")
        return false
   }

//function jumpTo(url) { top.window.location = url; }



 var USERNICK = document.UserInfo.NICKNAME.value

 win=window.open("","BuggyChat","resizable=no,height=480,width=540")
 win.document.write('<html><head><title>Dune-Buggy.com - BuggyChat</title>')
 win.document.write('<BASE href="http://www.dune-buggy.com/chat/" target="_blank">')
 win.document.write('</head>')

 win.document.write('<SCRIPT LANGUAGE="JavaScript">')
// win.document.write('<!-- Start Hiding the Script; ')

 win.document.write('function jumpTo(URL){ ')
 win.document.write('  if (URL == null || URL == "") { return true };')
 win.document.write('windowprops = "top=100,left=100,resizable=yes,width=640,height=480,toolbar,menubar,scrollbars";')
 win.document.write('window.open(URL,"",windowprops);')
 win.document.write('}')

 win.document.write('function replaceChars(entry,input,output) {')
 win.document.write('        var out = input;')
 win.document.write('        var add = output;')
 win.document.write('        var temp = "" + entry;')
 win.document.write('        var pos;')
 win.document.write('        while (temp.indexOf(out)>-1) {')
 win.document.write('                pos= temp.indexOf(out);')
 win.document.write('                temp = "" + (temp.substring(0, pos) + add + temp.substring((pos + out.length), temp.length));')
 win.document.write('        }')
 win.document.write('        return temp;')
 win.document.write('}')

 win.document.write('// Stop Hiding script --->')
 win.document.write('</SCRIPT>')

 win.document.write('<body bgcolor="#6080B0">')
 win.document.write('<body topmargin="5" leftmargin="5">')
 win.document.write('<center>')
 win.document.write('<table border="0" cellspacing="0">')
 win.document.write('<tr>')
 win.document.write('<td width="100%" align="center" valign="top" height="76" colspan="2">')
 win.document.write('<!-- Start Banner Code -->')
 win.document.write('<IFRAME SRC="http://www.dune-buggy.com/cgi-bin/advertise/ads_rotate.pl?iframe;zone=default" MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=468 HEIGHT=76>')
 win.document.write('  <SCRIPT LANGUAGE="JavaScript" SRC="http://www.dune-buggy.com/cgi-bin/advertise/ads_rotate.pl?jscript;zone=default">')
 win.document.write('  </SCRIPT>')
 win.document.write('  <NOSCRIPT><a href="http://www.dune-buggy.com/cgi-bin/advertise/ads_rotate.pl?banner=NonSSI;page=01;zone=default" target="_blank"><img src="http://www.dune-buggy.com/cgi-bin/advertise/ads_rotate.pl?page=01;zone=default" alt="Dune-Buggy.com Advertiser" border="0"></a>')
 win.document.write(' </NOSCRIPT>')
 win.document.write('</IFRAME>')
 win.document.write('<!-- End Banner Code -->')
 win.document.write('</td>')
 win.document.write('</tr>')
 win.document.write('<tr>')
 win.document.write('<td height="30" valign="middle">')
 win.document.write('<form name="jform" onsubmit="return false">')

 win.document.write('<input type="text" size="20" style="font-size: 10pt" name="Search" value="Search Site">')
 win.document.write('<input type="button" value="Go" style="font-size: 8pt" onclick="window.open(\'http://www.dune-buggy.com/cgi-bin/websearch.pl?terms=\'+replaceChars(document.jform.Search.value,\' \',\'+\')+\'&boolean=all\'); return false;">')


 win.document.write('&nbsp;&nbsp&nbsp;&nbsp<font face="Arial" size="2">[&nbsp;<a href="#" onClick="BuggyChat.processJInput(\'/me %B is now away...\');BuggyChat.processJInput(\'/nick AWAY-'+USERNICK+'\'); BuggyChat.processJInput(\'/away -away-\'); return false;"><b>Away</b></a>')
 win.document.write('&nbsp;]&nbsp;&nbsp;[&nbsp;<a href="#" onClick="BuggyChat.processJInput(\'/nick '+USERNICK+'\'); BuggyChat.processJInput(\'/me %B has returned!\'); BuggyChat.processJInput(\'/away\'); return false;"><b>Back</b></a>&nbsp;]</font>')
 win.document.write('<br>')

 win.document.write('<select name="channels" onchange="BuggyChat.processJInput(jform.channels.options[jform.channels.selectedIndex].value);this.selectedIndex=0" style="font-size: 10pt">')
 win.document.write('<option value>Change Room')
 win.document.write('<option value="/join #Dune-Buggy">#Dune-Buggy')
 win.document.write('<option value="/join #Dune-Buggy2">#Dune-Buggy2')
 win.document.write('<option value="/join #SandRails">#SandRail')
 win.document.write('<option value="/join #BajaBugs">#BajaBugs')
 win.document.write('<option value="/join #Fiberglass">#Fiberglass')
 win.document.write('<option value="/join #ATVs">#ATVs')
 win.document.write('<option value="/join #4X4">#4X4')
 win.document.write('<option value="/join #Test">#Test')
 win.document.write('</select>')

 win.document.write('<select name="sound" onchange="BuggyChat.processJInput(jform.sound.options[jform.sound.selectedIndex].value);this.selectedIndex=0" style="font-size: 10pt">')
 win.document.write('<option value>Sounds')
 win.document.write('<option value="/s chime">Chime!')
 win.document.write('<option value="/s beep">Beep!')
 win.document.write('<option value="/s engine">Engine!')
 win.document.write('<option value="/s no">No!')
 win.document.write('<option value="/s yes">Yes!')
 win.document.write('<option value="/s ohyea">Oh Yea!')
 win.document.write('</select>')


 win.document.write('<select name="commands" onchange="BuggyChat.processJInput(jform.commands.options[jform.commands.selectedIndex].value);this.selectedIndex=0" style="font-size: 10pt">') 
 win.document.write('<option selected value="">Commands</option>')
 win.document.write('<option value="/whois %$HN ">Who Is</option>')
 win.document.write('<option value="/msg %$N Type /whowas nickname to get this information">Who Was</option>')
 win.document.write('<option value="/mode #%$C +o %$HN ">Give Ops</option>')
 win.document.write('<option value="/mode #%$C -o %$HN ">Take Ops</option>')
// win.document.write('<option value="/ignore %$HN ">Ignore User</option>')
// win.document.write('<option value="/kick #%$C %$HN ">Kick User</option>')

 win.document.write('<option value="/list">Channels</option>')
 win.document.write('<option value="/msg %$HN Please Behave in here! This is a family site.">Warning</option>')
 win.document.write('<option value="http://www.dune-buggy.com/buggytalk/index.cgi?profile='+USERNICK+'">Profile</option>')
 win.document.write('</select>')

 win.document.write('<select name="jump" onChange="jumpTo(this.options[selectedIndex].value);this.selectedIndex=0" style="font-size: 10pt">')
 win.document.write('<option selected value="">Jump To</option>')
 win.document.write('<option value="http://www.dune-buggy.com/chat/index.htm#help">Help</option>')
 win.document.write('<option value="http://www.dune-buggy.com/">Home</option>')
 win.document.write('<option value="http://www.dune-buggy.com/buggytalk/">BuggyTalk</option>')
 win.document.write('<option value="http://www.dune-buggy.com/forsale/">BuggyTrader</option>')
 win.document.write('<option value="http://www.dune-buggy.com/buggylinks/Bookstore/">Bookstore</option>')
 win.document.write('<option value="http://www.dune-buggy.com/turbo/">Turbo Info</option>')
 win.document.write('<option value="http://www.dune-buggy.com/buggylinks/Tech_Tips/">Tech Tips</option>')
 win.document.write('<option value="http://www.dune-buggy.com/cgi-bin/vote.cgi">Voting Booth</option>')
 win.document.write('<option value="http://www.dune-buggy.com/theclubhouse/">Feedback</option>')
 win.document.write('</select>')

 win.document.write('</td>')
 win.document.write('</tr>')
 win.document.write('<tr>')
 win.document.write('<td width="100%" colspan="2">')

 win.document.write('<applet name="BuggyChat" archive="http://www.dune-buggy.com/chat/jirc_nss.zip" code="Chat.class" height="325" width="530">')         
 win.document.write('<param name="NOS" value="false">')
 win.document.write('<param name="DisplayAbout" value="false">')
 win.document.write('<param name="IgnoreMOTD" value="true">')
 win.document.write('<param name="IgnoreServerMsg" value="true">')
 win.document.write('<param name="IgnoreModeChange" value="true">')
 win.document.write('<param name="FieldNameConnecting" value="Connecting to the Dune-Buggy.com chat server :) You must be 18 or have parental supervision to use this server  ....">')
 win.document.write('<param name="FieldNameConnected" value="Connected to server, sending nicknameinfo.">')
 win.document.write('<param name="FieldNameConnectionClose" value="Connection to server closed.">')
 win.document.write('<param name="FieldNameQuitMsg" value="Bye bye">')
 win.document.write('<param name="FieldNamePrivateClose" value="Close">')
 win.document.write('<param name="FieldNamePrivateChatTitle" value="Private Chat with: ">')
 win.document.write('<param name="ServerPort" value="6667">')
 win.document.write('<param name="ServerName1" value="www.dune-buggy.com">')
 win.document.write('<param name="Channel1" value="dune-buggy">')
 win.document.write('<param name="AllowURL" value="true">')
 win.document.write('<param name="AllowIdentd" value="true">')
 win.document.write('<param name="WelcomeMessage" value="Welcome to BuggyChat">')
 win.document.write('<param name="RealName" value="BuggyChat user">')
 win.document.write('<param name="NickName" value="'+USERNICK+'">')
 win.document.write('<param name="isLimitedServers" value="true">')
 win.document.write('<param name="isLimitedChannels" value="false">')
 win.document.write('<param name="MessageCol" value="80">')
 win.document.write('<param name="BackgroundColor" value="100,132,181">')
 win.document.write('<param name="TextColor" value="black">')
 win.document.write('<param name="TextScreenColor" value="white">')    
 win.document.write('<param name="ListTextColor" value="blue">')
 win.document.write('<param name="ListScreenColor" value="white">')
 win.document.write('<param name="TextFontName" value="Helvetica">')
 win.document.write('<param name="TextFontSize" value="12">')
 win.document.write('<param name="DirectStart" value="true"> ')
 win.document.write('<param name="FGColor" value="black">')
 win.document.write('<param name="DisplayConfigServer" value="false">') 
 win.document.write('<param name="DisplayConfigNick" value="true">') 
 win.document.write('<param name="DisplayConfigPort" value="false">') 
 win.document.write('<param name="DisplayConfigMisc" value="false">') 
 win.document.write('<param name="DisplayConfigChannel" value="false">') 
 win.document.write('<param name="AllowPrivateChatWindow" value="true">')
 win.document.write('<param name="LogoWidth" value="75">')
 win.document.write('<param name="LogoHeight" value="44">')
 win.document.write('<param name="NoConfig" value="true">')
 win.document.write('<param name="LicenseKey" value="2736503959-70232929930183607617232329-2919043446441913139214852391-471904349345191313833463">')
 win.document.write('<param name="InitCommands" value="/s join;/msg %$N Welcome. You must be 18 years of age or have parental supervision to use this site. Please act in a manner appropriate for a family site. If this is a chat with a defined topic, please try to stay on the subject. If you do not like the topic you have the option of joining another room.">')
 win.document.write('<param name="FilterKeys" value=":) :-) ;) ;-) :( :-( :P :p :-P :-p :0 :o :O">')
 win.document.write('<param name="FilterVals" value="smile1.gif smile1.gif wink.gif wink.gif frown.gif frown.gif tongue.gif tongue.gif tongue.gif tongue.gif eek.gif eek.gif eek.gif">')
 win.document.write('<param name="UserListWidth" value="90">')
 win.document.write('<param name="BorderSpacing" value="0">')
 win.document.write('<param name="RefreshColorCode" value="false">')

 win.document.write('</applet>')
 win.document.write('</form>')
 
 win.document.write('</td>')
 win.document.write('</tr>')
 win.document.write('</table>')
 win.document.write('</center>')
 win.document.write('</body>')
 win.document.write('</html>')
 win.document.close()


 //document.location=document.referrer
 //document.location="index.htm"

 return false
}            
