function get(id) 
{
	if (document.getElementById(id)) 
	{
		return document.getElementById(id);
	}
	return false;
}

function PutFlash(src,name,width,height)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'" style="margin: 0px;">');
	document.write('<param name="movie" value="'+src+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="menu" value="false">');
    document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="'+src+'" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" style="margin: 0px;" type="application/x-shockwave-flash" name="'+name+'" width="'+width+'" height="'+height+'"></embed>');
	document.write('</object>');
}

function IsEmail(str)
{
    reg  = /^(([\da-zA-Z\-_\.]+)@([\da-zA-Z_\-]+).([\da-zA-Z_\-]{2,})){0,1}$/;
    if (reg.test(str)) return true; else return false;
} 


function validate_form(thisform)
{
    with (thisform)
    {
        if (tresc.value==null||tresc.value=='')
        {
            tresc.focus();
            alert("Podaj treść wiadomości!");
            return false;
        }
        else if (imie.value==null||imie.value=='')
        {
            imie.focus();
            alert("Podaj swoje imię i nazwisko!");
            return false;
        }
        else if (temat.value==null||temat.value=='')
        {
            temat.focus();
            alert("Podaj stemat wiadomości!");
            return false;
        }
        else if ((!(mail.value==null||mail.value==''))&&(IsEmail(mail.value)==false))
        {
            alert("Podałeś niepoprawny adres e-mail!");
            mail.focus();
            return false;
        }
    }
}
