$(document).ready(function(){
	setEqualHeights(".first-page .row .column .header");
	//$(".first-page .row .column").equalizeCols();
});

function setEqualHeights(selector) {
	var height = 0;
	var headers = $(selector);
	if(!$.browser.msie) {
		headers.each(function() {
			if($(this).height() > height) {
				height = $(this).height();
			}
		});
		headers.css("height", height + "px");
	}
	else
	{
		headers.each(function() {
			if(this.offsetHeight > height) {
				height = this.offsetHeight;
			}
		});
		headers.height(height);
	}
}

function search(url, box)
{
	var form = document.forms[0];
	var field = document.getElementById(box);
	if (field != null)
	{
		text = getSearchEncoded(field.value);
	}
	else
	{
		text = getSearchEncoded(form.TopSearch.value);
	}

	result = "?s=" + text;

	location.href = url + result;
}

function tsearch(evt, url, box)
{	
	if (evt && (evt.keyCode == 13 || evt.which == 13))
	{
		search(url, box);
		return false;
	}
	else
	{
		return true;
	}
}

function jump(url, jump)
{
	var form = document.forms[0];
	text = getSearchEncoded(form.Search.value);
	offset = parseInt(parseFloat(form.Offset.value)) + jump;
	
	result = "?s=" + text;
	if (offset > 0)
	{
		result += "&o=" + offset;
	}

	location.href = url + result;
}

function lnk(url)
{
	location.href = url;
}

function getSearchEncoded(search)
{
	return escape(search.replace(" ", "+"));
}