function mouseOver() {
	overTimer = window.setTimeout("timerOver()", 40);
	window.clearTimeout(outTimer);
	
}

function mouseOut() {
	outTimer = window.setTimeout("timerOut()", 40);
	window.clearTimeout(overTimer);
}

function mouseClick() {
	if(opacity < 0.5)
		mouseOut();
	else
		mouseOver();
}

var opacity = 1;
var outTimer;
var overTimer;

function timerOver() {
	if(opacity >= 0.06)
		opacity -= 0.06;
	else
		opacity = 0;
	document.getElementById("schriftzug").setAttribute("style", "opacity: " + opacity + ";" +
			"-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + opacity * 100 + ")\";" +
			"filter: alpha(opacity=" + opacity * 100 + ");");
	document.getElementById("text").setAttribute("style", "opacity: " + (1 - opacity) + ";" +
			"-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (1 - opacity) * 100 + ")\";" +
			"filter: alpha(opacity=" + (1 - opacity) * 100 + ");");
	if(opacity != 0)
		overTimer = window.setTimeout("timerOver()", 40);
	else {
		document.getElementById("text").setAttribute("style", "opacity: " + (1 - opacity) + ";" +
				"-ms-filter: none;" +
				"filter: none;");
	}
}

function timerOut() {
	if(opacity <= 0.94)
		opacity += 0.06;
	else
		opacity = 1;
	document.getElementById("schriftzug").setAttribute("style", "opacity: " + opacity + ";" +
			"-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + opacity * 100 + ")\";" +
			"filter: alpha(opacity=" + opacity * 100 + ");");
	document.getElementById("text").setAttribute("style", "opacity: " + (1 - opacity) + ";" +
			"-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=" + (1 - opacity) * 100 + ")\";" +
			"filter: alpha(opacity=" + (1 - opacity) * 100 + ");");
	if(opacity != 1)
		outTimer = window.setTimeout("timerOut()", 40);
	else {
		document.getElementById("schriftzug").setAttribute("style", "opacity: " + opacity + ";" +
				"-ms-filter: none;" +
				"filter: none;");
		
	}
}
