
		function valid_form1()
		{
			var arr = new Array(10);
			var errorsCount = 0;
		
			//el = document.getElementById('WithoutWantInvoice');
			/*
			if(el.checked == true)
			{
				if(document.getElementById('WithoutbusinessName').value == "")
				{
					showErrorMessage('without_business_name_message','Imię nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('WithoutbusinessSurname').value == "")
				{
					showErrorMessage('without_business_surname_message','Nazwisko nie może być puste');
					errorsCount++;
				}
//				if(document.getElementById('WithoutbusinessNip').value == "")
//				{
//					showErrorMessage('without_business_nip_message','Pole NIP nie może być puste');
//					errorsCount++;
//				}
				if(document.getElementById('WithoutBusinessAddress1').value == "")
				{
					showErrorMessage('without_business_address1_message','Proszę podać ulicę');
					errorsCount++;
				}
				if(document.getElementById('WithoutbusinessPostCode').value == "")
				{
					showErrorMessage('without_business_postcode_message','Pole kod pocztowy nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('WithoutbusinessCity').value == "")
				{
					showErrorMessage('without_business_city_message','Proszę podać nazwę miejscowości');
					errorsCount++;
				}
				if(document.getElementById('WithoutBusinessInfo').value == "")
				{
					showErrorMessage('without_business_info_message','Proszę podać dane firmy');
					errorsCount++;
				}
				
			} else {
			*/
				if(document.getElementById('WithoutpersonalName').value == "")
				{
					showErrorMessage('without_personal_name_message','Pole imię nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('WithoutpersonalSurname').value == "")
				{
					showErrorMessage('without_personal_surname_message','Pole nazwisko nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('WithoutPersonalAddress1').value == "")
				{
					showErrorMessage('without_personal_address1_message','Proszę podać ulicę');
					errorsCount++;
				}
				if(document.getElementById('WithoutpersonalPostCode').value == "")
				{
					showErrorMessage('without_personal_postcode_message','Pole kod pocztowy nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('WithoutpersonalCity').value == "")
				{
					showErrorMessage('without_personal_city_message','Proszę podać nazwę miejscowości');
					errorsCount++;
				}	
			//}

			if(errorsCount==0)
				return true;
			else
				return false;

		}
		
		function check_form1()
		{
			form1_hideAll();
		
			var status = valid_form1();		
			if(status == true)
			{
				el = document.getElementById('form1_without');
				el.submit();
			}
		}
		
		function form1_hideAll()
		{
			hideElement('without_personal_name_message');
			hideElement('without_personal_surname_message');
			hideElement('without_personal_address1_message');
			hideElement('without_personal_city_message');
			hideElement('without_personal_postcode_message');
			hideElement('without_business_name_message');
			hideElement('without_business_surname_message');
			hideElement('without_business_address1_message');
			hideElement('without_business_postcode_message');
			hideElement('without_business_city_message');
			hideElement('without_business_info_message');
		}
		
		function valid_form2()
		{
			var arr = new Array(10);
			var errorsCount = 0;
		
			/*
			el = document.getElementById('AccountTypePersonal');
			if(el.checked == false)
			{
				if(document.getElementById('AccountbusinessName').value == "")
				{
					showErrorMessage('account_business_name_message','Pole nazwa firmy nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountbusinessSurname').value == "")
				{
					showErrorMessage('account_business_surname_message','Proszę podać imię i nazwisko osoby zamawiającej');
					errorsCount++;
				}
				if(document.getElementById('AccountbusinessNip').value == "")
				{
					showErrorMessage('account_business_nip_message','Pole NIP nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountBusinessAddress1').value == "")
				{
					showErrorMessage('account_business_address1_message','Proszę podać ulicę');
					errorsCount++;
				}
				if(document.getElementById('AccountbusinessPostCode').value == "")
				{
					showErrorMessage('account_business_postcode_message','Pole kod pocztowy nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountbusinessCity').value == "")
				{
					showErrorMessage('account_business_city_message','Proszę podać nazwę miejscowości');
					errorsCount++;
				}
			} else {
			*/
				if(document.getElementById('AccountpersonalName').value == "")
				{
					showErrorMessage('account_personal_name_message','Pole imię nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountpersonalSurname').value == "")
				{
					showErrorMessage('account_personal_surname_message','Pole nazwisko nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountPersonalAddress1').value == "")
				{
					showErrorMessage('account_personal_address1_message','Proszę podać ulicę');
					errorsCount++;
				}
				if(document.getElementById('AccountpersonalPostCode').value == "")
				{
					showErrorMessage('account_personal_postcode_message','Pole kod pocztowy nie może być puste');
					errorsCount++;
				}
				if(document.getElementById('AccountpersonalCity').value == "")
				{
					showErrorMessage('account_personal_city_message','Proszę podać nazwę miejscowości');
					errorsCount++;
				}
			//}


			if(document.getElementById('AccountPhone').value == "")
			{
				showErrorMessage('account_phone_message','Proszę podać numer telefonu, pod którym będziemy mogli się z Tobą skontaktować');
				errorsCount++;
			}
			if(document.getElementById('AccountRegisterEmail').value == "")
			{
				showErrorMessage('account_email_message','Proszę podać prawidłowy adres e-mail');
				errorsCount++;
			}
			
			if(document.getElementById('AccountPassword1').value == "")
			{
				showErrorMessage('account_password1_message','Proszę podać hasło');
				errorsCount++;
			}
			if(document.getElementById('AccountPassword2').value == "")
			{
				showErrorMessage('account_password2_message','Proszę podać powtórzenie hasła');
				errorsCount++;
			}
			if(document.getElementById('AccountPassword2').value != document.getElementById('AccountPassword1').value)
			{
				showErrorMessage('account_password2_message','Wpisane hasła są różne');
				errorsCount++;
			}

			if(errorsCount==0)
				return true;
			else
				return false;

		}
		
		function check_form2()
		{
			if(document.getElementById('AccountEmailStatus') != null)
			{
				var email_status = document.getElementById('AccountEmailStatus').value;
				if(email_status == 0) {
					alert('Proszę podać prawidłowy adres e-mail');
					return false;
				}
			}

			form2_hideAll();

			var status = valid_form2();	
			if(status == true && email_status == 1)
			{
				el = document.getElementById('form2_account');
				el.submit();
			}
		}
		
		function form2_hideAll()
		{
			hideElement('account_personal_name_message');
			hideElement('account_personal_surname_message');
			hideElement('account_personal_address1_message');
			hideElement('account_personal_postcode_message');
			hideElement('account_personal_city_message');
			hideElement('account_business_name_message');
			hideElement('account_business_surname_message');
			hideElement('account_business_nip_message');
			hideElement('account_business_address1_message');
			hideElement('account_business_postcode_message');
			hideElement('account_business_city_message');
			hideElement('account_phone_message');
			hideElement('account_email_message');
			hideElement('account_password1_message');
			hideElement('account_password2_message');
		}
		
		function showErrorMessage(_name,_message)
		{
			if(document.getElementById(_name) != null)
			{
				el = document.getElementById(_name);
				showElement(_name);
				el.style.color = 'red';
				el.innerHTML = _message;
			}
		}

