function wanted(){

	if(document.getElementById("category").selectedIndex == 1 | document.getElementById("item").selectedIndex == 1){
      	document.getElementById("trimblock").style.display = "none"
		document.getElementById("colourblock").style.display = "none"
		document.getElementById("yearblock").style.display = "none"
		document.getElementById("mileageblock").style.display = "none"		    
		document.getElementById("50pc").style.display = "none"
		document.getElementById("submit").value = "Submit"
		
		if(document.getElementById("category").selectedIndex != 1){
	        document.getElementById("priceblock").style.display = "block"
	    }
	    else{
	    	document.getElementById("priceblock").style.display = "none"
	    }

		}

	else{document.getElementById("trimblock").style.display = "block"	
		document.getElementById("colourblock").style.display = "block"
		document.getElementById("yearblock").style.display = "block"
		document.getElementById("mileageblock").style.display = "block"
		document.getElementById("priceblock").style.display = "block"
		document.getElementById("50pc").style.display = "block"
		document.getElementById("submit").value = "Continue"

		}
}

function validateLinks(form)
{
    if(""==document.forms.input.url.value)
    {
    alert("Please enter a URL");
    document.forms.input.url.focus();
    return false;
    }
    else
    
    if(""==document.forms.input.description.value)
    {
    alert("Please enter a Description");
    document.forms.input.description.focus();
    return false;
    }
    else
    
    maxlength=255
    if (document.forms.input.url.value.length > maxlength) {
    alert("Please limit url field to 255 or less characters");
    document.forms.input.url.focus();
    return false;
    }
    else
    
    maxlength=255
    if (document.forms.input.description.value.length > maxlength) {
    alert("Please limit description field to 255 or less characters");
    document.forms.input.description.focus();
    return false;
    }
	
}


function validateForm(form)
{

    if(""==document.forms.input.make.value)
    {
    alert("Please enter a make");
    document.forms.input.make.focus();
    return false;
    }
    else
    
    if(""==document.forms.input.model.value)
    {
    alert("Please enter a model");
    document.forms.input.model.focus();
    return false;
    }
    else
    
    if(""==document.forms.input.description.value)
    {
    alert("Please enter a description");
    document.forms.input.description.focus();
    return false;
    }
    else
            
    if(""==document.forms.input.email.value)
    {
    alert("Please enter a email address");
    document.forms.input.email.focus();
    return false;
    }
    else
                
    var maxlength=10
    if (document.forms.input.make.value.length > maxlength) {
    alert("Please limit Make to 10 or less characters");
    document.forms.input.make.focus();
    return false;
    }
    else
                    
    maxlength=20
    if (document.forms.input.model.value.length > maxlength) {
    alert("Please limit Model to 20 or less characters");
    document.forms.input.model.focus();
    return false;
    }
    else
    
    maxlength=10
    if (document.forms.input.trim.value.length > maxlength) {
    alert("Please limit Trim to 10 or less characters");
    document.forms.input.trim.focus();
    return false;
    }
    else
    
    maxlength=10
    if (document.forms.input.colour.value.length > maxlength) {
    alert("Please limit Colour to 10 or less characters");
    document.forms.input.colour.focus();
    return false;
    }
    else
                                
    maxlength=4
    if (document.forms.input.year.value.length > maxlength) {
    alert("Year should be in the format yyyy");
    document.forms.input.year.focus();
    return false;
    }
    else
    
    maxlength=20
    if (document.forms.input.location.value.length > maxlength) {
    alert("Please limit Location to 20 or less characters");
    document.forms.input.location.focus();
    return false;
    }
    else
        
    maxlength=15
    if (document.forms.input.phone.value.length > maxlength) {
    alert("Please limit Phone to 15 or less characters");
    document.forms.input.phone.focus();
    return false;
    }
    else
                                            
    maxlength=50
    if (document.forms.input.email.value.length > maxlength) {
    alert("Please limit Email to 50 or less characters");
    document.forms.input.email.focus();
    return false;
    }
    else
                                                
    if (isNaN(document.forms.input.year.value)) {
    alert("Please enter a valid number for Year");
    document.forms.input.year.focus();
    return false;
    }
    else

    if (isNaN(document.forms.input.price.value)) {
    alert("Please enter a valid number for Price (without ,'s or £'s)");
    document.forms.input.price.focus();
    return false;
    }
    else

    if (isNaN(document.forms.input.mileage.value)) {
    alert("Please enter Mileage as number (eg. 55000 rather than 55k)");
    document.forms.input.mileage.focus();
    return false;
    } 
}

function loading(){
    
    document.getElementById("addimages").style.display = "none"
    document.getElementById("loading").style.display = "block"
    return true

}