﻿

window.onload = function (){
	/*
	document.getElementById('spot').style.display = 'block';
	document.getElementsByTagName('body')[0].style.overflow = 'hidden';
	window.document.body.style.overflow = 'hidden';
	window.document.body.scroll = 'no';
	document.getElementById('shade').onclick = function(){
		document.getElementById('spot').style.display = 'none';
		document.getElementsByTagName('body')[0].style.overflow = 'auto';
		window.document.body.style.overflow = 'auto';
		window.document.body.scroll = 'yes';
		//fadeOut('spot', 0.000001);
		document.getElementById('spot').style.height = 0;
	}
	*/
}

function fadeOut(id, time) {
	target = document.getElementById(id);
	alpha = 100;
	timer = (time*1000)/50;
	var i = setInterval(
	function() {
		if (alpha <= 0)
			clearInterval(i);
		setAlpha(target, alpha);
		alpha -= 2;
		}, timer);
}

function fadeIn(id, time) {
	target = document.getElementById(id);
	alpha = 0;
	timer = (time*1000)/50;

	var i = setInterval(
		function() {
			if (alpha >= 100)
				clearInterval(i);
				setAlpha(target, alpha);
				alpha += 2;
			}, timer);
}

function setAlpha(target, alpha) {
	target.style.filter = "alpha(opacity="+ alpha +")";
	target.style.opacity = alpha/100;
} 
