if (self == top) top.location.replace('http://augenreiz.de?page=' + escape(top.location.href));

window.onError = null;

hexa = new Array(16);
for(i=0; i<10; i++) hexa[i] = i;
hexa[10]="a";
hexa[11]="b";
hexa[12]="c";
hexa[13]="d";
hexa[14]="e";
hexa[15]="f";

//--------------------------------------------------------------------------------

function initpage()
	{
	for (i=0; i<document.links.length; i++) document.links[i].id = "link" + i;
	}

//--------------------------------------------------------------------------------

function changedeco(newdeco)
	{
	if (self != top && parent.decoleft)
		{
		newdeco = "deco-" + newdeco + ".html";
		currentdeco = parent.decoleft.location.href;
		if (currentdeco.indexOf(newdeco) == -1) parent.decoleft.location.replace(newdeco);
		}
	}

//--------------------------------------------------------------------------------

function ps(stp)		// ps = play sound, stp = sound to play
	{
	if (self != top && parent.menutop && parent.menutop.document && parent.menutop.document.jukebox)
		{
		parent.menutop.document.jukebox.SetVariable('sound',stp);
		}
	}

//--------------------------------------------------------------------------------

function hex(dez)
	{
	if (dez<0) return "00";
	else if (dez> 255) return "ff";
    	else return "" + hexa[Math.floor(dez/16)] + hexa[dez%16];
	}

function setobjclr(r, g, b, obj)
	{
      var hr = hex(r);
	var hg = hex(g);
	var hb = hex(b);
	if (document.getElementById) document.getElementById(obj).style.color = "#"+hr+hg+hb;
	}

function flicker(sr, sg, sb, er, eg, eb, num, wait, obj)
	{
	num = num*2;
	for (i=0; i<num; i++)
		{
		fkt = 'setobjclr('+sr+','+sg+','+sb+',"' + obj + '");';
		setTimeout(fkt,i*wait);
		i +=1;
		fkt = 'setobjclr('+er+','+eg+','+eb+',"' + obj + '");';
		setTimeout(fkt,i*wait);
		}
	}

function fade(sr, sg, sb, er, eg, eb, step, obj)
	{
	for(i=0; i<=step; i++)
		{
		fkt = "setobjclr(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ ")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),\""+obj+"\");";
		setTimeout(fkt,i*step);
		}
	}

function fi(obj)
	{
	if (obj) { flicker(255,170,0,255,250,70,3,40,obj); }
	}

function fo(obj)
	{
	if (obj) { fade(255,250,70,255,170,0,25,obj); }
	}

function md(obj)
	{
	if (obj) { setobjclr(255, 255, 255, obj); }
	}

function mu(obj)
	{
	if (obj) { setobjclr(255, 250, 70, obj); }
	}


