function ajaxLink(sel,retSel,callback) {
	$(sel).click(function(){
		$.get($(this).attr('href'),function(retVal) {
			if ( $(retSel).length ) { $(retSel).html(retVal); }
			if (callback) { eval(callback); }
		})
		return false;
	});
}

function showLoginBox() {
	$('#showLoginBox').append('<span id="LBclose">X</span><div id="LBbackg" class="borderr">&nbsp;</div>');
	$('#showLoginBox').fadeIn("fast");
	$('#showLoginBox #LBclose').click(function() { $('#showLoginBox').unbind(); $('#showLoginBox').hide();});
	$('#showLoginBox #LBbackg').fadeTo("fast", 0.73);
	initAjaxForm($('#showLoginBox'));
}
function loginLinks() {
	ajaxLink('#topLoginBox a.loginLink', '#showLoginBox', 'showLoginBox();');
}

function bannerLinks() {
	$('.bannerCont a, a.bannerCont').click(function() {
//		window.open('http://www.fejermegyeportal.hu/');
//		alert('rdc.php?bin='+$(this).attr('id'));
		window.open('rdc.php?bin='+$(this).attr('id'));
		return false;
	});
}

$(document).ready(function() {
	loginLinks();
	bannerLinks();
});
