// JavaScript Document
function Ticker(id, msg)
{
	var parEl = null;
 
	if (!(parEl = document.getElementById(id)) || (typeof msg != 'object'))
	{
		window.alert('Konnte Ticker nicht initialisieren!');
 
		return;
	}
 
	this.respell = function(k, i)
	{
		var exp = new RegExp(/(.*?)<a(.+?)>(.+?)<\/a>(.*)/i);
		var res = exp.exec(msg[k]);
 
		if (res == null)
			parEl.innerHTML = msg[k].substring(0, i) + '_';
		else if (res.length==5)
			if (i<res[1].length)
				parEl.innerHTML = res[1].substring(0, i) + '_';
			else if (i==res[1].length)
				i = res[1].length+res[2].length+3;
			else if (i<res[0].length-res[4].length)
				parEl.innerHTML = res[1].toString() + "<a" + res[2] + ">" + res[3].substring(0, i-(res[1].length+res[2].length+3)) + "<\/a>_";
			else 
				parEl.innerHTML = res[1].toString() + "<a" + res[2] + ">" + res[3].toString() + "<\/a>" + res[4].substring(0, i-(res[1].length+res[2].length+res[3].length+4)) +"_";	
 
		if (i++ == msg[k].length)
		{
			i = 0;
 
			window.setTimeout(function() { this.respell(k, i); }, 3000);
 
			k = (k + 1) == msg.length ? 0 : k + 1;
		}
		else
			window.setTimeout(function() { this.respell(k, i); }, 50);
 
	}
 
	window.respell = this.respell;
 
	this.respell(0, 0);
}
 
window.onload = function()
{
	new Ticker('ticker', ['New OEM-Styler Projekt V8 - e39 by Seifert692! <a href=\"owner/seif/op.php\">Klick</a>']);
}

function checkform(){
	var vname = document.getElementById('vname').value;
	var href = document.getElementById('href').value;
	var eintrag = document.getElementById('eintrag').value;
	var ip = document.getElementById('ip').value;
	
	if (vname == "") {
		check = prompt("Bitte Namen eingeben:");
		if (check === null) return 0;
		if (check == "") check = "";
		document.getElementById("vname").value = check;
		vname = check;
	} 
	if (href == "") {
		check = prompt("Bitte E-Mail Adresse eingeben:");
		if (check === null) return 0;
		if (check == "") check = "";
		document.getElementById("href").value = check;
		href = check;
	}
	if (eintag == "") {
		check = prompt("Bitte Nachricht eingeben:");
		if (check === null) return 0;
		if (check == "") check = "";
		document.getElementById("eintrag").value = check;
		eintrag = check;
	}
}
