// { GoPJirc }

// Version: 2.24
// File: script.js
// Description: The GoPJirc script itself.
// Author: WillyPS	& Thema
// Web: http://www.gojirc.cjb.net http://www.adnd.com
// Date: 2001 - 2004

// =====================================================================

//////////////////////////////////////////////////////////////////////////////////
//										//
//			GoPJirc Easy Configuration Start				//
//										//
//////////////////////////////////////////////////////////////////////////////////





// --------------------------------------------------------------------
//
// 		R E Q U I R E D  Configuration Settings:
//
// --------------------------------------------------------------------
//
// This section needs to be configured before using GoPJirc.
// --------------------------------------------------------------------



// Webmaster's e-mail address.
var WebmasterEmail = "admin@teqh.com";

// Your web site homepage url.
// It can be a full path, a relative path or an URL.
var HomepageUrl = "http://chat.teqh.com";

// Specify the channels you would like to appear
// on the Channels dropdown menu. Also, this will
// be shown on the Channel drop-down menu option list.
var Channel1 = "#Lobby";
var Channel2 = "#Freaks";
var Channel3 = "#Xotiq";
var Channel4 = "#AnonDox";
var Channel5 = "#eLunacy";


// You need to supply these variables to use as defaults for chat.
var defaultNick = 'TeQh??';
var defaultPass = '';
var defaultChan = 'Freaks';
var defaultServer = 'irc.teqh.com';
var defaultBkgrnd = 'background.png';

// Use GoPJirc Error Report.
//
// This will alert the user that an error has occurred
// and if he/she want to let you know.
// If the user press OK, then his/her default email
// application will load with your email and subject
// already entered. And the email's body will contain
// the error message and line number where it occurred.
//
// Enter this values:
//
// 	0	Deactivate Error Report (browser alert)
// 	1	Activate Error Report
//	2	Dev Mode (script alert)
//	3	Supress Mode (no error alert)
//
// Default value is 1. 
// Developers: remember to deactivate it while making changes.
// ErrorReport will always return true.
var EnableErrorReport = "1";

// Login command to execute for user authentication with
// the server's bot. Modify as needed based on your server.
// Refer to the server's network home page or channel for info on this.
// If login syntax = /msg NickServ identify <MyNick> <MyPass>  then Identify ="1"
// If login syntax =	/nick <MyNick>  
//						/msg NickServ identify <MyPass>  then Identify ="2"
//						Else Identify = "0"
var identify = "2"; 
var PromptLoginCmd = "/msg nickserv identify";

// This is the command to perform when submitting requesting
// a channels info. Modify depending on your server.
// Refer to the server's network home page or channel for info on this.
var PromptChannelinfoCmd = "/msg chanserv info";

// Displays a message on the status bar of
// the users browser window.
// Leave it blank for none.
var StatusBarMsg = "TeQh.Com IRC Chat -- Irc.TeQh.Com";

// Javascript prompt style text
// and GoPJirc defaults prompts
// -------------------------------

// This text will appear in a prompt window.
// Useful for instructions text for the user on what to do to login.
var PromptLoginUserMsg = "Type in your username:";
var PromptLoginPassMsg = "Now type in your password:\n(this info will be sent only to the IRC server for authentication).";

// Optional text to show in the username or password
// prompt window's input.
var PromptLoginUserInput = "";
var PromptLoginPassInput = "";

// Instructions message for user to enter the respective
// data for info channel retrieval.
var PromptChannelinfoMsg = "Type the channel name (leave it blank for current):";

// Input text field for user to enter data.
var PromptChannelinfoInput = "";

// Instructions for user to change his/her nickname.
var PromptNewnickMsg = "Type your new nickname:";

// Input text field for user to introduce his/her new nickname.
var PromptNewnickInput = "";

// Instructions for user to invite people to the current channel.
var PromptInviteMsg = "Type the nickname of the buddy to invite to this channel:";

// Input text field for user to introduce the invitation message.
var PromptInviteInput = "";

// Instructions for user on how to change the topic on current channel.
var PromptTopicMsg = "Type the new topic for this channel:";

// Input text field for user to specify the new topic for current channel.
var PromptTopicInput = "";

// Intructions for user to set channel modes.
var PromptChannelModesMsg = "Type the modes to set or unset using plus (+) or less (-) signs:\nt=op changes topic, n=no external msg, m=mute, p=private, s=secret, l=limit";

// Input text field to enter channel modes.
var PromptChannelModesInput = "";

// Specify a global message to use for the prompt input window
// when using kickreason, away and kickban.
var PromptSetMsg = "Type your reason for";
var PromptSetMsg2 = "here:";

// Input text field for user to enter the reason for:
// kickreason, kickban and away.
var PromptSetInput = "";

// Specify a global message to use for prompt input window
// when using Whois, Ping, Finger, Client version/info, Time user,
// Ignore/activate, Give/Remove voice/@p, Kick (fast/reason),
// Ban, Kick & ban.
var PromptNickMsg = "Enter nickname to do the";
var PromptNickMsg2 = "command here:";

// Input text field for user to enter the nickname for:
// Whois, Ping, Finger, Client version/info, Time user,
// Ignore/activate, Give/Remove voice/@p, Kick (fast/reason),
// Ban, Kick & ban.
var PromptNickInput = "";

// Instructions for user to enter a new channel
// (not listed on the dropdown menu).
var PromptChannelMsg = "Type the new channel name.";

// Input text field for user to specify the new channel name.
var PromptChannelInput = "";



// Text Related
// -----------------------

// Channel text to display on Channels drop-down menu.
// It can be a name or a very quick description.
// Keep in mind not to use text too large, because it will
// enlarge the drop-down menu. Leave it blank for default
// value of Channel variable.
var Channel1Text = "";
var Channel2Text = "";
var Channel3Text = "";
var Channel4Text = "";
var Channel5Text = "";

// Message text to declare the error occurred.
var ErrorReportMsgText = "Error message:";

// Line Text to declare the line where
// the error occurred.
var ErrorReportLineText = "Line number:";

// Subject text to enter on the e-mail's subject field.
var ErrorReportSubject = "GoPJirc Error Report";

// Alert text to show when an error has occurred.
var ErrorReportAlert = "A JavaScript error has occurred on this page.\nDo you want to report it to the webmaster?\n\nPress OK to proceed or Cancel to continue.";



// Action messages
// ------------------

// Message to announce on public window when away mode is activated.
var AwayOnMsg = "is now AWAY";

// Message to announce on public window when away mode is deactivated.
var AwayOffMsg = "has come BACK";

// Text to appear just before the user's away reason message.
var AwayReasonText = "reason:";

// Default kick message to appear as reason when using fast
// kick or when no reason is specified.
var KickfastMsg = "get out of here!";



// Alert messages
// -----------------

// Confirmation message for quitting.
var AlertQuit = "Are you sure you want to quit?\n\nPress OK to continue or Cancel to abort.";

// Alert message before proceeding to list server's channels.
// It is recommended to keep an alert message if the server
// to which the chat is connecting to is a popular one.
var AlertList = "WARNING!!\n\nDepending on server\'s popularity, the execution of this command\nwill display an infinite channel list, resulting in chatting interruption.\n\nOnce you press OK, this action can\'t be canceled. Continue at your own risk!";

// How the alerts are given to the user
// when he/she makes an incorrect action.
//
//	0	GoPJirc Defaults
//	1	JavaScript Alert
//	2	IRC Notice Alert
//
// Default value is 0 for GoPJirc Defults.
var AlertType = "2";

// Sound to play when GoPJirc is loaded. Specify a path.
// It can be a full path, a relative path or an URL.
// Leave it blank if you want none.
var SoundLoadSrc = "sound_load.mp3";

// Chat related
// ---------------

// File name of the chat HTML document.
// Only edit if you changed the chat HTML document's
// file name to other than the one specified below.
// Leave it as is for default value.
var ChatFileName = "index.php"

// Cursor style when mouseover/mouseout on dropdown menus.
// Note: Netscape only!! IE doesn't support this.
var StyleCursorOver = "pointer";	// On mouse over
var StyleCursorOut = "auto";		// On mouse out

// --------------------------------------------------------------------
//
// 				Advanced Configuration Settings:
//
// --------------------------------------------------------------------
//
// These config settings are for the applet parameter tags and are neeeded
// for customization for your chat. 
// Refer to the readme-pixx.txt, readme.txt, readme-descbot.txt & readme-alias.txt files for more information
// --------------------------------------------------------------------
var appletWidth = '585';
var appletHeight = '400';
var appletAlign = 'left';

// If you are using Thema's DescBot Mod then you can set this to "1" otherwise it must be "0"
var DescBot = '1';
var nickResponse = '$nick: $me is happy to see you in $chan!'; // This is the reply given to !Nick queries.
var responderCMD = '!';		// This is the token to place before HelperText Command. You are not limited to a single character.
// Place a list of helpertexts here. The command myNick_Help is automatically added and will list all the keys you place below.
// A textResponder takes the form of a comma separated list like so:
// 'key Response text here',
// 'key Another one here'
// '$me_key Another one here' : Using $me in the key will personalise the reponse to this bot by adding your current nick.
// Nothing will be done if DescBot = 0;
var textResponders = new initArray(
	 'Hell $nick hell is being in $schan with $me'
	,'$me_Hug $me gives $nick a great big hug'
)

// If you are using Thema's Alias Mod then you can set this to "1" otherwise it must be "0"
// Aliases can be added below in the parameter config section.
// Follow the readme-alias.txt for instructions.
var addAlias = '1';

// New Applet parameters should be added here, and unused ones removed.
// Parameters are in the form of ,<name>, <value>
// Example:
// to add the parameter:
//			<param name='alternatenick' value='MungoJerry??'>
// Add this line somewhere below 'gui','pixx'
// 			,'alternatenick','MungoJerry??'
// The commas are very important. If you miss any of them, it will not work.
// Do not add Nick, Server, and commands to identify or join channels.
// These are added automatically if the variables are found.
//
var cmds = 1; 
// If you add new commandx params below then you must add one to cmds for each command added
// See the commented examples...
var params = new initArray(
	'gui','pixx'
	,'pixx:language','pixx-english'
	,'language','english'
	,'pixx:lngextension','lng'
	,'lngextension','lng'
	,'port','6667'
	,'asl',''
	,'alternatenick',defaultNick+'??'
	,'quitmessage','TeQh.Com IRC Chat -- Irc.TeQh.Com'
	,'name','Irc.TeQh.Com'
	,'userid','TeQhCom'
	,'highlight','true'
	,'multiserver','false'
//  ,'command1','/msg #MyChan Hi there boobies! :)'   // edit cmds above to=2
//  ,'command2','/me welcomes all with open arms. :)' // edit cmds above to=3 etc.
	,'style:bitmapsmileys','true'
	,'style:smiley1',':) smile.gif'
	,'style:smiley2',':-) smile.gif'
	,'style:smiley3',':( frown.gif'
	,'style:smiley4',':-( frown.gif'
	,'style:smiley5','<:( frown.gif'
	,'style:smiley6',':D biggrin.gif'
	,'style:smiley7',':-D biggrin.gif'
	,'style:smiley8',':P tongue.gif'
	,'style:smiley9',':-P tongue.gif'
	,'style:smiley10',':p tongue.gif'
	,'style:smiley11',':-p tongue.gif'
	,'style:smiley12','>:[ angry.gif'
	,'style:smiley13','>:| angry.gif'
	,'style:smiley14','>;( angry.gif'
	,'style:smiley15','>:( angry.gif'
	,'style:smiley16',':* kisses.gif'
	,'style:smiley17',';* kisses.gif'
	,'style:smiley18',':+ kisses.gif'
	,'style:smiley19',';) wink.gif'
	,'style:smiley20',';-) wink.gif'
	,'style:smiley21','<:O shock.gif'
	,'style:smiley22',':O shock.gif'
	,'style:smiley23',':o shock.gif'
	,'style:smiley24',':) shy.gif'
	,'style:smiley25',':o) clown.gif'
	,'style:smiley26',':/( crying.gif'
	,'style:smiley27','8) glasses.gif'
	,'style:smiley28','B) glasses.gif'
	,'style:smiley29','0:) angel.gif'
	,'style:smiley30','o:) angel.gif'
	,'style:smiley31','O:) angel.gif'
	,'style:smiley32','():) angel.gif'
	,'style:smiley33','%| freak.gif'
	,'style:smiley34','%) reak.gif'
	,'style:smiley35',':| indifferent.gif'
	,'style:smiley36','|º sleep.gif'
	,'style:smiley37','|-º sleep.gif'
	,'style:smiley38','|o sleep.gif'
	,'style:smiley39','|-o sleep.gif'
	,'style:smiley40',':\\ undecided.gif'
	,'style:smiley41',':=) biggrin.gif'
	,'style:smiley42',':s incoherent.gif'
	,'style:smiley43',':S incoherent.gif'
	,'style:smiley44','8| surprised.gif'
	,'style:smiley45','8) surprised.gif'
	,'style:smiley46','x( dead.gif'
	,'style:smiley47','X( dead.gif'
	,'style:smiley48','x| dead.gif'
	,'style:smiley49','X| dead.gif'
	,'style:smiley50','#( dead.gif'
	,'style:smiley51','#| dead.gif'
	,'style:smiley52',':9 liking_lips.gif'
	,'style:smiley53',';9 liking_lips.gif'
	,'style:smiley54','=) bugs_smile.gif'
	,'style:highlight','true'
	,'style:floatingasl','true'
	,'pixx:styleselector','true'
	,'pixx:setfontonstyle','true'
	,'pixx:highlightnick','true'
	,'pixx:nickfield','true'
	,'pixx:configurepopup','true'
	,'pixx:popupmenustring1','Whois'
	,'pixx:popupmenustring2','Query'
	,'pixx:popupmenustring3','Ban'
	,'pixx:popupmenustring4','kick + Ban'
	,'pixx:popupmenustring5','--'
	,'pixx:popupmenustring6','Op'
	,'pixx:popupmenustring7','DeOp'
	,'pixx:popupmenustring8','Voice'
	,'pixx:popupmenustring9','DeVoice'
	,'pixx:popupmenustring10','--'
	,'pixx:popupmenustring11','Ping'
	,'pixx:popupmenustring12','Version'
	,'pixx:popupmenustring13','Time'
	,'pixx:popupmenustring14','Finger'
	,'pixx:popupmenucommand1_1','/Whois %1'
	,'pixx:popupmenucommand2_1','/Query %1'
	,'pixx:popupmenucommand3_1','/mode %2 -o %1'
	,'pixx:popupmenucommand3_2','/mode %2 +b %1'
	,'pixx:popupmenucommand4_1','/mode %2 -o %1'
	,'pixx:popupmenucommand4_2','/mode %2 +b %1'
	,'pixx:popupmenucommand4_3','/kick %2 %1'
	,'pixx:popupmenucommand6_1','/mode %2 +o %1'
	,'pixx:popupmenucommand7_1','/mode %2 -o %1'
	,'pixx:popupmenucommand8_1','/mode %2 +v %1'
	,'pixx:popupmenucommand9_1','/mode %2 -v %1'
	,'pixx:popupmenucommand11_1','/CTCP PING %1'
	,'pixx:popupmenucommand12_1','/CTCP VERSION %1'
	,'pixx:popupmenucommand13_1','/CTCP TIME %1'
	,'pixx:popupmenucommand14_1','/CTCP FINGER %1'
	,'pixx:color0','990000'
	,'pixx:color1','990000'
	,'pixx:color2','990000'
	,'pixx:color3','990000'
	,'pixx:color4','990000'
	,'pixx:color5','000000'
	,'pixx:color6','000000'
	,'pixx:color7','000000'
	,'pixx:color8','FFFFFF'
	,'pixx:color9','000000'
	,'pixx:color10','000000'
	,'pixx:color11','000000'
	,'pixx:color12','000000'
	,'pixx:color15','000000'
	,'pixx:nickfield','false'
)

// --------------------------------------------------------------------
//
// 				Advanced Configuration Settings:
//
// --------------------------------------------------------------------
//
// This config settings requiere no editing, unless you need more
// customization for your chat. With the required and more config,
// there's no need to edit past this lines. Advance users only.
// --------------------------------------------------------------------

// New Chat.
// For chat file root, refer to the ChatFileName variable
var ChatWinName = "";			// Window name. Leave blank for multiple windows.
var ChatWinWidth = "";			// Window width in pixels.
var ChatWinHeight = "";			// Window height in pixels.
var ChatWinScroll = "yes";		// Show window scrollbars.
var ChatWinResize = "yes";		// Window resizable.
var ChatWinMenu = "yes";		// Show window menubar.
var ChatWinStatus = "yes";		// Show window status.
var ChatWinLocation = "yes";		// Show window location.
var ChatWinToolbar = "yes";		// Show window toolbar.





//////////////////////////////////////////////////////////////////////////////////
//										//
//			GoPJirc Easy Configuration End				//
//										//
//////////////////////////////////////////////////////////////////////////////////

function initArray() 
{
	this.length = initArray.arguments.length;
	for (var i = 0; i < this.length; i++) 
	{
		this[i] = initArray.arguments[i];
	}
}

//////////////////////////////////////////////////////////////////////////////////
//										//
//			GoPJirc Script Start					//
//										//
//////////////////////////////////////////////////////////////////////////////////
/*
==================================================================================

¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!

NO NEED TO EDIT PAST THIS LINES, UNLESS YOU KNOW WHAT ARE YOU DOING

¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!   ¡¡¡WARNING!!!!

==================================================================================
*/

/*************************************
*                                    *
*               Misc                 *
*                                    *
*************************************/



// Sound to play when load.
document.write('<bgsound src="'+ SoundLoadSrc +'">');

// Message to display on status bar.
document.write('<script language="javascript">window.status=StatusBarMsg<\/script>');

/*************************************
*                                    *
*           ---------------          *
*              Functions             *
*           ---------------          *
*                                    *
*************************************/

// GoPJirc Functions
// -------------------

// Allows the execution of the values specified on the <option>s tags.
// Only needed when using a drop-down menu template.

function startChat() 
{
	var args = parseQueryString ();
	nick = args['nick'];
	chan = args['chan'];
	pass = args['pass'];
	server = args['server'];
	bkgrnd = args['bkgrnd'];
	loadApp(nick, chan, pass, server, bkgrnd);
}

function initArray() 
{
	this.length = initArray.arguments.length;
	for (var i = 0; i < this.length; i++) 
	{
		this[i] = initArray.arguments[i];
	}
}

function runCmd(type){
	if (type == 'start') {
		if (document.jform.start.options[document.jform.start.selectedIndex].value != "none") {
			location = document.jform.start.options[document.jform.start.selectedIndex].value;
		}
	}
	if (type == 'view') {
		if (document.jform.view.options[document.jform.view.selectedIndex].value != "none") {
			location = document.jform.view.options[document.jform.view.selectedIndex].value
		}
	}
	if (type == 'tools') {
		if (document.jform.tools.options[document.jform.tools.selectedIndex].value != "none") {
			location = document.jform.tools.options[document.jform.tools.selectedIndex].value
		}
	}
	if (type == 'control') {
		if (document.jform.control.options[document.jform.control.selectedIndex].value != "none") {
			location = document.jform.control.options[document.jform.control.selectedIndex].value
		}
	}
	if (type == 'channels') {
		if (document.jform.channels.options[document.jform.channels.selectedIndex].value != "none") {
			location = document.jform.channels.options[document.jform.channels.selectedIndex].value
		}
	}
	if (type == 'help') {
		if (document.jform.help.options[document.jform.help.selectedIndex].value != "none") {
			location = document.jform.help.options[document.jform.help.selectedIndex].value
		}
	}
	document.jform.reset();
}

// Make load a new chat in a new window.
function newChat (url) {
	ChatWinSettings = "scrollbars="+ ChatWinScroll +",resizable="+ ChatWinResize +",menubar="+ ChatWinMenu +",status="+ ChatWinStatus +",location="+ ChatWinLocation +",toolbar="+ ChatWinToolbar;
	window.open(url,ChatWinName,'width='+ ChatWinWidth +',height='+ ChatWinHeight +','+ChatWinSettings);
}

// Connect a new server
function newServer (opt) {
		var newserver = prompt('Type new server url: ', 'irc.teqh.com');
		if (opt == "0")
		{
				document.jchat.sendString('/server '+ newserver);

		}
		else
		{
				document.jchat.sendString('/newserver '+ newserver + ' '  + newserver);
		}
}

// Make load Help documents in a new window.
function newWindow (url) {
	window.open(url);
}

// Set a specified message by the user for different actions.
function setmsg (option) {
	// If using Kick, kickban or away...
	if (option == 'kick' || option == 'kickban' || option == 'away') {
		msg = prompt(PromptSetMsg +' '+ option +' '+ PromptSetMsg2,PromptSetInput);
		if (msg != null) {
			return msg;
		}
		else {
			return false;
		}
	}
	// Else is Whois, Ping, Finger, Client version/info, Time user,
	// Ignore/activate, Give/Remove voice/@p, Kick (fast/reason),
	// Ban, Kick & ban...
	else {
		msg = prompt(PromptNickMsg +' '+ option +' '+ PromptNickMsg2,PromptNickInput);
		if (msg != null) {
			return msg;
		}
		else {
			return false;
		}
	}
}

// Execute all options and actions defined.
function gopjirc(cmd,option) {





/*************************************
*                                    *
*        Start Drop down Menu        *
*                                    *
*************************************/
	
	// Login user to Server's Bot (eg. Undernet bot is X).
	if (cmd == 'login') {
		username = prompt(PromptLoginUserMsg,PromptLoginUserInput);
		login = null;
		if (username != null && identify != '0') {
			password = prompt(PromptLoginPassMsg,PromptLoginPassInput);
			login = username +' '+ password;
		}
		if (login != null || login != '') {
			if (identify == '1')
			{
				document.jchat.sendString(PromptLoginCmd +' '+ login);
			}
			else 
			{
				document.jchat.sendString('/nick '+ username);
				if (identify != '0')
				{
					document.jchat.sendString(PromptLoginCmd +' '+ password);
				}
			}
		}
	}

	// Opens a new chat window.
	if (cmd == 'window') {
		if (option == 'newchat') {
			if (ChatFileName != '') {
				newChat(ChatFileName);
			}
			else {
				goDebug('ChatFileName');
			}
		}
	}

	// Opens a new server window.
	if (cmd == 'server') 
	{
		if (option == 'newchat') 
		{
				newServer("1");
		}
		else 
		{
				newServer("0");
		}
	}

	// Refreshes the window.
	if (cmd == 'refresh') {
		window.location.reload();
	}

	if (cmd == 'homepage') {
		window.location = HomepageUrl
	}

	// Quits IRC.
	if (cmd == 'quit') {
		var QuitYes = confirm(AlertQuit);
		if (QuitYes) {
			document.jchat.sendString('/quit');
		}
	}

	// Close chat window.
	if (cmd == 'close') {
		window.close();
	}





/*************************************
*                                    *
*        View Drop down Menu          *
*                                    *
*************************************/

	// Whois
	if (cmd == 'whois') {
		nick = setmsg(cmd);
		if (nick != null) {
			document.jchat.sendString('/whois '+ nick);
		}
	}

	// Ping
	if (cmd == 'ping') {
		nick = setmsg(cmd);
		if (nick != null) {
			document.jchat.sendString('/ctcp '+ cmd +' '+ nick);
		}
	}

	// Finger
	if (cmd == 'finger') {
		nick = setmsg(cmd);
		if (nick != null) {
			document.jchat.sendString('/ctcp '+ cmd +' '+ nick);
		}
	}

	// Version
	if (cmd == 'version') {
		nick = setmsg('client version');
		if (nick != null) {
			document.jchat.sendString('/ctcp '+ cmd +' '+ nick);
		}
	}

	// Clientinfo
	if (cmd == 'clientinfo') {
		nick = setmsg('client info');
		if (nick != null) {
			document.jchat.sendString('/ctcp info '+ nick);
		}
	}

	// Time client
	if (cmd == 'timeclient') {
		nick = setmsg('time client');
		if (nick != null) {
			document.jchat.sendString('/ctcp time '+ nick);
		}
	}

	// Topic
	if (cmd == 'topic') {
		if (DescBot == "0")
		{
			channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
			if (channel != false) {
				if (channel.indexOf("#") != 0)
				{
					channel = "#" + channel;
				}
				document.jchat.sendString('/topic ' + channel);
			}
		}
		else
		{
			document.jchat.sendString('/topic $chan');
		}
	}

	// Channel info
	if (cmd == 'channelinfo') {
		channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
		if (channel != false) {
			// blank for current
			if (channel == '' && DescBot == "1") {
				document.jchat.sendString(PromptChannelinfoCmd +' $chan ');
			}
			// specified channel
			else {
				if (channel.indexOf("#") != 0)
				{
					channel = "#" + channel;
				}
				document.jchat.sendString(PromptChannelinfoCmd +' '+ channel);
			}
		}
	}

	// Time server
	if (cmd == 'timeserver') {
		document.jchat.sendString('/time');
	}





/*************************************
*                                    *
*       Tools Drop down Menu          *
*                                    *
*************************************/
	
	// Ignore
	if (cmd == 'ignore') {
		nick = setmsg('ignore/activate');
		if (nick != null) {
			document.jchat.sendString('/ignore '+ nick);
		}
	}

	// Away mode system.
	if (cmd == 'away') {
		if (AwayOn == 'yes') {
			option = 'back';
		}
		if (AwayOn == 'no') {
			option = 'AwayOn'
		}
		if (option == 'AwayOn') {
			AwayReasonMsg = setmsg(cmd);
			if (AwayReasonMsg != false) {
				document.jchat.sendString('/away '+ AwayReasonMsg);
				document.jchat.sendString('/me '+ AwayOnMsg +' \('+ AwayReasonText +' '+ AwayReasonMsg +'\).');
				AwayOn = 'yes';
			}
		}
		else {
			document.jchat.sendString('/away');
			document.jchat.sendString('/me '+ AwayOffMsg +' \('+ AwayReasonText +' '+ AwayReasonMsg +'\).');
			AwayOn = 'no';
		}
	}
	
	// New nick
	if (cmd == 'newnick') {
		newnick = prompt(PromptNewnickMsg,PromptNewnickInput);
		if (newnick != null) {
			document.jchat.sendString('/nick '+ newnick);
		}
	}

	// Invite
	if (cmd == 'invite') {
		// the values inside the single quotes appears on the prompt box.
		nick = prompt(PromptInviteMsg,PromptInviteInput);
		if (nick != null) {
			if (nick != '') {
				if (DescBot == "1")
				{
					document.jchat.sendString('/invite '+ nick +' $chan ');
				}
				else
				{
					channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
					if (channel != false)
					{
						if (channel.indexOf("#") != 0)
						{
							channel = "#" + channel;
						}
						document.jchat.sendString('/invite '+ nick +' '+ channel);
					}
				}
			}
		}
	}

	// Clear
	if (cmd == 'clear') {
		document.jchat.sendString('/clear');
	}





/*************************************
*                                    *
*      Control Drop down Menu         *
*                                    *
*************************************/

	// Give voice mode
	if (cmd == 'givevoice') {
		nick = setmsg('give voice');
		if (nick != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan +v '+ nick);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' +v '+ nick);
				}
			}
		}
	}

	// Remove voice mode
	if (cmd == 'removevoice') {
		nick = setmsg('remove voice');
		if (nick != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan -v '+ nick);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' -v '+ nick);
				}
			}
		}
	}

	// Give op mode
	if (cmd == 'giveop') {
		nick = setmsg('give @p');
		if (nick != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan +o '+ nick);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' +o '+ nick);
				}
			}
		}
	}

	// Remove op mode
	if (cmd == 'removeop') {
		nick = setmsg('remove @p');
		if (nick != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan -o '+ nick);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' -o '+ nick);
				}
			}
		}
	}

	// Kick
	if (cmd == 'kick') {
	
		// Kick (fast)
		if (option == 'fast') {
			// default value to be shown.
			kickmsg = KickfastMsg;
			nick = setmsg('kick ('+ option +')');
			if (nick != null) {
				if (DescBot == "1")
				{
					document.jchat.sendString('/kick $chan '+ nick +' '+ kickmsg);
				}
				else
				{
					channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
					if (channel != false)
					{
						if (channel.indexOf("#") != 0)
						{
							channel = "#" + channel;
						}
						document.jchat.sendString('/kick '+ channel +' '+ nick +' '+ kickmsg);
					}
				}
			}
		}

		// Kick (reason)
		else if (option == 'reason') {
			// default value to be shown.
			nick = setmsg('kick ('+ option +')');
			if (nick != false) {
				kickmsg = setmsg('kick');
				if (kickmsg != false) {
					if (DescBot == "1")
					{
						document.jchat.sendString('/kick $chan '+ nick +' '+ kickmsg);
					}
					else
					{
						channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
						if (channel != false)
						{
							if (channel.indexOf("#") != 0)
							{
								channel = "#" + channel;
							}
							document.jchat.sendString('/kick '+ channel +' '+ nick +' '+ kickmsg);
						}
					}
				}
			}
		}
		else {
			// default value if no reason specified.
			nick = setmsg('kick ('+ option +')');
			kickmsg = setmsg('kick');
			if ((nick != null) && (kickmsg != false)) {
				if (DescBot == "1")
				{
					document.jchat.sendString('/kick $chan '+ nick +' '+ kickmsg);
				}
				else
				{
					channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
					if (channel != false)
					{
						if (channel.indexOf("#") != 0)
						{
							channel = "#" + channel;
						}
						document.jchat.sendString('/kick '+ channel +' '+ nick +' '+ kickmsg);
					}
				}
			}
		}
	}

	// Ban
	if (cmd == 'ban') {
		nick = setmsg('ban');
		if (nick != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan +b '+ nick);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' +b '+ nick);
				}
			}
		}
	}

	// Kick and ban
	if (cmd == 'kickban') {
		// default value to be shown.
		nick = setmsg('kick and ban');
		if (nick != false) {
			kickmsg = setmsg('kickban');
			if (kickmsg != false) {
				if (DescBot == "1")
				{
					document.jchat.sendString('/mode $chan +b '+ nick);
					document.jchat.sendString('/kick $chan '+ nick +' '+ kickmsg);
				}
				else
				{
					channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
					if (channel != false)
					{
						if (channel.indexOf("#") != 0)
						{
							channel = "#" + channel;
						}
						document.jchat.sendString('/mode '+ channel +' +b '+ nick);
						document.jchat.sendString('/kick '+ channel +' '+ nick +' '+ kickmsg);
					}
				}
			}
		}
	}

	// Set topic
	if (cmd == 'settopic') {
		settopic = prompt(PromptTopicMsg,PromptTopicInput);
		if (settopic != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/topic $chan '+ settopic);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/topic '+ channel +' '+ settopic);
				}
			}
		}
	}

	// Channel modes
	if (cmd == 'chanmodes') {
		chanmodes = prompt(PromptChannelModesMsg,PromptChannelModesInput);
		if (chanmodes != null) {
			if (DescBot == "1")
			{
				document.jchat.sendString('/mode $chan '+ chanmodes);
			}
			else
			{
				channel = prompt(PromptChannelinfoMsg,PromptChannelinfoInput);
				if (channel != false)
				{
					if (channel.indexOf("#") != 0)
					{
						channel = "#" + channel;
					}
					document.jchat.sendString('/mode '+ channel +' '+ chanmodes);
				}
			}
		}
	}





/*************************************
*                                    *
*      Channels Drop down Menu        *
*                                    *
*************************************/

	// Channel
	if (cmd == 'channel') {

	// This is the ideal place for you to specify new channels entries.
	// Remember that then you have to add a new <option> tag with
	// their respective values. Look at the HTML code for examples.
		if (option == 'channel1') {
			document.jchat.sendString('/join '+ Channel1);
		}
		if (option == 'channel2') {
			document.jchat.sendString('/join '+ Channel2);
		}
		if (option == 'channel3') {
			document.jchat.sendString('/join '+ Channel3);
		}
		if (option == 'channel4') {
			document.jchat.sendString('/join '+ Channel4);
		}
		if (option == 'channel5') {
			document.jchat.sendString('/join '+ Channel5);
		}
		if (option == 'newchannel') {
			newchannel = prompt(PromptChannelMsg,PromptChannelInput);
			if (newchannel != null) {
				if (newchannel.indexOf("#") != 0 )
				{
					var joinstring = '/join #';
				} 
				else
				{
				  var joinstring = '/join ';
				}

				document.jchat.sendString(joinstring + newchannel);
			}
		}
		if (option == 'list') {
			var ListYes = confirm(AlertList);
			if (ListYes) {
				document.jchat.sendString('/list');
			}
		}
	}





/*************************************
*                                    *
*        Help Drop down Menu          *
*                                    *
*************************************/


	// Commands
	if (cmd == 'commands') {
		newWindow('commands.html');
	}

	// Help
	if (cmd == 'help') {
		document.jchat.sendString('/help');
	}

	// About box
	if (cmd == 'about') {
		alert('- Irc.TeQh.com -- http://chat.teqh.com/\n');
	}





/**************************************
*                                     *
*  ¡¡¡ HERE ENDS GOPJIRC FUNCTION !!!  *
*                                     *
**************************************/

}		// this is the closing key for gopjirc function




// ---------------
// Error Report
// ---------------

if (EnableErrorReport == '0') {
	function errorCheck(msg,url,linenumber) {
		if (msg == 'java.lang.ArrayIndexOutOfBoundsException: -1 < 0') {
			if (AlertType == '0' || AlertType == '2') {
				document.jchat.sendString('/notice %$N '+AlertSelectNick);
				return true
			}
			else if (AlertType == '1') {
				alert(AlertSelectNick);
				return true
			}
			else {
				goDebug('AlertType');
				return true
			}
		}
	}
window.onerror=errorCheck
}

if (EnableErrorReport == '1') {
	function errorReport(msg,url,linenumber) {
		if (msg == 'java.lang.ArrayIndexOutOfBoundsException: -1 < 0') {
			if (AlertType == '0' || AlertType == '2') {
				document.jchat.sendString('/notice %$N '+AlertSelectNick);
				return true
			}
			else if (AlertType == '1') {
				alert(AlertSelectNick);
				return true
			}
			else {
				goDebug('AlertType');
				return true
			}
		}
		else {
			var ReportYes = confirm(ErrorReportAlert);
			if (ReportYes) {
				window.location = "mailto:"+ WebmasterEmail +"?Subject="+ ErrorReportSubject +"&amp;Body="+ ErrorReportMsgText +" "+ msg +" \/ "+ ErrorReportLineText +" "+ linenumber;
				return true
			}
			else {
				return true
			}
		}
	}
window.onerror=errorReport
}

if (EnableErrorReport == '2') {
	function errorAlert(msg,url,linenumber) {
		if (msg == 'java.lang.ArrayIndexOutOfBoundsException: -1 < 0') {
			alert(AlertSelectNick);
			return true
		}
		else {
			alert('# JavaScript Error #\n\nMessage: '+ msg +'\nLine: '+ linenumber +'\nURL: '+ url);
			return false
		}
	}
window.onerror=errorAlert
}

if (EnableErrorReport == '3') {
	function errorSupress() {
		if (msg == 'java.lang.ArrayIndexOutOfBoundsException: -1 < 0') {
			if (AlertType == '0' || AlertType == '2') {
				alert(AlertSelectNick);
				return true
			}
			else if (AlertType == '1') {
				alert(AlertSelectNick);
				return true
			}
			else {
				goDebug('AlertType');
				return true
			}
		}
		else {
			return true
		}
	}
window.onerror=errorSupress
}


// -----------
// Debugger
// -----------

var BugginMsg = "\n\nThis message will continue buggin until a valid action is taken.\n{ Debugger }";
var ErrorText = "# Config Error #\n\n";
var ErrorMsg = " You must enter a correct value.";
var ErrorConfirmMsg = "\n\nPress OK to use a default value and continue running GoPJirc\nor press Cancel to abort chat loading. ";
var LoadCanceledMsg = "\n\nChat loading has been canceled :P";

// Cancel loading.
function loadCancel() {
	location.href='about:blank';
}

// Debug when an execution is made.
function goDebug(type) {
	if (type == 'ChatFileName') {
		alert(ErrorText+'ChatFileName var is blank. You must enter a correct value.\n\nIf you want to stop using New Window option, open config.js\nand comment the var ChatFileName line with \"//\" in front of it.'+BugginMsg);
	}
	if (type == 'AlertType') {
		alert(ErrorText+'Value \" '+AlertType.substring()+' \" not allowed for AlertType var.\n\n0\tGoPJirc Defaults\n1\tJavaScript Alert\n2\tIRC Notice Alert'+BugginMsg);
	}
}

// Detect blank values for the corresponding vars before chat load.
// If blank, return an alert message asking to continue chat loading
// and give it a default value or cancel it.
if (EnableErrorReport == '') {
	alert(ErrorText+'ErrorReport var is blank.\n\n0\tDeactivate Error Report\n1\tActivate Error Report\n2\tDev Mode\n3\tSupress Mode'+BugginMsg);
	loadCancel();
}
if (EnableErrorReport > '3') {
	alert(ErrorText+'ErrorReport var incorrect value of \" '+EnableErrorReport.substring()+' \".\n\n0\tDeactivate Error Report\n1\tActivate Error Report\n2\tDev Mode\n3\tSupress Mode'+LoadCanceledMsg+BugginMsg);
	loadCancel();
}
if (AlertType == '') {
	alert(ErrorText+'AlertType var is blank.\n\n0\tGoPJirc Defaults\n1\tJavaScript Alert\n2\tIRC Notice Alert'+LoadCanceledMsg+BugginMsg);
	loadCancel();
}
if (AlertType > '2') 
{
	alert(ErrorText+'AlertType var incorrect value of \" '+AlertType.substring()+' \".\n\n0\tGoPJirc Defaults\n1\tJavaScript Alert\n2\tIRC Notice Alert'+LoadCanceledMsg+BugginMsg);
	loadCancel();
}

// Detect if Channel*Text is blank before chat load, and if it is,
// use the value of Channel* as default text to display.
// Silent action, no alert.
if (Channel1Text == '') { var Channel1Text = Channel1; }
if (Channel2Text == '') { var Channel2Text = Channel2; }
if (Channel3Text == '') { var Channel3Text = Channel3; }
if (Channel4Text == '') { var Channel4Text = Channel4; }
if (Channel5Text == '') { var Channel5Text = Channel5; }
// Default value Away mode.
if (AwayOn == null) { var AwayOn = "no" }

// Detect Browser type.
// If is Internet Explorer, blank StyleCursor* values
// to prevent cursor and dropdown menus graphical errors. 
if (navigator.appName != 'Netscape') 
{
	var StyleCursorOver = "";
	var StyleCursorOut = "";
}

function parseQueryString () 
{
	var str = str ? "" : document.location.search;
	var query = str.charAt(0) == '?' ? str.substring(1) : str;
	var args = new Object();
	if (query) 
	{
		var fields = query.split('&');
		for (var f = 0; f < fields.length; f++) 
		{
			var field = fields[f].split('=');
			args[unescape(field[0].replace(/\+/g, ' '))] =  unescape(field[1].replace(/\+/g, ' '));
		}
	}
	return args;
}
				 
function loadApp(nick, chan, pass, server, bkgrnd)
{
	if (nick == '' || nick == null) nick = defaultNick;
	if (pass == '' || pass == null) pass = defaultPass;
	if (chan == '' || chan == null) chan = defaultChan;
	if (server == '' || server == null) server = defaultServer;
	if (bkgrnd == '' || bkgrnd == null) bkgrnd = defaultBkgrnd;
	var newChat = document.createElement('applet');
		newChat.setAttribute('name','jchat');
		newChat.setAttribute('id','jchat');
		newChat.setAttribute('code','IRCApplet.class');
		newChat.setAttribute('alt','PJirc Chat Applet');
		newChat.setAttribute('width',appletWidth);
		newChat.setAttribute('height',appletHeight);
		newChat.setAttribute('align',appletAlign); 
	var newParam = document.createElement('param'); 
			newParam.setAttribute('name','nick'); 
			newParam.setAttribute('value',nick); 
			newChat.appendChild(newParam);
	var serverport = '6667'
	var fields = server.split(':');
	if (fields.length > 1)
	{
		server = fields[0];
		serverport = fields[1];
	}
	var newParam = document.createElement('param'); 
			newParam.setAttribute('name','host'); 
			newParam.setAttribute('value',server); 
			newChat.appendChild(newParam);
	var newParam = document.createElement('param'); 
			newParam.setAttribute('name','port'); 
			newParam.setAttribute('value',serverport); 
			newChat.appendChild(newParam);
	if (DescBot == 1 && addAlias == 1)
	{			  
		newChat.setAttribute('archive','irc.jar,pixx.jar,descbot.jar,alias.jar');
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','CABINETS'); 
			newParam.setAttribute('value','irc.cab,pixx.cab,securedirc.cab,descbot.cab,alias.cab'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','plugin1'); 
			newParam.setAttribute('value','adnd.Alias'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','plugin2'); 
			newParam.setAttribute('value','adnd.DescBot'); 
			newChat.appendChild(newParam);
	}
	if (DescBot == 0 && addAlias == 1)
	{			  
		newChat.setAttribute('archive','irc.jar,pixx.jarr,alias.jar');
		var newParam = document.createElement('param'); 
			newParam.setAttribute('name','CABINETS'); 
			newParam.setAttribute('value','irc.cab,pixx.cab,securedirc.cab,alias.cab'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','plugin1'); 
			newParam.setAttribute('value','adnd.Alias'); 
			newChat.appendChild(newParam);
	}
	if (DescBot == 1 && addAlias == 0)
	{			  
		newChat.setAttribute('archive','irc.jar,pixx.jar,descbot.jar');
		var newParam = document.createElement('param'); 
			newParam.setAttribute('name','CABINETS'); 
			newParam.setAttribute('value','irc.cab,pixx.cab,securedirc.cab,descbot.cab'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','plugin1'); 
			newParam.setAttribute('value','adnd.DescBot'); 
			newChat.appendChild(newParam);
	}
	if (DescBot == 0 && addAlias == 0)
	{			  
		newChat.setAttribute('archive','irc.jar,pixx.jar');
		var newParam = document.createElement('param'); 
			newParam.setAttribute('name','CABINETS'); 
			newParam.setAttribute('value','irc.cab,pixx.cab,securedirc.cab'); 
			newChat.appendChild(newParam);
	}
	if (DescBot == 1)
	{
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','descbot:scriptvariables'); 
			newParam.setAttribute('value','true'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','descbot:respondercmd'); 
			newParam.setAttribute('value',responderCMD); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','descbot:nickresponder'); 
			newParam.setAttribute('value','true'); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','descbot:nickresponse'); 
			newParam.setAttribute('value',nickResponse); 
			newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
			newParam.setAttribute('name','descbot:textresponders'); 
			newParam.setAttribute('value','true'); 
			newChat.appendChild(newParam);
		for (var param = 0; param < textResponders.length;param++)
		{
			newParam = document.createElement('param');
			var tst=param+1;
			newParam.setAttribute('name','descbot:textresponder'+tst); 
			newParam.setAttribute('value',textResponders[param]);
			newChat.appendChild(newParam);
		}
	}
	if (pass != 'N/A' && pass != '') 
	{
		newParam = document.createElement('param'); 
		newParam.setAttribute('name','command'+cmds); 
		newParam.setAttribute('value','/msg nickserv identify '+pass); 
		newChat.appendChild(newParam);
		cmds++
	}
	if (chan != 'N/A' && chan != "") 
	{
		newParam = document.createElement('param'); 
		newParam.setAttribute('name','command'+cmds); 
		newParam.setAttribute('value','/join #'+chan); 
		newChat.appendChild(newParam);
		cmds++
	}
	if (bkgrnd != 'N/A' && bkgrnd != "" && chan  != 'N/A' && chan != "") 
	{
		newParam = document.createElement('param'); 
		newParam.setAttribute('name','style:backgroundimage'); 
		newParam.setAttribute('value','true'); 
		newChat.appendChild(newParam);
		newParam = document.createElement('param'); 
		newParam.setAttribute('name','style:backgroundimage1'); 
		newParam.setAttribute('value','all all-'+chan+' 1 '+bkgrnd); 
		newChat.appendChild(newParam);
	}
	for (var param = 0; param < params.length;param++)
	{
		newParam = document.createElement('param'); 
		if (params[param].indexOf('command') == 0)
		{ 
			newParam.setAttribute('name','command'+cmds);
			cmds++;
			param++;
		}
		else newParam.setAttribute('name',params[param++]); 
		newParam.setAttribute('value',params[param]); 
		newChat.appendChild(newParam);
	}
	var pjDiv = document.getElementById('PJirc');
	pjDiv.appendChild(newChat);

	var cMenu = document.getElementById('channels');
	var spacer = document.getElementById('chanlist');
	var newOption = document.createElement('option');
		newOption.setAttribute('value',"javascript:gopjirc(\'channel\',\'channel1\')");
		var newText = document.createTextNode(Channel1Text);
		newOption.appendChild(newText);
		cMenu.insertBefore(newOption,spacer);
		newOption = document.createElement('option');
		newOption.setAttribute('value',"javascript:gopjirc(\'channel\',\'channel2\')");
		newText = document.createTextNode(Channel2Text);
		newOption.appendChild(newText);
		cMenu.insertBefore(newOption,spacer);
	newOption = document.createElement('option');
		newOption.setAttribute('value',"javascript:gopjirc(\'channel\',\'channel3\')");
		newText = document.createTextNode(Channel3Text);
		newOption.appendChild(newText);
		cMenu.insertBefore(newOption,spacer);
	newOption = document.createElement('option');
		newOption.setAttribute('value',"javascript:gopjirc(\'channel\',\'channel4\')");
		newText = document.createTextNode(Channel4Text);
		newOption.appendChild(newText);
		cMenu.insertBefore(newOption,spacer);
}


//////////////////////////////////////////////////////////////////
//								//
//			GoPJirc Script End			//
//								//
//////////////////////////////////////////////////////////////////