function zaloguj()
	{
		document.getElementById('login_form').submit();
		return;
	}
 
function users_browse(val)
	{
		document.getElementById('search_start').value = val;
		document.getElementById('user_search_form').submit();
		return;
	}

function testuj_fotke(obj)
	{
		if (obj.width < 11)
			{
				if (obj.width > 450) szerokosc = 450; else szerokosc=obj.width;
				obj.width = szerokosc;
			}
		return;
	}


function pokaz_zdjecie(obj, path)
	{
		if (obj.width < 11)
			{
				var myimg = new Image();
				myimg.src = path;
				var szerokosc = 0;
				if (myimg.width > 450) szerokosc = 450; else szerokosc=myimg.width;
				obj.src = path;
				obj.width = szerokosc;
			}
		return;
	}



function maksymalizuj(path)
	{
		var foto = window.open(path, 'Zdjecie');
		foto.moveTo(0, 0);
		return;
	}

function usun_galerie(path)
	{
		pytanie = confirm('czy napewno chcesz usunac ta galerie?')
		if (pytanie) parent.location.href=path;
		return;
	}

function wysylaj(formularz)
	{
		var element = document.getElementById('tag');
		if (element.value.length >= 3) document.getElementById('tag_add').submit();
		else alert('Tag musi się składać minimum z 3 znaków.');
		return;
	}

function tagsearch(path)
	{
		var tname = document.getElementById('tag_name').value;
		parent.location.href=path+tname;
		return;
	}


function register()
	{
		if (!document.getElementById('zgoda2').checked) 
			{
				alert('Nie wyrażono zgody na regulamin.');
				return;
			}
		if (document.getElementById('haslo1').value != document.getElementById('haslo2').value)
			{
				alert('Hasło nie jest identyczne z potwierdzeniem.');
				return;
			}
		if (!checkemail())
			{
				alert('Podany adres e-mail jest niepoprawny.');
				return;
			}
		alert('Na Twój adres e-mail została wysłana wiadomość z linkiem aktywacyjnym. Wejdź na pocztę i aktywuj swoje konto na UBN.pl');
		document.getElementById('regform').submit();
		return;
	}


function checkemail()
	{
		var str=document.getElementById('email').value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (filter.test(str)) testresults=true
		else testresults=false
		return (testresults)
	}




function send_abuse()
	{
		document.getElementById('ff_akcja').value="abuse";
		document.getElementById('footer_form').submit();
		return;
	}

function tell_friend()
	{
		document.getElementById('ff_akcja').value="tellfriend";
		document.getElementById('footer_form').submit();
		return;
	}


