var AdPopup = function()
{
	this.to = null;
	var me = this;
	this.init = function(selector)
	{
		$(selector).children("dd").hide();
		$(selector).children("dt").click(function(){
			$(selector+" dd").hide();
			dt = $(this);
			el = $('#'+$(this).children("a").attr('rel'));
			el.css({
				'z-index': 250,
				left: dt.position().left+dt.outerWidth()-40+'px',
				top: dt.position().top+15+'px',
				width: '280px', height: 'auto',
				opacity: '0'
			});
			el.show();
			el.animate({'opacity':1},{duration: 300});
		});
		$(selector).children("dt").mouseenter(function(){
			$(selector+" dd").hide();
			dt = $(this);
			el = $('#'+$(this).children("a").attr('rel'));
			me.to = setTimeout(function(){
				if(el.css('display')=='none')
				{
					el.css({
						'z-index': 250,
						left: dt.position().left+dt.outerWidth()-40+'px',
						top: dt.position().top+15+'px',
						width: '280px', height: 'auto',
						opacity: '0'
					});
					el.show();
					el.animate({'opacity':1},{duration: 300});
				}
			}, 1000);
		});
		$(selector).children("dt").mouseleave(function(){ clearTimeout(me.to); });
	}
};
AdPopup = new AdPopup();
