//
// kos.js Copyrigt (c) 2010 by Stefan O. Schüller
//

function Zelle (bild, align, _width, _hight, width, hight, alt)
	{
	var pos = alt.indexOf("&#13;");

	document.write ("<TD>");
	PopupLink (bild, align, _width, _hight, width, hight, alt.substring (pos+5, alt.length));
	document.write ("<p class='bild'>" + alt.substring (0,pos) + "</p>");
	document.write ("</TD>");
	}

function PopupLink (bild, align, _width, _hight, width, hight, alt)
	{
	var PopupWidth = 20;
	var PopupHight = 20;

	document.write ("<a href='javascript: ImageOpen(&quot;" + bild +"&quot;, ");	//<a href='javascript: PopupOpen("bild",_
	document.write (width + PopupWidth);				//<a href='javascript: ImageOpen("bild", width
	document.write (", ");						//<a href='javascript: ImageOpen("bild", width,_ 
	document.write (hight + PopupHight);				//<a href='javascript: ImageOpen("bild", width, hight
	document.write (")'>");						//<a href='javascript: ImageOpen("bild", width, hight)'>
	document.write ("<img class=pop src='_" + bild + "' align=");	//<img class=pop src='_bild' align=
	document.write (align + " width='");				//<img class=pop src='_bild' align=align
	document.write (_width);					//<img class=pop src='_bild' align=align width='_width
	document.write ("' hight='");					//<img class=pop src='_bild' align=align width='_width' hight='
	document.write (_hight);					//<img class=pop src='_bild' align=align width='_width' hight='_hight
	document.write ("' alt='" + alt + "' title='" + alt + "'></a>");//<img class=pop src='_bild' align=align width='_width' hight='_hight' alt='alt' title='alt'></a>
	}

function ImageOpen (url, width, hight)
	{
	window.open (url,"Popup","Width=" + width + ",Height=" + hight + ",location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no");
	}

function PopupInfo (url, text, width, hight)
	{
//	document.write ("<a style='color:navy;' HREF='javascript: ");	//<a style="color:navy;" HREF='javascript:_
	document.write ("<a href='javascript: ");			//<a href='javascript:_
	document.write ("InfoOpen(&quot;" + url +"&quot;, ");		//<a href='javascript: InfoOpen("url",_
	document.write (width + ", ");					//<a href='javascript: InfoOpen("url", width,_
	document.write (hight + ")'>" + text + "</a>");			//<a href='javascript: InfoOpen("url", width, hight)'>text</a>
	}

function InfoOpen (url, width, hight)
	{
	window.open (url,"Popup","Width=" + width + ",Height=" + hight + ",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no");
	}

function startTimer(aTarget, aTime)					// URL (Weiterleitungsziel), Zeit in Sekunden
	{
	var time= new Date();
	var hours= time.getHours();
	var mins= time.getMinutes();
	var secs= time.getSeconds();

	theTarget=aTarget;
	closeTime=hours*3600+mins*60+secs;
	closeTime+=aTime;  
	Timer();
	}

function Timer()
	{
	var time= new Date();
	var hours= time.getHours();
	var mins= time.getMinutes();
	var secs= time.getSeconds();

	curTime=hours*3600+mins*60+secs
	if(curTime>=closeTime)
		{
		document.timer.counter.value = "0 sec.";
		parent.location.href = theTarget;
		}
	else
		timeLeft();
	}

function timeLeft()
	{
	var speed=1000;

	count = closeTime-curTime;
	document.timer.counter.value = count + " sec."
	window.setTimeout("Timer()",speed)
	}

function Fensterweite()
	{
	if (window.innerWidth) { return window.innerWidth; }
	else if (document.body && document.body.offsetWidth) { return document.body.offsetWidth; }
	else { return 0; }
	}

function Fensterhoehe()
	{
	if (window.innerHeight) { return window.innerHeight; }
	else if (document.body && document.body.offsetHeight) { return document.body.offsetHeight; }
	else { return 0; }
	}

function neuAufbau()
	{
	if (Weite != Fensterweite() || Hoehe != Fensterhoehe()) location.href = location.href;
	}



//  Einblenden der Werbung bei Mausbewegung oder Tastaturbetätigung

var einmal=0;
var toOpacity=1;
var theOpacity=0.0;
var aStep=0.01;
var aSpeed=10;
var anotherID;

function SetOpacity(anID, anOpacity)
	{
	var theOpacity = anOpacity

	if (theOpacity > 1) theOpacity = 1; 
	else if (theOpacity < 0) theOpacity = 0; 
	anID.style.opacity = theOpacity;
	}

function FadeOpacity (anID)
	{
	theOpacity = parseFloat(anID.style.opacity);
	anotherID = anID;
	FadeOpacityStep ();
	}

function FadeOpacityStep ()
	{
	SetOpacity (anotherID, theOpacity);
	theOpacity = theOpacity + aStep;
	if (theOpacity > toOpacity) 
	  {
	  SetOpacity (anotherID, toOpacity);
	  }
	else 
	  setTimeout ("FadeOpacityStep();", aSpeed)
	}

function MEinblenden ()
	{
	var theID = document.getElementById ("Mueller");

	if (einmal == 0)
	  {
	  einmal = 1;
	  FadeOpacity (theID);
	  };
	}

function MAusblenden ()
	{
	var theID = document.getElementById ("Mueller");

	theID.style.opacity = 0.0;
	}



// Für EMail-Protector 1. URL: http://www.nmud.de/tools/coder2/email_protector1.html
// <!-- 1854222733
// This script is (C) Copyright 2004 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/email/ 

function forego (agility,agriculture,apartment)
{
agility += ' ';
var cleverness = agility.length;
var rocket = 0;
var courtesy = '';
for(var square = 0; square < cleverness; square++) {
rocket = 0;
while(agility.charCodeAt(square) != 32) {
rocket = rocket * 10;
rocket = rocket + agility.charCodeAt(square)-48;
square++;
}
courtesy += String.fromCharCode(light(rocket,agriculture,apartment));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+courtesy;
}

function forgive(decision,diablura,drawing) {
decision += ' ';
var time = decision.length;
var phrase = 0;
for(var history = 0; history < time; history++) {
phrase = 0;
while(decision.charCodeAt(history) != 32) {
phrase = phrase * 10;
phrase = phrase + decision.charCodeAt(history)-48;
history++;
}
//document.write('&');
//document.write('#');
//document.write(light(phrase,diablura,drawing));
document.write(String.fromCharCode(light(phrase,diablura,drawing)));
}
}

function light(incredulity,language,lottery) {
if (lottery % 2 == 0) {
magic = 1;
for(var wall = 1; wall <= lottery/2; wall++) {
movement = (incredulity*incredulity) % language;
magic = (movement*magic) % language;
}
} else {
magic = incredulity;
for(var orange = 1; orange <= lottery/2; orange++) {
movement = (incredulity*incredulity) % language;
magic = (movement*magic) % language;
}
}
return magic;
}
