//selects all text and refocuses text box after submit
//chosen over clearing the message as some messages dont go through
//due to flood controls, character limits, etc
//this gives the user an option of changing the text, or simply overwriting it
function clear_message()
{
  document.tagform.message.focus();
  document.tagform.message.select();
}

//empties all text from the message box and re-focuses on the message
//box.  This is not the default action.
function clear_message2()
{
  document.tagform.message.value="";
  document.tagform.message.focus();
}

//handles the popup window for smilies
//attempts to write all the contents directly, without file accesses
//this is faster and requires less effort on the browser
function pop_up_smilies()
{
  var smilie=window.open('','smilies','resizable=yes,scrollbars=yes,width=300,height=500');
  smilie.opener=window;
  smilie.document.open("text/html");
  smilie.document.write('\<html\>\<head\>\<title\>Tag-Board Smilies\</title\>\<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"\>\<STYLE\>.nounder{text-decoration:none;}\</STYLE\>\<SCRIPT lang="Javascript" type="text/javascript"\>function add_smilie(a_smilie){if(window.opener.document.tagform!=window.undef){window.opener.document.tagform.message.value+=" "+a_smilie+" ";window.opener.document.tagform.message.focus();window.close();};};function wc(ty, sp, w, pic){document.write(\'\<tr align="center"\>\<td bgcolor="#DDDDDD"\>\<a href="javascript:add_smilie(\\\'\'+ty+\'\\\')" class="nounder"\>\<B\>\'+ty+\'\</B\>\</a\>\</td\>\<TD bgcolor="#FFFFFF"\>\</TD\>\<td bgcolor="#DDDDDD"\>\'+sp+\'\<a href="javascript:add_smilie(\\\'\'+ty+\'\\\')"\>\<img src="http://www.tag-board.com/smilies/\'+pic+\'.gif" width="\'+w+\'" height="15" border=0\>\</a\>\</td\>\</tr\>\');};function cwc(ty, sp, pic){document.write(\'\<tr align="center"\>\<td bgcolor="#DDDDDD"\>\<a href="javascript:add_smilie(\\\'\'+ty+\'\\\')" class="nounder"\>\<B\>\'+ty+\'\</B\>\</a\>\</td\>\<TD bgcolor="#FFFFFF"\>\</TD\>\<td bgcolor="#DDDDDD"\>\'+sp+\'\<a href="javascript:add_smilie(\\\'\'+ty+\'\\\')"\>\<img src="\'+pic+\'" border=0\>\</a\>\</td\>\</tr\>\');};\</SCRIPT\>\</HEAD\>');
  smilie.document.write('\<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000"\>\<table width="0%" border="0" RULES=NONE cellspacing="1" cellpadding="2" align="center"\>\<tr bgcolor="#a4acb8" valign="center" align="center"\>\<td nowrap\>\<b\>Smilie Code\</b\>\</td\>\<TD bgcolor="#FFFFFF"\>\</TD\>\<td nowrap\>\<b\>Image\<BR\>Replacement\</b\>\</td\>\</tr\>');
  smilie.document.write('\<SCRIPT\>wc(":)","",15,"156/smile");wc(":(","",15,"156/sad");wc(":o","",15,"156/shocked");wc(":D","",15,"156/biggrin");wc(";)","",15,"156/wink");wc(":p","",15,"156/tongue");wc(":artist:","",15,"156/artist");wc(":bowling:","",15,"156/bowl");wc(":mad:","",15,"156/mad");wc(":dizzy:","",15,"156/dizzy");wc(":nono:","",15,"156/nono");wc(":eyepatch:","",15,"156/pirate");wc(":sick:","",15,"156/sick");wc(":cry:","",15,"156/cry");wc(":uhh:","",15,"156/uhh");wc(":wacko:","",15,"156/wacko");wc(":yinyang:","",15,"yin-yang");wc(":frog:","&nbsp;&nbsp;",25,"frog");\</SCRIPT\>\</TABLE\>\</BODY\>');
  smilie.document.write('\</HTML\>');
	  //close our open 'file' in javascript and return false so that the backup
  //popup doesn't display
  smilie.document.close();
  return false;
}

//used to remember user names and 'urls' across all tag boards
//based solely on cookies.  Used as a simple convenience feature
function rememberme()
{
        var tempdate=new Date()

	//code to write the user's clock as variable data for setting timestamps
	//to local values.  This local timestamp feature is not yet implemented
        document.write ('\<input name="curhour" type="hidden" value="'+tempdate.getHours()+'"\>');
        document.write ('\<input name="curmin" type="hidden" value="'+tempdate.getMinutes()+'"\>');

	//used to start up the netscape code if this is netscape
	start_net();
}
//select the message after it is submitted.  pause 0.2 seconds to be sure
//that the message has been submitted first
//function is named poorly, but the default has been changed and I didn't want
//to break the code for various folks, so I didn't rename
function Clear_Last_Message_on_Submit() 
{ 
  document.tagform.submit();
  setTimeout("clear_message()",200);
  return false;
}


function Clear_Last_Message_on_Submit2() 
{ 
  document.tagform.submit();
  setTimeout("clear_message2()",200);
  return false;
}

//empty functions, only needed under netscape 4.x
function start_net()
{
}

function netscape_support()
{
}


