var halt = 0;
var speed=8000;
var position=0;
var timer =  setTimeout("showdia();",speed);

function checkSize () {
if (screen.width<1100){
	document.getElementById("svo").style.left = "-40px";
	}
}

function showdia () {
	if(halt == 0){
		if (!(document.images)) {return;}
		if (!(document.show)) {return;}		
		position=position+1; 
		if (position == pictures.length) { position = 0; }
		document.show.src=pictures[position];
  		if (navigator.appName=="Microsoft Internet Explorer"){
			window.setTimeout("changeSlash(document.show.width)",200);
		}else{
			changeSlash(document.show.width);
		}
		timer =  setTimeout("showdia();",speed);		

	}else{
		clearTimeout(timer); 
	}
}


function neXt () {
		clearTimeout(timer);
		position++;
		if (position == pictures.length) { position = 0; }
		document.show.src=pictures[position];
  		if (navigator.appName=="Microsoft Internet Explorer"){
			window.setTimeout("changeSlash(document.show.width)",200);
		}else{
			changeSlash(document.show.width);
		}
		timer =  setTimeout("showdia();",speed);
}

function changeSlash (bildBreite) {

	// zufallom position tape
	bottom_left = zufall(250, bildBreite-13); // -10 to width
	top_left = zufall(10, bildBreite-13); // -10 to width
	right_top = zufall(70, 440);// -70 to -440
	left_top = zufall(70, 440);// -70 to -440
//	left_top = zufall(90, 300);// -90 to -500
	right_left = bildBreite-13;	
	document.getElementById("tape_1").style.left = bottom_left+"px";
	document.getElementById("tape_2").style.top = "-"+right_top+"px";
 	document.getElementById("tape_2").style.left = right_left+"px";	
	document.getElementById("tape_3").style.top = "-"+left_top+"px";
}

function BlurLinks(){
//checkSize();
// Text- u. Grafik-Links
lnks=document.getElementsByTagName('a');
for(i=0;i<lnks.length;i++){
lnks[i].onfocus=new Function("this.blur()");
}

// ImageMaps -optional-
lnks=document.getElementsByTagName('area');
for(i=0;i<lnks.length;i++){
lnks[i].onfocus=new Function("this.blur()");
}

// Klick-Buttons -optional-
lnks=document.getElementsByName('Verweis');
for(i=0;i<lnks.length;i++){
lnks[i].onfocus=new Function("this.blur()");
}
}

onload=BlurLinks;

  // JS function for uncrypting spam-protected emails:
  // JS function for uncrypting spam-protected emails:

  // JS function for uncrypting spam-protected emails:
function UnCryptMailto(s) {	//
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(1));
	}
	return r;
}
  // JS function for uncrypting spam-protected emails:
function linkTo_UnCryptMailto(s)	{	//
	location.href=UnCryptMailto(s);
}	
  // JS function for uncrypting spam-protected emails:
  
  
function msieversion()
{
  var ua = window.navigator.userAgent
  var msie = ua.indexOf ( "MSIE " )

  if ( msie > 0 )      // If Internet Explorer, return version number
	 return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
  else                 // If another browser, return 0
	 return 0

}


function greenTape(){
if(msieversion() >= 6 ){

}else{
	document.images[0].src="iso/img/slash_g.gif";
	document.images[2].src="iso/img/tape_g.png";
	document.images[3].src="iso/img/tape_g.png";
	document.images[4].src="iso/img/tape_g.png";
}
}

function blackTape(){
if(msieversion() >= 6 ){

}else{
	document.images[0].src="iso/img/slash.gif";
	document.images[2].src="iso/img/tape.png";
	document.images[3].src="iso/img/tape.png";
	document.images[4].src="iso/img/tape.png";
}
} 

function zufall(aa, bb) {   
  var zz;                         /* Ergebnisvariable */
  aa=Math.round(aa);
  bb=Math.round(bb);
  zz=aa;                          /* mindestens aa als Ergebnis zurückgeben */
  if(bb>aa){
    zz = aa + Math.floor(Math.random() * (bb+1-aa) );
  }
  return zz;                      /* Ergebnis zurückgeben */
}
