<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
// Display & remove the server time at the status bas
function clock(gap)
{
cur_date = new Date();
calc_date = new Date(cur_date - gap);
calc_hours = calc_date.getHours();
calc_minuts = calc_date.getMinutes();
calc_seconds = calc_date.getSeconds();
if (calc_hours < 10) calc_hours = "0" + calc_hours;
if (calc_minuts < 10) calc_minuts = "0" + calc_minuts;
if (calc_seconds < 10) calc_seconds = "0" + calc_seconds;
calc_time = calc_hours + ":" + calc_minuts + ":" + calc_seconds;
window.status = "Server Zeit: " + calc_time;
clock_disp = setTimeout('clock(' + gap + ')', 1000);
}
function stop_clock()
{
clearTimeout(clock_disp);
window.status = '';
}
function calc_gap(serv_date)
{
server_date = new Date(serv_date);
local_date = new Date();
return local_date - server_date;
}
gap = calc_gap("August 10, 2008 20:27:45");
clock(gap);
// Automatically submit a command
function runCmd(CmdName,infos)
{
if (window.frames['input'] && window.frames['input'].window.document.forms['MsgForm'])
{
var inputForm = window.frames['input'].window.document.forms['MsgForm'];
if (infos != "") infos = " " + infos;
inputForm.elements['M'].value = "/" + CmdName + infos;
inputForm.elements['sent'].value = '1';
if (document.all) inputForm.elements['sendForm'].disabled = true;
inputForm.submit();
};
};
// Misc vars
var is_ignored_popup = null;
var path2Chat = "chat/";
ver4 = false;
// Launch the help popup
var is_help_popup = null;
function help_popup()
{
if (is_help_popup && !is_help_popup.closed)
{
is_help_popup.focus();
}
else
{
var scrTop = mouseY-400;
var scrLeft = mouseX-10;
var scrPos = "top=" + scrTop + ",screenY=" + scrTop + ",left=" + scrLeft + ",screenX=" + scrLeft + ",";
is_help_popup = window.open("help_popup.php3?L=german&Ver=L","help_popup",scrPos + "width=600,height=350,scrollbars=yes,resizable=yes");
};
};
// -->
</SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="javascript1.1">
<!--
// Misc vars
imgHelpOff = new Image(15,15); imgHelpOff.src = path2Chat + "images/helpOff.gif";
imgHelpOn = new Image(15,15); imgHelpOn.src = path2Chat + "images/helpOn.gif";
// Put the nick of the user who was clicked on in the messages or the users frames
// to the message box in the input frame;
function userClick(user,privMsg)
{
if (window.frames['input'] && window.frames['input'].window.document.forms['MsgForm'].elements['MsgTo'])
{
window.frames['input'].window.document.forms['MsgForm'].elements['MsgTo'].value = user;
var msgbox = window.frames['input'].window.document.forms['MsgForm'].elements['M'];
if (privMsg)
{
var oldStr = msgbox.value;
if (oldStr == "" || oldStr.substring(0,1) != " ") oldStr = " " + oldStr;
msgbox.value = "/TO " + user + oldStr;
}
else
{
msgbox.value += user;
if (msgbox.value == user) msgbox.value += "> ";
};
msgbox.focus();
};
};
// Color choice at the input frame;
isModerator = 0;
imgColor1 = new Image(4,20); imgColor1.src = path2Chat + "images/unselColor.gif";
imgColor2 = new Image(4,20); imgColor2.src = path2Chat + "images/selColor.gif";
var SelColor = null;
function ChangeColor(ColorVal,ColorRank)
{
if (SelColor != ColorRank)
{
if (document.all)
{
obj1 = window.frames['input'].window.document.all[SelColor];
obj2 = window.frames['input'].window.document.all[ColorRank];
}
else if (document.images)
{
obj1 = window.frames['input'].window.document.images[SelColor];
obj2 = window.frames['input'].window.document.images[ColorRank];
}
else return;
if (SelColor != null)
{
obj1.src = imgColor1.src;
};
SelColor = ColorRank;
window.frames['input'].window.document.forms['MsgForm'].elements['C'].value = ColorVal;
obj2.src = imgColor2.src;
};
window.frames['input'].window.document.forms['MsgForm'].elements['M'].focus();
};
// Set the focus to the message box at the input frame;
function get_focus()
{
window.frames['input'].window.focus();
window.frames['input'].window.document.forms['MsgForm'].elements['M'].focus();
};
// -->
</SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript1.2">
<!--
// Get the position for the help popup
var mouseX = 0;
var mouseY = 0;
function displayLocation(e)
{
if (ver4)
{
if (IE4) e = window.frames['input'].window.event;
mouseX = e.screenX;
mouseY = e.screenY;
}
return;
}
// Quick validation of the message or the command submited at the input frame
function validateSubmission()
{
inputFrameForm = window.frames['input'].window.document.forms['MsgForm'];
// Submission looks like a command?
isCmd = (inputFrameForm.elements['M'].value.substring(0,1) == '/');
// RegExp to quick check for valid commands
re = /^\/(!$|announce .+|ban .+|clear$|help$|\?$|ignore|invite .+|join .+|kick .+|me .+|msg .+|to .+|notify$|order$|profile$|promote .+|quit|exit|bye|refresh|save|show|last|timestamp$|whois .+)/i;
// Ensure the message box isn't empty
if (inputFrameForm.elements['M'].value == '')
{
inputFrameForm.elements['M'].focus();
return false;
}
// It looks like a command but's not a valid one -> display error message
else if (isCmd && !re.test(inputFrameForm.elements['M'].value))
{
inputFrameForm.elements['M'].select();
alert("Dies ist kein gültiger Befehl!");
return false;
}
// It doesn't look like a command -> it's a message, then ensure a message
// isn't currently being submitted...
else if (!isCmd && inputFrameForm.elements['sent'].value == '1')
{
inputFrameForm.elements['M'].focus();
return false;
}
// ... and that the same message hasn't been submitted the last time
else if (!isCmd && inputFrameForm.elements['M'].value == inputFrameForm.elements['M0'].value)
{
inputFrameForm.elements['M'].value = '';
inputFrameForm.elements['M'].focus();
return false;
}
// All the tests have been succesfully passed -> submit the from
else
{
inputFrameForm.elements['sent'].value = '1';
if (document.all) inputFrameForm.elements['sendForm'].disabled = true;
return true;
};
}
// -->
</SCRIPT>