// JavaScript Document

// You can change the speed (1 == very fast)
// You can change the animation quality (1 == best)
// The more the quality of the transition is good, the more the speed decreased and must be increased
var speed = 1;
var transition = 10;

// Size of the animated gif
var GIFpreloadWidth = 42;
var GIFpreloadHeight = 50;

var timer= 0;
var opaciT = 100;

function opacity()
{
    opaciT = opaciT - transition;

    var object = document.getElementById('preloader').style;
    object.opacity = (opaciT / 100);
    object.MozOpacity = (opaciT / 100);
    object.KhtmlOpacity = (opaciT / 100);
    object.filter = "alpha(opacity=" + opaciT + ")";
       
	if (opaciT <= 0)
	{
		document.getElementById('preloader').style.visibility='hidden';
		clearInterval(timer);
	}
}
 
function preload()
{
	if (document.getElementById)
	{
		document.getElementById('preloadIMG').style.visibility='hidden';
		timer = setInterval("opacity()",speed);
	}
	
	else
	{
		if (document.layers)
		{       
			document.preloadIMG.visibility = 'hidden';
			timer = setInterval("opacity()",speed);
		}
		else
		{
			document.all.preloadIMG.style.visibility = 'hidden';
			timer = setInterval("opacity()",speed);
		}
	}
}

// GENERATE THE CSS FOR THE PRELOADER BLOCK
var myCSS;
myCSS = "<style type=\"text/css\">";

myCSS += "html, body { height:auto; margin:0px; padding:0px;}";

myCSS += "#preloader {";
myCSS += "position:fixed;";
myCSS += "background-color:white;";
myCSS += "width:100%;";
myCSS += "height:100%; ";
myCSS += "display:block;";
myCSS += "z-index:100000;";
myCSS += "}";

myCSS += "#preloadIMG {";
myCSS += "position:absolute;";
myCSS += "left:50%;";
myCSS += "width:" + GIFpreloadWidth + "px;";
myCSS += "height:" + GIFpreloadHeight + "px;";
myCSS += "margin-left:-" + (GIFpreloadWidth / 2) + "px;";
myCSS += "top:150px;";
myCSS += "font-weight:bold;";
myCSS += "}";

myCSS += "</style>";

// WRITE CSS IN THE DOCUMENT
window.document.write(myCSS);

// RUN
window.onload = function() { preload(); }