<!--
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";
		}
	//Height
	var theHeight = document.getElementById('height');
	theHeight.style.color="";
	if (theHeight.value == "")
		{
		errormessage = errormessage + "Please enter your horse's Height\n";
		}
	//Age
	var theAge = document.getElementById('age');
	theAge.style.color="";
	if (theAge.value == "")
		{
		errormessage = errormessage + "Please enter your horse's Age\n";
		}
	//Sex
	var theSex = document.getElementById('sex');
	theSex.style.color="";
	if (theSex.options[theSex.selectedIndex].value == "select")
		{
		theSex.style.color="red";
		errormessage = errormessage + "Please select Sex\n";
		}
		//Colour
	var theColour = document.getElementById('colour');
	theColour.style.color="";
	if (theColour.value == "")
		{
		errormessage = errormessage + "Please enter your horse's Colour\n";
		}
		//Breed
	var theBreed = document.getElementById('breed');
	theBreed.style.color="";
	if (theBreed.value == "")
		{
		errormessage = errormessage + "Please enter your horse's Breeding\n";
		}
	//Affiliated
	var theAffil = document.getElementById('affiliated');
	theAffil.style.color="";
	if (theAffil.options[theAffil.selectedIndex].value == "select")
		{
		theAffil.style.color="red";
		errormessage = errormessage + "Please select Affiliated\n";
		}
	//Level
	var theLevel = document.getElementById('level');
	theLevel.style.color="";
	if (theLevel.options[theLevel.selectedIndex].value == "select")
		{
		theLevel.style.color="red";
		errormessage = errormessage + "Please select Level\n";
		}
		//County
	var theCounty = document.getElementById('county');
	theCounty.style.color="";
	if (theCounty.value == "")
		{
		errormessage = errormessage + "Please enter the County\n";
		}
		//Price
	var thePrice = document.getElementById('price');
	thePrice.style.color="";
	if (thePrice.value == "")
		{
		errormessage = errormessage + "Please enter the Price\n";
		}
		//Description
	var theDesc = document.getElementById('descr');
	theDesc.style.color="";
	if (theDesc.value == "")
		{
		errormessage = errormessage + "Please enter the 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;
			  }
			}
		}
	}

-->
