$(document).ready(function()
{
	$("#topsearch").click(function(){
		if ($(this).val() == 'search') $(this).val('');
	});

	fixHeights();
});

$(window).load(function()
{
	fixHeights();
	//$(".eqborder").equalHeights();
	//$(".eqboxes").equalHeights();
});

var fixHeights_count = 0;
function fixHeights()
{
	var windowHeight = $(window).height();
	if ($("#maincontent").height() < windowHeight)
	{
		$("#maincontent").height(windowHeight-60);
	}
	$("#contentborder").height($("#maincontent").height());

	if (++fixHeights_count == 2)
	{
		if ($("#maincontent").height() > windowHeight)
		{
			// add a ^Back to top link
			$("#footer").before('<a id="back-to-top" class="footer-text" onclick="window.scroll(0,0); return false;" href="#">Back to top</a>');
		}
	}
}

