function goToURL(id)
{
	box = document.getElementById(id);
	destination = box.options[box.selectedIndex].value;
	if (destination.length > 7)
	{
		location.href = destination;
	}
}

function showPic( url, width, height )
{

	window.open( url, 'showPic', 'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,top=50,left=50' );

}

function writeIrcNick()
{

	document.getElementById("ircnick").value = document.getElementById("ircnick").value.replace(new RegExp("[^a-z_0-9\-]{1,}", "gi"), '');

}

function ircConnectSubmit()
{
	
	if ( document.getElementById("ircnick").value.length == 0 )
	{
		
	    alert("Błąd: zapomniałeś wpisać nicka!");
	    return false;		
		
	}
	
	window.open('http://czat.slowosportowe.pl/applet.php?chatuser='+ document.getElementById("ircnick").value, 'chat', 'width=625,height=400,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,top=50,left=50' );
	
}

function sendMessage()
{
	
	if ( document.getElementById("msg_title").value.length < 2 )
	{
		
	    alert("Bład: pole z tytułem wiadomości jest puste!");
	    return false;		
		
	}
	
	if ( document.getElementById("msg_name").value.length < 2 )
	{
		
	    alert("Bład: pole z tytułem wiadomości jest puste!");
	    return false;		
		
	}
	
	if ( document.getElementById("msg_email").value.indexOf('@', 0) == -1 ) 
	{
	   
		alert("Błąd: niepoprawny adres poczty elektronicznej!");
		return false;
	}
	
	if ( document.getElementById("msg_text").value.length < 2 )
	{
		
	    alert("Bład: pole z wiadomością jest za krótkie!");
	    return false;		
		
	}
	
	document.getElementById("message").submit();

}

function newsletter($type)
{

	if ( document.getElementById("nl_email").value.indexOf('@', 0) == -1 ) 
	{
	   
		alert("Błąd: niepoprawny adres poczty elektronicznej!");
		return false;
	}
	
	document.getElementById("nl_type").value = $type;
	document.getElementById("newsletter").submit();
	
}