function Switcher()
{
	this.interval;
	this.secondi = 1;

	this.addImage = function(src, link)
	{
		Switcher.prototype.images.push
		({
			src: new String(src),
			link: new String(link)
		});
	}

	this.swapImage = function()
	{
		document.getElementById("switcher_img").src = Switcher.prototype.images[Switcher.prototype.ind].src;
		document.getElementById("switcher_link").href = Switcher.prototype.images[Switcher.prototype.ind].link;
		Switcher.prototype.ind++;
		if (Switcher.prototype.ind >= Switcher.prototype.images.length) Switcher.prototype.ind = 0;
	}

	this.outImage = function(id)
	{
		Switcher.prototype.ind = 0;
		var contentHTML = '<a target="_blank" href="' + Switcher.prototype.images[0].link + '" id="switcher_link" name="switcher_link">';
		contentHTML += '<img src="' + Switcher.prototype.images[0].src + '" border="0" id="switcher_img" name="switcher_img" /></a>';
		document.getElementById(id).innerHTML = contentHTML;
		this.interval = setInterval(this.swapImage, parseInt(this.secondi * 1000));
	}

	this.stop = function()
	{ clearInterval(this.interval); }
}

Switcher.prototype.ind = 0;
Switcher.prototype.images = new Array();