// Version 4.0
var UserLoginSound = new Array();
var SoundLoginSound = new Array();
/* Konfiguration */
// Loginsound immer eingeschaltet? (1 = eingeschaltet, 0 = ausgeschaltet)
var LoginSoundActivated = 0;
// Sollen Gäste auch Loginsounds hören können? (1 = eingeschaltet, 0 = ausgeschaltet)
var LoginSoundGuests = 0;
// Standardsound, falls User hier nicht aufgelistet, wird der Sound abgespielt
var defaultLoginSound = "http://server"+chatData[0]+".webkicks.de/9.wav";
// Logoutsound aktivieren? (1 = eingeschaltet, 0 = ausgeschaltet)
var LogoutSoundActivated = 0;
// Logoutsound, der gespielt wird, wenn sich jemand ausloggt und Logoutsound aktiviert ist
var LogoutSound = "http://server"+chatData[0]+".webkicks.de/5.wav";
// Hier müssen die User mit speziellen Loginsounds aufgezeigt werden
// Muster:
// UserLoginSound[ZAHL] = "techniker_schlumpf";
// SoundLoginSound[ZAHL] = "
http://monsterradio.ucoz.de/Norman_Lang ... zeit_2.mp3";
// ZAHL muss bei 0 beginnen und kann unendlich weit steigen. Jede Zahl bitte nur einmal verwenden (also einmal für User und einmal für Sound)!
// User immer klein schreiben!
UserLoginSound[0] = "schlumpf";
SoundLoginSound[0] = "
http://monsterradio.ucoz.de/Norman_Lang ... zeit_2.mp3";
UserLoginSound[1] = "techniker_schlumpf";
SoundLoginSound[1] = "
http://monsterradio.ucoz.de/Norman_Lang ... onen_0.mp3";
UserLoginSound[2] = "micky_maus";
SoundLoginSound[2] = "
http://monsterradio.ucoz.de/fantasy_ein_wei-es_boot.mp3";
UserLoginSound[3] = "marco36";
SoundLoginSound[3] = "
http://monsterradio.ucoz.de/Norman_Lang ... zeit_2.mp3";
UserLoginSound[4] = "Shiana05";
SoundLoginSound[4] = "
http://monsterradio.ucoz.de/Mickie_karuse_Tinitus.mp3";
/* Ab hier bitte nichts mehr ändern! */
var formInfo = parent.info.document.forms[0]; var LsStopper = 0;
newLSound = new (function () {
var that = this;
this.lastMsg = ""; this.MsgInt; this.audioTag = 0;
this.objType = (typeof document.createElement("bgsound").src != "undefined" && !myBrowser.Opera) ? "bgsound" : "embed";
that.objType = (!!document.createElement("audio").canPlayType && document.createElement("audio").canPlayType("audio/wav").match(/maybe|probably|true/i)) ? "audio" : that.objType;
this.start = function () {
if (LoginSoundGuests && myStatus == 0) that.addLSoundBox();
if (LoginSoundActivated) {
formInfo.LSound.checked = true;
parent.forces = true;
}
LoginSound = that.LSound;
parent.info.document.sendes = that.checkBox;
that.checkBox();
}
this.playSound = function (sound) {
var sObj = that.soundObj();
sObj.src = sound;
if (that.objType != "audio" && (!myBrowser.WebKit || formInfo.message.value == "")) {
document.body.appendChild(sObj);
if (that.objType != "bgsound") window.setTimeout("with(formInfo){elements[elements.length-1].focus();message.focus();}", 850);
} else if (that.objType == "audio") {
that.audioTag = sObj;
sObj.play();
}
}
this.soundObj = function () {
that.stopObj();
var obj = document.createElement(that.objType);
if (that.objType == "embed") {
with (obj) {
type = "audio/wav";
width = 1;
height = 1;
hidden = true;
}
}
if (that.objType != "audio") obj.id = "lsSound_id";
return obj;
}
this.stopObj = function () {
if (that.audioTag != 0) that.audioTag.pause();
var ObjID = document.getElementById("lsSound_id");
if (document.getElementById("lsSound_id")) ObjID.parentNode.removeChild(ObjID);
}
this.LoSound = function () {
var tds = document.getElementsByTagName("td");
if (tds.length != 0 && strip_tags(tds[tds.length-1].innerHTML) != that.lastMsg && lineData(tds[tds.length-1])[0] == 5) {
var soundID = LogoutSound;
if (parent.forces) {
LsStopper = 1;
window.setTimeout("LsStopper = 0;", 3000);
that.playSound(soundID);
}
}
if (tds.length != 0) {
that.lastMsg = strip_tags(tds[tds.length-1].innerHTML);
}
}
this.LSound = function () {
var tds = document.getElementsByTagName("td");
for (i=1; i<=5; i++) {
if (tds.length>=i && tds[tds.length-i] && tds[tds.length-i].getElementsByTagName("login").length) {
var soundID = UserLoginSound.indexOf(lineData(tds[tds.length-i])[2].toLowerCase());
soundID = (soundID == -1) ? defaultLoginSound : SoundLoginSound[soundID];
if (parent.forces) {
LsStopper = 1;
window.setTimeout("LsStopper = 0;", 3000);
that.playSound(soundID);
}
break;
}
}
}
this.checkBox = function () {
parent.forces = formInfo.LSound.checked;
if (!parent.forces) {
that.stopObj();
if (LogoutSoundActivated) window.clearInterval(that.MsgInt);
} else if (LogoutSoundActivated) {that.MsgInt = window.setInterval(function(){that.LoSound();}, 850);}
}
this.addLSoundBox = function () {
if (efIsLoad()) {
if (!formInfo.LSound) {
var LSbox = parent.info.document.createElement("span");
LSbox.innerHTML = ' Loginsound: <input type="checkbox" name="LSound" onclick="sendes()" /> ';
formInfo.insertBefore(LSbox, formInfo.childNodes[3]);
}
} else {window.setTimeout(function(){that.addLSoundBox()}, 500);}
}
});
newLSound.start();