$(function()
{
	$("#taxatie").validate();
	$("#registreren_post").validate();
	$("#mijn_makelaar").validate();
	$("#aankoopmakelaar").validate();
	$("#brochuremailen").validate();
	$("#brochure_post").validate();
	$("#contact").validate();
	$("#vriendkennis").validate();
	$("#hypotheekgesprek").validate();
	$("#woning").validate();
	
	
	fix_height();
	tooltip();
	$('a[rel*=lightbox]').lightBox(); 
	$('a[rel*=bottom_box]').lightBox(); 
});

function fix_height()
{
	if($.browser.msie && $.browser.version=="6.0")
	{
		$('#background').height($(document).height());
	}
	if($('#background').height() > $('#website').height())
	{
		$('#website').height($('#background').height());
	}
}

function tooltip()
{
	$('body').prepend('<div id="tooltip"></div>');
	$('.objects-2col li a').hover(function(e)
	{
		var text = $(this).find('.tooltip').text();
		$('#tooltip').html(text + ' <a href="#">Bekijk</a>');
		$(document).mousemove(function(e)
		{
			$('#tooltip').css({'left':parseInt(e.pageX)+10+'px', 'top':parseInt(e.pageY)+'px'});
		});
	}
	,function()
	{
		$(document).unbind('mousemove');
		$('#tooltip').css({'left':'-9999px', 'top':'-9999px'});
	});
}
