var base_url = "http://www.corsario.pl/";

function checkContactForm(form)
{
    if (form.tresc.value.length<1)
    {
        alert("Nie wypełniono pola 'Treść'...");
        return false;
    }
    
    if ((form.nazwisko.value.length<1) && (form.firma.value.length<1))
    {
        alert("Proszę wypełnić pole 'Imię i nazwisko' lub pole 'Firma'...");
        return false;
    }
    
    if ((form.telefon.value.length<1) && (form.email.value.length<1))
    {
        alert("Proszę wypełnić pole 'Telefon' lub pole 'Email'...");
        return false;
    }
    
    return true;
}

function checkValueForm(form)
{
    if ((form.nazwisko.value.length<1) && (form.firma.value.length<1))
    {
        alert("Proszę wypełnić pole 'Imię i nazwisko' lub pole 'Firma'...");
        return false;
    }

    if ((form.telefon.value.length<1) && (form.email.value.length<1))
    {
        alert("Proszę wypełnić pole 'Telefon' lub pole 'Email'...");
        return false;
    }

    if (form.opis_firmy.value.length<1)
    {
        alert("Proszę opisać krótko swoją firmę/organizację ...");
        return false;
    }

    return true;
}

function lightBox_init()
{
	var groups = {};
	var groups_n = 0;
	var orig_rel = 'lightbox';
	$.each($('[@rel*='+orig_rel+']'), function(index, obj){
		var rel = $(obj).attr('rel');
		if ( rel === orig_rel )
		{
			rel = groups_n;
		}
		if ( typeof groups[rel] === 'undefined' )
		{
			groups[rel] = [];
			groups_n++;
		}
		groups[rel].push(obj);
	});
	$.each(groups, function(index, group){
		$(group).lightBox();
	});
	return true;
}

$(document).ready(function(){
	lightBox_init();
});
