function validateform(formname) {
	for(var i=0; i<fields.length; i++) {
		if (document.forms[formname].elements[fields[i]].value == '') {
			alert(fields_info[i]);
			document.forms[formname].elements[fields[i]].focus();
			return false;
		}
	}
	return true;
}

function polecam(type, id)
{
	$("#art-polecam-info").load("actions.php?action=polecam&type="+type+"&id="+id, '', function() {$("#art-polecam-info-vote").load("actions.php?action=polecam-vote&id="+id);});
}

$(document).ready(
	function()
	{
		// lightbox
		$('a[@rel*=lightbox]').lightBox();
		$('a[@rel*=szrama]').lightBox();

		// komentarze, forum, kontakt
		$("#bx_btn_1a").click(
		function()
		{
			$(this).addClass("active");
			$("#bx_btn_1b").removeClass("active");
			$("#bx_btn_1c").removeClass("active");
			$("#bx_1a").show();
			$("#bx_1b").hide();
			$("#bx_1c").hide();
		});
		$("#bx_btn_1b").click(
		function()
		{
			$("#bx_btn_1a").removeClass("active");
			$(this).addClass("active");
			$("#bx_btn_1c").removeClass("active");
			$("#bx_1a").hide();
			$("#bx_1b").show();
			$("#bx_1c").hide();
		});
		$("#bx_btn_1c").click(
		function()
		{
			$("#bx_btn_1a").removeClass("active");
			$("#bx_btn_1b").removeClass("active");
			$(this).addClass("active");
			$("#bx_1a").hide();
			$("#bx_1b").hide();
			$("#bx_1c").show();
		});
		$("#bx_1a").show();
		$("#bx_1b").hide();
		$("#bx_1c").hide();

		// newsy najnowsze, najważniejsze, najczęściej czytane
		$("#gazeta_btn_last").click(
		function()
		{
			$(this).addClass("active");
			$("#gazeta_btn_important").removeClass("active");
			$("#gazeta_btn_best").removeClass("active");
			$("#gazeta_last").show();
			$("#gazeta_important").hide();
			$("#gazeta_best").hide();
		});
		$("#gazeta_btn_important").click(
		function()
		{
			$("#gazeta_btn_last").removeClass("active");
			$(this).addClass("active");
			$("#gazeta_btn_best").removeClass("active");
			$("#gazeta_last").hide();
			$("#gazeta_important").show();
			$("#gazeta_best").hide();
		});
		$("#gazeta_btn_best").click(
		function()
		{
			$("#gazeta_btn_last").removeClass("active");
			$("#gazeta_btn_important").removeClass("active");
			$(this).addClass("active");
			$("#gazeta_last").hide();
			$("#gazeta_important").hide();
			$("#gazeta_best").show();
		});
		$("#gazeta_last").show();
		$("#gazeta_important").hide();
		$("#gazeta_best").hide();
	});