
	function Sponsors(image11, image22, link11, link22) 
	{
		this.sponsors = new Array();
		//this.doSponsor = DoSponsor;
		this.counter = 0;
		
		this.images = new Array();
		this.images.push(image11);
		this.images.push(image22);
		
		this.links = new Array();
		this.links.push(link11);
		this.links.push(link22);
		
		//alert(this.links[0]);
		
		this.AddSponsors = function() 
		{
			this.sponsors.push(new Sponsor1("/images/sponsoren/startpage/eybl.jpg", "http://www.eybl.at"));
			this.sponsors.push(new Sponsor1("/images/sponsoren/startpage/kaiser.jpg", "http://www.kaiserbier.at"));
			this.sponsors.push(new Sponsor1("/images/sponsoren/startpage/tipp3-1.gif", "http://www.tipp3.at"));
			this.sponsors.push(new Sponsor1("/images/sponsoren/startpage/winwin.gif", "http://www.winwin.at"));
		}
		
		this.doit = function() 
		{
			alert(this.sponsors.length);
			//this.image2.src = "";
			//alert();
		}
		
		this.doSponsor = function(c)
		//Sponsors.prototype.doSponsor = function DoSponsor(c) 
		//this.StartTimer = function(s) 
		{
		    //alert("");
		    
			counter = c.counter;
			
			for (i = 0; i < c.images.length; i++) 
			{
				c.setPicture(c.images[i], c.links[i], counter, c);

				counter++;
				if (counter >= c.sponsors.length) 
					counter = 0;

				
			}
			//if (c.image1 != null)  

			c.counter++;
			if (c.counter >= c.sponsors.length) 
				c.counter = 0;

			//alert(c.counter);
			//alert(c.sponsors.length);
			setTimeout(function() { c.doSponsor(c); }, 8000);
			//setTimeout(function() { c.doSponsor(c); }, 3000);
		}
		
		Sponsors.prototype.setPicture = function SetPicture(image, link1, counter, c) 
		{	
			
			if (document.all) 
			{
				image.style.filter="blendTrans(duration=2)";
				image.style.filter="blendTrans(duration=crossFadeDuration)";
				image.filters.blendTrans.Apply();
			}
			image.src = c.sponsors[counter].image.src;
			if (document.all) 
			{
				image.filters.blendTrans.Play();
			}
			
			
			image.src = c.sponsors[counter].image.src;
		    //alert(counter + "  " + link1 + " " + image.src);
			link1.href = c.sponsors[counter].link1;
			
			var hereTd = document.getElementById(c.sponsors[counter].link1);
            //hereTd.getElementsByTagName('a')[0].href = c.sponsors[counter].link1;
		}

		this.AddSponsors();
		
		this.doSponsor(this);
		
		//alert(this.sponsors.length)
	}
	
	function Sponsor1(picture, link1) 
	{
			this.link1 = link1;
			this.RootPath = ".";

			this.image = new Image();
			this.image.src = this.RootPath + picture;
		
	}

	function Sponsor()  
	{
		
		
			//alert(path);
			
			this.RootPath = ".";
			
			this.currentcounter = 0;
		
			this.get = function() { return this.currentcounter; } 
		
			this.setPicture = SetPicture;
			this.doSponsor = DoSponsor;

		
			var showWerbung = 1
			
			this.image = null;
			this.link1 = null;
			this.header_iCounter = 0;
			var header_iStatus = 0;
			var iWindow = 0;
		
		
		}
		
		Sponsor.prototype.set1 = function() 
		{
			
			this.header_images = new Array();

			var header_link1 = new Object();

			image1 = new Image();
			image1.src = this.RootPath + "/images/sponsoren/startpage/hervis.png";

			header_link1 = new Object();
			header_link1.pic = image1;
			header_link1.link = "http://www.hervis.at";
			this.header_images[0] = header_link1;
			
			image1 = new Image();
			image1.src = this.RootPath + "/images/sponsoren/startpage/ratiopharm.png";

			header_link1 = new Object();
			header_link1.pic = image1;
			header_link1.link = "http://www.ratiopharm.at";		
			this.header_images[1] = header_link1;
			

		}

		Sponsor.prototype.set2 = function() 
		{

			this.header_images = new Array();

			var header_link1 = new Object();

			image1 = new Image();
			image1.src = this.RootPath + "/images/sponsoren/startpage/bauzone.png";
		
			header_link1 = new Object();
			header_link1.pic = image1;
			header_link1.link = "http://www.bauzone.at";
			this.header_images[0] = header_link1;
			
			image1 = new Image();
			image1.src = this.RootPath + "/images/sponsoren/startpage/kettler.png";

			header_link1 = new Object();
			header_link1.pic = image1;
			header_link1.link = "http://www.kettler.at";		
			this.header_images[1] = header_link1;
		}

		Sponsor.prototype.setTimer = function(msg) 
		{ 
			
			var myClass = msg; 
			
			/*
			function timerRelay() { 
			
				myClass.doSponsor(); 
			
				//setTimeout('timerRelay()', 5000);
			} */
			
			myClass.doSponsor(myClass);
			
			//setTimeout(funtion() 
			//setTimeout(function(msg) { msg.doSponsor(msg); }, 2000, msg);
			//alert("Starting timer"); 
			
			//setTimeout(timerRelay, 1000); 
		//timerRelay();
		
		} 


	
		//Sponsor.prototype.header_images;

		Sponsor.prototype.doSponsor = function DoSponsor(c) 
		{
			
			if (c.header_images.length <= 0) return;
										
			c.setPicture(c.header_iCounter);
	
			c.currentcounter = c.header_iCounter;
			
			c.header_iCounter++;
			if (c.header_iCounter >= c.header_images.length)
				c.header_iCounter = 0;
	
			setTimeout(function() { c.doSponsor(c); }, 3000);

		}
		
		Sponsor.prototype.setPicture = function SetPicture(c) 
		{
			if (this.header_images == null) return;
			
			
			
			if (document.all) 
			{
				this.image.style.filter="blendTrans(duration=2)";
				this.image.style.filter="blendTrans(duration=crossFadeDuration)";
				this.image.filters.blendTrans.Apply();
			}
			this.image.src = this.header_images[c].pic.src;
			if (document.all) 
			{
				this.image.filters.blendTrans.Play();
			}
			
			
			this.image.src = this.header_images[c].pic.src;
			this.link1.href = this.header_images[c].link;
			

		}
	
		Sponsor.prototype.setImage = function SetImage(c, link11) 
		{
			this.image = c;
			this.link1 = link11; 
		}
		
		Sponsor.prototype.RootPath = function(c)
		{
			this.RootPath = c;
		}

		function CurrentCounter() 
		{
			return this.currentcounter;
		}
	
