

//================== Dieses Script unterliegt dem Copyright 2011 des Authors von www.hwiez.de
//================== eine freie Nutzung ist nur mit dessen Erlaubnis moeglich. 

function Attentione() {
	var defs = {
			//--------------------- ...
		old1Id		: "old1",
		old2Id		: "old2",
		old3Id		: "old3",
		bigboxId	: "bigbox",
			//--------------------- dia, walker
		stopgoId	: "ausein",
		diaspeed	: 2000,
		diaId		: "dias",
		diaindId	: "diaind",
		newsId		: "news",
		bildleId	: "bildle",
		
		naalso	: function () {
			my.bildlink();
			//window.setTimeout(my.lauftext,2000);
			window.setTimeout(my.magbox,2000);
			window.setTimeout(my.linkers,3000);
		}
	};
	var my = this;
	
	window.onload = function () {
		defs.naalso();
	};
	
			//-------------------------- diashow
	this.magbox = function() {
		if (document.getElementById(defs.diaId)) {
			this.diabox = document.getElementById(defs.diaId);
			this.dianum = diabox.getElementsByTagName('p').length;
			my.diashow();
		}
		if (document.getElementById(defs.diaindId)) {
			this.diabox = document.getElementById(defs.diaindId);
			this.dianum = diabox.getElementsByTagName('p').length;
			my.diashow();
		}
		else { this.diabox == false; }
	};
	
	var num = 0;
	var iemax = 100;
	var omax = 1;
	var opa = 0;
	var ieopa = 0;
	
	this.diashow = function() {
		this.aktdia = diabox.getElementsByTagName('p')[num];
		this.aktdia.style.visibility = 'visible';
		if (navigator.userAgent.match(/MSIE/)) { 
			this.aktdia.style.filter = "alpha(opacity="+ ieopa +")";	
		}
		else {
			this.aktdia.style.opacity = opa;
		}
//		this.aktdia.style.cursor = 'pointer';
			if (ieopa < iemax) {
				ieopa += 5;
				opa += 1/20;
				aktiv = window.setTimeout(my.diashow, 20);
			}
			else { aktiv = window.setTimeout(my.hallo, defs.diaspeed); }	
	};
	
	this.hallo = function() {
		this.aktdia.style.visibility = 'hidden';
			ieopa = 0;
			opa = 0;
			num++;
		//	alert(num);
			if (document.getElementById(defs.diaindId) && num >= 2) {
				diabox.style.width = '237px'; 
				diabox.style.height = '177px'; 
				diabox.style.background = 'url(./images/holiday.gif)';
			}
			if (document.getElementById(defs.diaindId) && num >= 7) {
				diabox.style.width = '200px'; 
				diabox.style.height = '150px'; 
				diabox.style.background = 'url(./images/greleft.jpg)';
			}
			if (num > dianum -1) { num = 0; }
		my.diashow();
	}
// ----------------------------------------- pause, play
	this.stopgo = function(ja) {
	 if (ja == 0) { 
		ind = 1;
		this.plumin = document.getElementById(defs.stopgoId);
		this.icole = this.plumin.getElementsByTagName('img')[ind];
		this.icole.style.display = 'block';
		this.icole.onclick = function () { my.stopgo(1); }
		window.clearTimeout(aktiv);
		}
	 else if (ja == 1) {
		this.icole.style.display = 'none';
		ind = 0;
		aktiv = window.setTimeout(my.hallo, 1000);
	   }
	};

	var ind = 0;
	this.linkers = function () {
	  if (document.getElementById(defs.stopgoId)) {
		this.plumin = document.getElementById(defs.stopgoId);
		this.icole = this.plumin.getElementsByTagName('img')[ind];
		this.icole.style.display = 'block';
		this.icole.onclick = function () { my.stopgo(0); }
	  }
	  else { this.plumin == false; }
	};

	//----------------- zoom
	this.bildlink = function () {
	  if (document.getElementById(defs.old1Id)) {
		this.bild1 = document.getElementById(defs.old1Id);
		this.bild1.onclick = function () { my.bigBild(0); }
		this.bild2 = document.getElementById(defs.old2Id);
		this.bild2.onclick = function () { my.bigBild(1); }
		this.bild3 = document.getElementById(defs.old3Id);
		this.bild3.onclick = function () { my.bigBild(2); }
	  }
	};
//----------------------------------- here starts se zoom
	
	var bigopa = 0;
	var bigieopa = 0;
	
	this.bigBild = function(bnum) {
		var bnum;
		bildbox = document.getElementById(defs.bigboxId);
		bild = bildbox.getElementsByTagName('img')[bnum];
		bild.style.display = "block";
		if (navigator.userAgent.match(/MSIE/)) { 
			bild.style.filter = "alpha(opacity="+ bigieopa +")";	
		}
		else { 
			bild.style.opacity = bigopa;
		}
		if (bigieopa < iemax ) {
			bigieopa += 5;
			bigopa += 1/20;
			window.setTimeout( function() { my.bigBild(bnum); }, 10);
		}
		else {
			bild.onclick = function() { my.minBild(bnum); }
			bigie = bigieopa;
			bigo = bigopa;
	   }
/*
*/
	};
	var iemin = 5;

	this.minBild = function(bnum) {
		var bnum;
		if (navigator.userAgent.match(/MSIE/)) { 
			bild.style.filter = "alpha(opacity="+ bigie +")";	
		}
		else {
			bild.style.opacity = bigo;
		}
		if (bigie > iemin) {
			bigie -= 5;
			bigo -= .05
			window.setTimeout( function() { my.minBild(bnum); }, 10);
		}
		else {
			bigieopa = bigie;
			bigopa = bigo;
			bild.style.display = 'none';
		}
	};
/*
*/
	
			//-------------------------- lauftext
	var lx = 260;        
	var x = 260;        
	var toto = -450;
	var fatza = 1;
	var mig = 20;  
	var kue;
	this.lauftext = function () {
		if (document.getElementById(defs.newsId)) {
			this.newser = document.getElementById(defs.newsId);
			this.newser.style.left = x +"px"; 
			if (x > toto){
				x -= fatza;
				kue = window.setTimeout(my.lauftext,mig);
			}
			else {
				x = lx;
				kue = window.setTimeout(my.lauftext,mig);
			}
		my.walk();
		}
	};
	this.walk = function () {
		this.lauf = document.getElementById(defs.bildleId);
		this.lauf.onmouseover = function () {
			my.quatsch(1); 
		}
		this.lauf.onmouseout = function () {
			my.quatsch(0); 
		}
	};
	/*

	*/
	this.quatsch = function (aua){
		if (aua == 1) { fatza = 0; 
		}
		else { fatza = 1 ; 
		}
	};
	
}
var mioAttentione = new Attentione();




