$(document).ready(function(){
	$("#main .box:eq(0), #main .box:eq(1), #main .box:eq(2)").equalizeCols();
	$("#main .box:eq(2) ~ .box").equalizeCols();
	$(".cols fieldset:eq(0), .cols fieldset:eq(1)").equalizeCols();
	$("#content-normal, #content-right").equalizeCols();
	
	$(".tab-nav").idTabs("pane"); 
	$("tr:nth-child(odd)").addClass("odd");

	$('dd:has(.error)').find('input, select, textarea').addClass('error');

	$('#recaptcha_response_field').change(function(){
		var value = $(this).val();
		$('#tx-srfeuserregister-pi1-tx_bonartisttoday_recaptcha').val(value);
	})

	$('.irfaq dt').bind('click',function(){
		$(this).toggleClass('act').next().stop(1,1).slideToggle(function(){
			$("#content-normal, #content-right").equalizeCols();
		});
	});

	$('.irfaq-showAll').click(function(){
		$(this).parent().next().find('dt').addClass('act').next().stop(1,1).slideDown(function(){
			$("#content-normal, #content-right").equalizeCols();
		});
		
		return false;
	});

	$('.irfaq-hideAll').click(function(){
		$(this).parent().next().find('dt').removeClass('act').next().stop(1,1).slideUp(function(){
			$("#content-normal, #content-right").equalizeCols();
		});
		
		return false;
	});

	tooltip('dfn.tooltip');

});

$(window).load(function(){
	
});

/* Shows any content on hover above cursor poiner */
function tooltip(el){
	var xOffset = 15;
	var yOffset = 20;
	
	$(el).unbind().hover(function(e){
		this.t = this.title;
		this.title = '';
		this.pos = $(this).position();
		this.top = this.pos.top + yOffset;
		this.left = this.pos.left + xOffset;
		
		$('body').append('<div id="tooltip"><span>' + this.t + '</span></div>');
		$('#tooltip').css('top', this.top + 'px').css('left', this.left + 'px').fadeIn(150);
		
	}, function(){
		this.title = this.t;
		$('#tooltip').fadeOut(100,function(){$(this).remove();});
	});
};

