function reshadow()
{
	var upper = document.getElementById( 'upper-shadow' );
	var lower = document.getElementById( 'lower-shadow' );
	var kosossz = document.getElementById( 'kosar-ossz' );
	var main = document.getElementById( 'main' );
	if ( upper && lower && main )
	{
		var x = globalOffsetLeft( main );
		var y = globalOffsetTop( main );
		var width = main.clientWidth;
		var height = parseInt( main.style.height );
		upper.style.top = (y + 1) + 'px';
		upper.style.left = x + 'px';
		upper.style.width = width + 'px';
		lower.style.top = (y + height + 8) + 'px';
		lower.style.left = x + 'px';
		lower.style.width = width + 'px';
		kosossz.style.display = 'block';
		kosossz.style.top = y + 5 + 'px';
		kosossz.style.right = x + 10 + 'px'; 
	}
}

function championships()
{
	var self = this;
	this.speed = 0.035;
	this.pictures = new Array
	(
		'World%20%2blogo%20kicsi.jpg', new Array
			(
	  			'logo_international_small.gif',
	  			'logo_master_series_small.gif',
	  			'logo_pro_tour_small.gif',
//	  			'logo_world_championship_series_small.gif',
	  			'logo_world_championships_small.gif',
	  			'logo_world_cup_small.gif'
	  		),
		'Master%2blogo%20kicsi%20.jpg', new Array('logo_international_small.gif','logo_master_series_small.gif','logo_pro_tour_small.gif'),
	  	'Pro%2blogo%20kicsi.jpg', new Array('logo_pro_tour_small.gif')
	);
	this.links = new Array
	(
		'World%20%2blogo%20kicsi.jpg', 'main.php?oldal=termek&id=86&nyelv=' + nyelv + '&penznem=' + penznem,
		'Master%2blogo%20kicsi%20.jpg', 'main.php?oldal=termek&id=49&nyelv=' + nyelv + '&penznem=' + penznem,
		'Pro%2blogo%20kicsi.jpg', 'main.php?oldal=termek&id=32&nyelv=' + nyelv + '&penznem=' + penznem
	);
	this.main = document.getElementById('main');
	var positionX = globalOffsetLeft(this.main) + this.main.offsetWidth + 17;
	this.pictured = document.createElement('div');
	this.pictured.style.cssText = 'text-align: center; position: absolute; display: block; width: 180px; height: 120px; margin: 0px; left: ' + positionX + 'px; top: ' + (globalOffsetTop(this.main) + this.main.clientHeight - 280) + 'px;';
	this.link = document.createElement('a');
	this.picture = document.createElement('img');
	this.picture.width = 176;
	this.picture.height = 157;
	this.picture.style.cssText = 'border: 2px solid #666666; filter:alpha(opacity=100);';
	this.pictured.appendChild(this.link);
	this.link.appendChild(this.picture);
	this.bannerd = document.createElement('div');
	this.bannerd.style.cssText = 'text-align: center; position: absolute; display: block; width: 180px; height: 60px; margin: 0px; left: ' + positionX + 'px; top: ' + (globalOffsetTop(this.main) + this.main.clientHeight - 100) + 'px;';
	this.banner = document.createElement('img');
	this.banner.width = 178;
	this.banner.height = 55;
	this.banner.style.cssText = 'border: 1px solid #444444; filter:alpha(opacity=100);';
	this.bannerd.appendChild(this.banner);
	this.picture.style.opacity = 0.0;
	this.banner.style.opacity = 0.0;
	setOpacity(this.picture, 0.0);
	setOpacity(this.banner, 0.0);
	this.appear = function(element, onfinished)
	{
		var opacity = getOpacity(element);
		if (opacity < 1.0)
		{
			setOpacity(element, opacity + this.speed);
			setTimeout(function() { self.appear(element, onfinished); }, 100);
		}
		else if (onfinished) setTimeout(onfinished, 500); 
	}
	this.disappear = function(element, onfinished)
	{
		var opacity = getOpacity(element);
		if (opacity > 0.0)
		{
			setOpacity(element, opacity - this.speed);
			setTimeout(function() { self.disappear(element, onfinished); }, 100);
		}
		else if (onfinished) onfinished();
	}
	document.body.appendChild(this.pictured);
	document.body.appendChild(this.bannerd);
	this.loop = function(i, j)
	{
		var ii = i;
		var jj = j + 1;
		if (jj >= this.pictures[ii*2+1].length)
		{
			jj = 0;
			++ii;
			if (ii * 2 >= this.pictures.length) ii = 0;
			setTimeout(function()
			{
				self.disappear(self.picture, function()
				{
					self.picture.src = sablonpath + 'k%C3%A9pek/' + self.pictures[ii*2];
					self.link.href = self.links[ii*2+1]; 
					self.appear(self.picture);
				});
			}, 0);
		}
		setTimeout(function()
		{
			self.disappear(self.banner, function()
			{
				self.banner.src = sablonpath + 'k%C3%A9pek/' + self.pictures[ii*2+1][jj];
				self.appear(self.banner, function() { self.loop(ii, jj); });
			});
		}, 0);
	}
	this.startLoop = function()
	{
		this.picture.src = sablonpath + 'k%C3%A9pek/' + self.pictures[0];
		self.link.href = self.links[1];
		//alert(self.picture.style.backgroundImage + ' ? ' + ('url(' + sablonpath + 'k%C3%A9pek/' + self.pictures[0] + ')'));
		this.appear(this.picture);
		this.loop(0,0);
	}
}