function seLoader(imgRoot)
{
	this.root = imgRoot||''
	this.runAt = 0
	this.preImg = new Array()
	this.done = 0
	this.f = 0
	this.ictr = 0
	this.to = 0
	eval(this.obj + '=this')
}

seLoader.prototype.runAtEnd = function(fct)
{ this.runAt = fct }

seLoader.prototype.setImgs = function()
{ this.imgs = arguments }

seLoader.prototype.load = function()
{
	this.loadTxt = document.getElementById('seLoadTxt')
	this.gfx = document.getElementById('loadgfx')

	for(i=0;(this.imgs[i]);i++)
	{
		this.preImg[i] = new Image()
		this.preImg[i].src = this.imgs[i].indexOf('http')==-1 ? this.root + this.imgs[i] : this.imgs[i]
	}
	this.checkLoad()
}
seLoader.prototype.drawLoader = function(preTxt)
{
	this.startTxt = preTxt ? preTxt : ''
	document.writeln('<div id="seLoader"><div id="seLoadTxt">' + (this.startTxt!=''?this.startTxt:' 0%') + '</div></div>')
}
seLoader.prototype.checkLoad = function()
{
	status = ''
	for(i in this.preImg)
	{
		if(this.preImg[i].complete)
		{
			this.f = new Number(i)
			this.f++
			this.ictr = Math.round(this.f/this.preImg.length*100)
			if (this.gfx.style.MozOpacity)
				this.gfx.style.MozOpacity = this.ictr
			else if (this.gfx.filters)
				this.gfx.filters.alpha.opacity = this.ictr
			this.loadTxt.innerHTML = new String(this.startTxt + this.ictr + '%')
		}
	}
	if(this.f!=this.preImg.length)
	{
		clearTimeout(this.to)
		this.to = setTimeout(this.obj+'.checkLoad()',20)
	}
	else
	{
		status = this.imgs.length + ' images loaded.'
		if(this.runAt) eval(this.runAt)
	}
}