//============
//  TEventos
//============

TEventos.prototype._Evento = null;


TEventos.prototype.Origen = function ()
{
	if (this._Evento.srcElement) return (this._Evento.srcElement);
	return (this._Evento.currentTarget);
}


function TEventos (Evento)
{
	if (window.event) this._Evento = window.event;
	else this._Evento = Evento;
}


function TEvento ()
{
	if (window.event) return (new TEventos (null));
	return (new TEventos (this.TEvento.caller.arguments [0]));
}	


//=============
//  Funciones


function SinImagen (event, sImagen)
{
	var oImg = TEvento ().Origen ();
	if (typeof (sImagen) != 'string') alert ('SinImagen: tiene que indicar una imagén.');
	if (oImg && oImg.src && oImg.src.substr (oImg.src.length - sImagen.length) != sImagen) oImg.src = sImagen;
}


//==============================================================
//==============================================================


TEventos.prototype.Detener = function ()
{
	if (window.event) this._Evento.cancelBubble = true;
	else this._Evento.stopPropagation ();
}


TEventos.prototype.Cancelar = function ()
{
	if (window.event) this._Evento.returnValue = false;
	else this._Evento.preventDefault ();
}


TEventos.prototype.PosY = function ()
{
//document.body.scrollTop
	if (this._Evento.pageY) return this._Evento.pageY;
	return this._Evento.clientY;
}

TEventos.prototype.PosX = function ()
{
//document.body.scrollTop
	if (this._Evento.pageX) return this._Evento.pageX;
	return this._Evento.clientX;
}

