<!--
function alphanum(myobject)
	{
	var theThing=document.getElementById(myobject);  
  	theThing.style.color='';
	var itsvalue = theThing.value;
	for(var j=0; j<itsvalue.length; j++)
		{
		  var theCharacter = itsvalue.charAt(j);
		  var hh = theCharacter.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || (hh == 45) || (hh == 32))
			  {
			  }
			  else	{
			  theThing.style.color='red';
			  alert("Please enter only letters,\nnumbers and a dash for unknown\nparts of the reg number");
			  return false;
			  }
		}
	return true;
	}
function alphatext(myobject)
	{
	var theThing=document.getElementById(myobject);  
  	theThing.style.color='';
	var itsvalue = theThing.value;
	for(var j=0; j<itsvalue.length; j++)
		{
		  var theCharacter = itsvalue.charAt(j);
		  var hh = theCharacter.charCodeAt(0);
		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || (hh > 43 && hh < 47) || (hh == 32) || (hh == 10) || (hh == 13) || (hh == 39) || (hh == 34))
			  {
			  }
			  else	{
			  theThing.style.color='red';
			  alert("Only allowed:\nletters, numbers, full stops, quotes and commas\nNo other characters - sorry!");
			  return false;
			  }
		}
	return true;
	}

function finaltest()
	{
	var errormessage = "";
	var photoerror = "";
	// title
	var theTitle = document.getElementById('title');
	theTitle.style.color="";
	if (theTitle.value == "")
		{
		errormessage = errormessage + "Please add a main Title\n";
		}
	//Make
	var theMake = document.getElementById('make');
	theMake.style.color="";
	if (theMake.options[theMake.selectedIndex].value == "select")
		{
		theMake.style.color="red";
		errormessage = errormessage + "Please select Make\n";
		}
	//Model
	var theModel = document.getElementById('model');
	theModel.style.color="";
	if (theModel.value == "")
		{
		errormessage = errormessage + "Please enter the Model\n";
		}
	//Year
	var theYear = document.getElementById('year');
	theYear.style.color="";
	if (theYear.value == "")
		{
		errormessage = errormessage + "Please enter the Year\n";
		}
		//Mileage
	var theMileage = document.getElementById('mileage');
	theMileage.style.color="";
	if (theMileage.value == "")
		{
		errormessage = errormessage + "Please enter Mileage\n";
		}
//test_month
	var theTest_month = document.getElementById('test_month');
	theTest_month.style.color="";
	if (theTest_month.options[theTest_month.selectedIndex].value == "month")
		{
		theTest_month.style.color="red";
		errormessage = errormessage + "Please select Test Month\n";
		}
	//test_year
	var theTest_year = document.getElementById('test_year');
	theTest_year.style.color="";
	if (theTest_year.options[theTest_year.selectedIndex].value == "year")
		{
		theTest_year.style.color="red";
		errormessage = errormessage + "Please select Test Year\n";
		}
	//tax_month
	var theTax_month = document.getElementById('tax_month');
	theTax_month.style.color="";
	if (theTax_month.options[theTax_month.selectedIndex].value == "month")
		{
		theTax_month.style.color="red";
		errormessage = errormessage + "Please select Tax Month\n";
		}
	//tax_year
	var theTax_year = document.getElementById('tax_year');
	theTax_year.style.color="";
	if (theTax_year.options[theTax_year.selectedIndex].value == "year")
		{
		theTax_year.style.color="red";
		errormessage = errormessage + "Please select Tax Year\n";
		}
	//Colour
	var theColour = document.getElementById('colour');
	theColour.style.color="";
	if (theColour.value == "")
		{
		errormessage = errormessage + "Please enter Colour\n";
		}
	//County
	var theCounty = document.getElementById('county');
	theCounty.style.color="";
	if (theCounty.value == "")
		{
		errormessage = errormessage + "Please enter where the car can be seen\n";
		}
	//Price
	var thePrice = document.getElementById('price');
	thePrice.style.color="";
	if (thePrice.value == "")
		{
		errormessage = errormessage + "Please enter your Asking Price\n";
		}
	//Description
	var theDescr = document.getElementById('descr');
	theDescr.style.color="";
	if (theDescr.value == "")
		{
		errormessage = errormessage + "Please enter a Description\n";
		}
		//Name
	var theName = document.getElementById('name');
	theName.style.color="";
	if (theName.value == "")
		{
		errormessage = errormessage + "Please enter your Name\n";
		}
		//Email
	var theEmail = document.getElementById('email');
	theEmail.style.color="";
	if (theEmail.value == "")
		{
		errormessage = errormessage + "Please enter your Email\n";
		}
		//Phone
	var thePhone = document.getElementById('phone');
	thePhone.style.color="";
	if (thePhone.value == "")
		{
		errormessage = errormessage + "Please enter your Phone\n";
		}
		//Username
	var theUser = document.getElementById('user');
	theUser.style.color="";
	if (theUser.value == "")
		{
		errormessage = errormessage + "Please enter a Username\n";
		}
		//Password
	var thePass = document.getElementById('pass');
	thePass.style.color="";
	if (thePass.value == "")
		{
		errormessage = errormessage + "Please enter a Password\n";
		}


	// any problems	
	if (errormessage != "")
		{
		window.alert(errormessage);
		return false;
		} else
		{
		//Photo
		var thePhoto = document.getElementById('photo');
		thePhoto.style.color="";
		
		if(!/(\.gif|\.jpg|\.jpeg)$/i.test(thePhoto.value)) 
			{
			var r=confirm("Don't you want to upload a photo?\n\nClick 'OK' to upload an image\n\nClick 'Cancel' to go ahead without an image");
			if (r==true)
			  {
				return false;
			  }
			else
			  {
				return true;
			  }
			}
		}
	}

-->

