function login2() {

	var form = document.getElementById('form_2');

	if(form.login.value=='' || form.login.value==null || form.pass.value=='' || form.pass.value==null || form.what.value==null) {

		alert('Wypelnij wszystkie pola, aby sie zalogowac!');
		return false;

	} else {

		return true;
	}
}

function login2_me() {

	var form = document.getElementById('form_2');
	if(login2()) {
		form.submit();
	} else {
		return false;
	}
}



function check_form(theClass)
{
	var allPageTags = new Array();
	var ok = 1;

	//Populate the array with all the page tags
	var allPageTags=document.getElementsByTagName("*");

	//Cycle through the tags using a for loop
	for (i=0; i<allPageTags.length; i++)
	{
		//Pick out the tags with our class name
		if (allPageTags[i].className==theClass)
		{
			//Manipulate this in whatever way you want
			if(allPageTags[i].value=='' || allPageTags[i].value==null)
			{
				ok = 0;
				alert('Nie wszystkie wypelnione');
				break;

			}
			/*allPageTags[i].style.display='none';*/
		}
	}

	if(ok==1)
	{
		form.submit();
	}
	else
	{
		alert('Nie wypelniles wszystkich wymaganych pól!');
		return false;
	}
}


