window.onError = null;

for (i=0; i<document.links.length; i++) document.links[i].id = "link" + i;

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);
		}
	}

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 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(220,150,80,220,200,80,3,40,obj); }
	//if (obj) { flicker(220,150,80,255,250,70,3,40,obj); }
	//if (obj) { flicker(100,85,54,255,250,70,3,40,obj); }
	}

function fo(obj){if (obj) { fade(220,200,80,220,150,80,25,obj); }
	//if (obj) { fade(255,250,70,220,150,80,25,obj); }
	//if (obj) { fade(255,250,70,100,85,54,25,obj); }
	}


