
var t23 = {
	params: {
		image: "",
		targetId: "",
		speed: 2500,
		delay: 5000,
		imgw: null,
		imgh: null
	},
	rand: null,
	oid: null,
	pid: null,
	ovl: null,
	img: null,
	tar: null,
	off: null,
	setParam: function(n, v) {
		eval("this.params."+escape(n)+"='"+escape(v)+"'");
	},
	init: function() {
		this.rand = new Date().getTime();
		this.oid = "overlay_" + this.rand;
		this.pid = "promo_" + this.rand;
		$(document.body).append("<div id=\"" + this.oid + "\"></div>");
		$(document.body).append("<img id=\"" + this.pid + "\" src=\"" + unescape(this.params.image) + "\">");
		this.ovl = $('#' + this.oid);
		this.img = $('#' + this.pid);
		this.tar = $('#' + this.params.targetId);
		this.off = $(this.tar).offset();
		$(this.ovl).css({
			"position": "absolute",
			"z-index": 1000,
			"left": "0px",
			"top": "0px",
			"width": "100%",
			"height": "100%",
			"background-color": "#000000",
			"opacity": 0.5
		});
		$(this.img).css({
			"position": "absolute",
			"z-index": 1010,
			"left": (($(window).width() - this.params.imgw) /2) + "px",
			"top": (($(window).height() - this.params.imgh) /2) + "px"
		});
		setTimeout(function() {
			t23.tween();
		}, this.params.delay);
	},
	tween: function() {
		$(this.img).animate({
			"left": this.off.left + "px",
			"top": this.off.top + "px",
			"width": $(this.tar).width() + "px",
			"height": $(this.tar).height() + "px"
		}, parseInt(t23.params.speed), "easeOutQuart", function() {
			$(this).remove();
		});
		$(this.ovl).animate({
			"opacity": 0
		}, parseInt(this.params.speed), "easeOutQuart", function() {
			$(this).remove();
		});
	}
};
