function submit_moto()
{
	if (test_moto()==true)
	{
		document.moto.submit();
	}
}

function test_moto()
{
	if (document.moto.marka.value == "0") 
	{
		alert("Nie wybrałeś marki pojazdu.");
		document.moto.marka.focus();
		return false;
	}
	if (document.moto.model.value == "") 
	{
		alert("Nie wpisałeś modelu pojazdu.");
		document.moto.model.focus();
		return false;
	}
	if (document.moto.wojewodztwo.value == "0") 
	{
		alert("Nie wybrałeś województwa.");
		document.moto.wojewodztwo.focus();
		return false;
	}
	if (document.moto.email.value == "") 
	{
		alert("Nie wpisałeś adresu e-mail.");
		document.moto.email.focus();
		return false;
	}
	if(document.moto.regulamin.checked==false)
	{
		alert("Any dodać ogłoszenie musisz zaakceptować regulamin!");
		document.moto.regulamin.focus();
		return false;
	}
	return true;
}


function submit_inne()
{
	if (test_inne()==true)
	{
		document.inne.submit();
	}
}

function test_inne()
{
	if (document.inne.email.value == "") 
	{
		alert("Nie wpisałeś adresu e-mail.");
		document.inne.email.focus();
		return false;
	}
	if(document.inne.regulamin.checked==false)
	{
		alert("Any dodać ogłoszenie musisz zaakceptować regulamin!");
		document.inne.regulamin.focus();
		return false;
	}
	return true;
}

// JavaScript Document

function zmien_fote(photoMin, photoMax) {
	advAJAX.setDefaultParameters({
		onInitialization : function(obj) { document.getElementById(obj.tag).innerHTML = "Preparing..."; },
		onLoading : function(obj) { document.getElementById(obj.tag).innerHTML = "Loading..."; },
		onSuccess : function(obj) { document.getElementById(obj.tag).innerHTML = obj.responseText; },
		onError : function(obj) { document.getElementById(obj.tag).innerHTML = "Error..."; }
	});
	advAJAX.get({ url: "php/photo.php?photoMax=" + photoMax + "&photoMin=" + photoMin, tag: "bigFoto" });
	advAJAX.setDefaultParameters({});
}
