var RS = {
	
	onCancelClick : function (oEvent, oSource)
	{
		if (!confirm('Biztosan folytatni akarod a műveletet?'))
		{
			oEvent = Utils.Events.kill(oEvent);
		}
	},
	
	onLinkClick : function (oEvent, oSource)
	{
		oEvent = Utils.Events.kill(oEvent);
		window.open(oSource.href);
		return false;
	},

	onLoad : function (oEvent, oSource)
	{
		var buttons = Utils.Dom.getElementsByClassName('cancel');
		for (var i = 0, l = buttons.length; i != l; ++i)
		{
			Utils.Events.addListener(buttons[i], 'click', RS.onCancelClick);
		}
		var links = Utils.Dom.getElementsByClassName('new_window');
		for (var i = 0, l = links.length; i != l; ++i)
		{
			Utils.Events.addListener(links[i], 'click', RS.onLinkClick);
		}
		var jsredirects = Utils.Dom.getElementsByClassName('autoredirect');
		if (jsredirects && jsredirects.length)
			setTimeout('top.location.href = \'' + jsredirects[0].href + '\';', 4000);
	},

	init : function (c)
	{
		if (10 < ++c) return; 
		var ex;
		try
		{
			Utils.Events.addListener(window, 'load', RS.onLoad);
		}
		catch (ex)
		{
			setTimeout('RS.init(' + c + ')', 1000);
		}
	}
}

RS.init(0);

