var transicion = function(inicio, fin, segundos, divId, show) {
	var _this = this;
	this.test = 0;
	if (_this.intervalo)
		clearInterval(_this.intervalo);
	if (this.val && Math.abs(fin - _this.val) < 0.01)
		return;
	this.val = !this.val ? inicio < 1 ? inicio + .0001 : inicio : this.val;
	set_opacity(this, this.val);
	this.pasos = (fin - inicio) / 25;
	this.pausa = segundos * 10;
	this.intervalo = setInterval( function() {
		if (_this.test > 99 || Math.abs(fin - _this.val) < 0.01) {
			clearInterval(_this.intervalo);

}
_this.test++;
_this.val = _this.val + _this.pasos;
if (_this.val <= .01) {
	_this.style.display = 'none';
} else {
	_this.style.display = 'block';
	set_opacity(_this, _this.val, divId);
}
}, this.pausa);
}

function displayFloatingDiv(divId, width, height, left, top) {
	//document.getElementById(divId).style.width = width + "px";
	//document.getElementById(divId).style.height = height + "px";
	document.getElementById(divId).style.left = left + "px";
	document.getElementById(divId).style.top = top + "px";

	document.getElementById(divId).style.display="block";
	//shiftOpacityShow(divId);
}
function hiddenFloatingDiv(divId) {
	//shiftOpacityHide(divId);
	document.getElementById(divId).style.display="none";
}
function set_opacity(div, value, divId) {
	div.style.opacity = value;
	div.style.MozOpacity = value;
	div.style.KhtmlOpacity = value;
	div.style.filter = 'alpha(opacity=' + value * 100 + ')';
	div.style.zoom = 1;
}
function shiftOpacityShow(divId) {
	var obj = document.getElementById(divId);
	transicion.call(obj, 0, 1, 1, divId,1);
}
function shiftOpacityHide(divId) {
	var obj = document.getElementById(divId);
	transicion.call(obj, 1, 0, 1, divId,0);
}

