function sendForm(id)
{

	if ( document.getElementById("name").value.length < 2 )
	{
		
	    alert("Bład: brak podpisu...");
	    return false;		
		
	}
	
	if ( document.getElementById("email").value.length < 8 )
	{
		
	    alert("Bład: niepoprawny adres e-mail");
	    return false;
		
	}
	
	if ( document.getElementById("text").value.length < 10 )
	{
		
	    alert("Bład: wiadomość jest za krótka...");
	    return false;
		
	}
	
	input = document.createElement("input");
	input.type = "hidden";
	input.value = id;
	input.name = "message_send";
	document.getElementById(id).appendChild(input);
	
	document.getElementById(id).submit();
	
}

function addComment(formid, nid)
{

	if ( document.getElementById("comment_name").value.length < 2 )
	{
		
	    alert("Bład: brak podpisu...");
	    return false;		
		
	}
	
	if ( document.getElementById("comment_text").value.length < 2 )
	{
		
	    alert("Bład: komentarz nie zawiera treści...");
	    return false;		
		
	}
	
	input = document.createElement("input");
	input.type = "hidden";
	input.value = nid;
	input.name = "comment_add";
	document.getElementById(formid).appendChild(input);
	
	document.getElementById("comment_form").submit();
	
}
function adjustLayout()
{
	// Get natural heights
	var lHeight = ( document.getElementById("col-l") ) ? xHeight("col-l") : 0;
	var cHeight = ( document.getElementById("box") ) ? xHeight("box") : 0;
	var rHeight = ( document.getElementById("col-r") ) ? xHeight("col-r") : 0;

	// Find the maximum height
	var maxHeight = Math.max(lHeight, rHeight, cHeight);
	
	// Assign maximum height to all columns
	xHeight("col-l", maxHeight);
	xHeight("col-r", maxHeight);
	xHeight("col-c", maxHeight);

}

window.onload = function()
{
	xAddEventListener(window, "resize", adjustLayout, false);
	adjustLayout();
}
