function preload_image(url) {
	var img = new Image;
	img.src = url;
}
function preload_images() {
	var images = document.getElementsByTagName('img');
	for (var i = 0; i < images.length; ++i) {
		preload_image(images[i].src);
	}

	var stylesheets = document.styleSheets;
	for (var i = 0; i < stylesheets.length; ++i) {
		var cssrules = stylesheets[i].cssRules;
		if (cssrules) 
		for (var j = 0; j < cssrules.length; ++j) {
			var style = cssrules[j].style;
			var url = style.backgroundImage;
			if (url) {
				url = /url\((.*)\)/.exec(url)[1];
				preload_image(url);
			}
		}
	}
}

function isIE()
{
	return (window.attachEvent && !window.opera);
}

function setTransparency_(val) {
	if (val == 0)
		this.style.display='none';
	else
		this.style.display='inline';
	if (isIE())
		this.style.filter = 'Alpha(opacity=' + val + ')';
	this.style.opacity = val/100;
}

function getTransparency_() {
	if (this.style.display == 'none')
	{
		this.style.opacity = 0;
		if (isIE())
			this.style.filter = 'Alpha(opacity=0)';
	}
	else if (this.style.opacity === undefined ||
	         this.style.opacity === "" ||
	         (isIE() && this.style.filter === '')) {
			this.style.opacity = 1.0;
	}
	return this.style.opacity * 100;
}

function fade_(el, from, to, step, timeout, fin)
{
	if(el.targetTransparency_ != to)
		return;
	if ((from == to) ||
	    ((from < to) && (from + step > to)) ||
	    ((from > to) && (from + step < to)))
	{
		el.setTransparency_(to);
		if (fin)
		{
			fin();
		}
		return;
	}
	el.setTransparency_(from);

	from += step;
	setTimeout(function() {
		fade_(el, from, to, step, timeout, fin);
	}, timeout);
}

window.onload = function() {
/*
	preload_images();
	document.getElementById('rdevLoader')._fx = function() {
		var steps = 20;
		this.setTransparency_ = setTransparency_;
		this.getTransparency_ = getTransparency_;
		var stepsize = (-this.getTransparency_()) / steps;
		this.targetTransparency_ = 0;
		var el=this;
		fade_(this, this.getTransparency_(), 0, stepsize, 50, null);
	}
	document.getElementById('rdevLoader')._fx();
*/
}

