// JavaScript Document
/*credits: Andrés Fernández*/
var FADE={
	_fade:function(inicio,fin,el,milisegundos){
		var _this=this;
		var t=new Transition(SineCurve, milisegundos, function(percentage) {
			if(fin<inicio){
				var delta=inicio-fin;
				_this.set_opacity(el,(inicio-(percentage*delta)));
			}
			else{
				var delta=fin-inicio;
				_this.set_opacity(el,(inicio+(percentage*delta)));
			}
			});
		t.run();
		return this;
	},
	set_opacity:function (div, value) {
  		div.style.opacity = value;
		div.style.MozOpacity = value;
		div.style.KhtmlOpacity = value;
		div.style.filter = 'alpha(opacity=' + value*100 + ')';
		div.style.zoom=1;//necesario para Explorer
	}
}
panino.add(FADE);
function fadeOpacity(inicio,fin,id,milisegundos){
	$(id)._fade(inicio,fin,$(id),milisegundos);
}
