function confirmLink(theLink, theSqlQuery)
{
    if (typeof(window.opera) != 'undefined') {
        return true;
    }
    var is_confirmed = confirm(theSqlQuery);

    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }
    return is_confirmed;
}
function validate(form)
{
    reg = /^[a-zA-ZąćęłńóśżźĄĆĘŁŃÓŚŻŹ \.\-\_]{3,30}$/;
    wyn = form.imie.value.match(reg);
    if (wyn == null) {
        alert("Proszę podać poprawne imię i nazwisko. " +
            "Pole to musi zawierać od 3 do 30 liter. " +
            "Żadne znaki poza literami nie są dozwolone.");
        return false;
    }

    wyn = form.temat.value.match(reg);
    if (wyn == null) {
        alert("Proszę podać poprawny temat. " +
            "Pole to musi zawierać od 3 do 30 liter. " +
            "Żadne znaki poza literami nie są dozwolone.");
        return false;
    }

    if (!form.tresc.value) {
        alert("Proszę podać treść wiadomości.");
        return false;
    }

    reg = /^[a-zA-Z0-9ąćęłńóśżźĄĆĘŁŃÓŚŻŹ\.\-\_]+\@[a-zA-Z0-99ąćęłńóśżźĄĆĘŁŃÓŚŻŹ\.\-\_]+\.[a-z]{2,4}$/;
    wyn = form.mail.value.match(reg);
    if (wyn == null) {
        alert("Proszę podać poprawny adres email. " +
            "Poprawny adres musi zawierać małpę " +
            "oraz co najmniej dwa człony nazwy serwera, " +
            "np. a@b.c lub ala@ma.kota.czarnego.com.");
        return false;
    }

    return true;
}


// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.display = 'none';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.display = 'block';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.display = 'none';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
