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 ResetForm(nr)
{
	switch(nr)
	{
		case 1:
			if (document.forms['kontakt'].tresc.value=='Tu wpisz treść wiadomości..')
			{
				document.forms['kontakt'].tresc.value='';
			}			
			break
		case 2:
			if (document.forms['kontakt'].mail.value=='Adres e-mail')
			{
				document.forms['kontakt'].mail.value='';
			}
			break
		case 3:
			if (document.forms['kontakt'].imie.value=='Imię i nazwisko')
			{
				document.forms['kontakt'].imie.value='';
			}
			break
	}
}


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.value=='Tu wpisz treść wiadomości..')
        {
            tresc.focus();
            alert("Podaj treść wiadomości!");
            return false;
        }
        else if ((!(mail.value==null||mail.value==''||mail.value=='Adres e-mail'))&&(IsEmail(mail.value)==false))
        {
            alert("Podaleś niepoprawny adres e-mail!");
            mail.focus();
            return false;
        }
    }
}