<!--	
	function ValidateFunction(objForm)		
	{						
	var blnRetVal;
	var strError;
	
		blnRetVal = true;
		strError  = "The following errors were detected:\n\n";

		// County	        
		if ( objForm.ddlCounty )
		{
			if ( objForm.ddlCounty.value == 'Please Select County' )
			{
					blnRetVal = false;
					strError += "You must select a county for your property.\n";
			}							
		}
		
		// Town
		if ( objForm.ddlTown )
		{
			if  ( objForm.ddlTown.value == 'Please Select Town' )
			{
					blnRetVal = false;
					strError += "You must select a town for your property.\n";
			}							
		}
		
		// Address
		if ( objForm.txtAddress ) 
		{
			if ( objForm.txtAddress.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter the first 2 lines of the address of your property.\n";
			}
		}
		
		// PostCode
		if ( objForm.txtPostcode ) 
		{
			if ( objForm.txtPostcode.value == '' )
			{
					blnRetVal = false;
					strError += "You must enter your properties postcode.\n";
			}							
		}
		
		// PropertySize
		if ( objForm.ddlPropertySize ) 
		{
			if ( objForm.ddlPropertySize.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must select your property type.\n";
			}
		}
		
		// PropertyType
		if ( objForm.ddlPropertySize ) 
		{
			if ( objForm.ddlPropertyType.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must select your property position.\n";
			}
		}
		
		// ddlLifestyle
		if ( objForm.ddlLifestyle ) 
		{
			if ( objForm.ddlLifestyle.value == 'Please Select Lifestyle' ) 
			{
					blnRetVal = false;
					strError += "You must select your property lifestyle.\n";
			}
		}
		
		// txtPropertyPrice
		if ( objForm.txtPropertyPrice ) 
		{
			if ( objForm.txtPropertyPrice.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter your property price.\n";
			}
			else
			{
					// May have text but is it numeric?
					if ( !JustNumeric( objForm.txtPropertyPrice.value, true )  ) 
					{
						blnRetVal = false;
						strError += "The price field only accepts numbers, the pound sign and a decimal point.\n";
					}
			}
		}
		
		// txtWebDecription
		if ( objForm.txtWebDecription ) 
		{
			if (( objForm.txtWebDecription.value == '' ) || ( objForm.txtWebDecription.value == 'Here’s an example of some of the details to include in your description...Central Heating, Double Glazing, Conservatory, Garage, Balcony, Off Street Parking, Garden, Loft Conversion, Local Amenities eg School, Train station, etc.' ))
			{
					blnRetVal = false;
					strError += "You must enter your property description.\n";
			}
		}	
									
		// ddlTitle
		if ( objForm.ddlTitle )
		{
			if ( objForm.ddlTitle.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter your title.\n";
			}								
		}														
							
		// txtFirstName
		if ( objForm.txtFirstName )
		{
			if ( objForm.txtFirstName.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter your first name.\n";
			}								
		}														
							
		// txtLastName
		if ( objForm.txtLastName )
		{
			if ( objForm.txtLastName.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter your last name.\n";
			}								
		}
						
		// txtPhoneNo
		if ( objForm.txtPhoneNo )
		{
			if ( objForm.txtPhoneNo.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter your phone number.\n";
			}								
		}
				
		// txtEmail
		if (( objForm.txtEmail )  || ( objForm.txtConfirmEmail ))
		{
			if (( objForm.txtEmail.value == '' ) || ( objForm.txtConfirmEmail.value == '' ))
			{
					blnRetVal = false;
					strError += "You must enter your email address.\n";
			}
			else
			{
				if ( objForm.txtEmail.value != objForm.txtConfirmEmail.value )
				{
					blnRetVal = false;
					strError += "Please ensure your email address is correct in both email and email confirmation fields.\n";
				}
			}								
		}
		
		// txtPassword
		if (( objForm.txtPassword )  || ( objForm.txtConfirmPassword ))
		{
			if (( objForm.txtPassword.value == '' ) || ( objForm.txtConfirmPassword.value == '' ))
			{
					blnRetVal = false;
					strError += "You must enter a password.NOTE If you are already registered you need to enter your current password.\n";
			}
			else
			{
				if ( objForm.txtPassword.value != objForm.txtConfirmPassword.value )
				{
					blnRetVal = false;
					strError += "Please ensure your passowrd is the same in both password and password confirmation fields.\n";
				}
			}								
		}
		
		
		// Check for error and show box
		if ( !blnRetVal ) 
		{
			strError += "\nPlease correct the problem before clicking the next button.";
			alert ( strError );
		}

		// Return the result
		return blnRetVal;
		
	}		
	
	
	
	function ValidateFunctionOLD(objForm)		
	{						
	var blnRetVal;
	var strError;
	
		blnRetVal = true;
		strError  = "The following errors were detected:\n\n";
				
		// Age
		if ( objForm.ucAdEntry_txtAge ) 
		{
			if ( objForm.ucAdEntry_txtAge.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter an age for the horse.\n";
			}
			else
			{
					// May have text but is it numeric?
					if ( !JustNumeric( objForm.ucAdEntry_txtAge.value, false )  ) 
					{
						blnRetVal = false;
						strError += "The age field only accepts numbers.\n";
					}
					else
					{
						if ( parseInt( objForm.ucAdEntry_txtAge.value ) > 60 )
						{
							blnRetVal = false;
							strError += "The age of the horse cannot be more than 60.\n";
						}
					}
			}								
		}
		// Height
		if ( objForm.ucAdEntry_txtHeight ) 
		{
			if ( objForm.ucAdEntry_txtHeight.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter the horses height.\n";
			}
			else
			{
					// May have text but is it numeric?
					if ( !JustNumeric( objForm.ucAdEntry_txtHeight.value, false )  ) 
					{
						blnRetVal = false;
						strError += "The height field only accepts numbers and a decimal point.\n";
					}
					// Now check the height is in the correct format
					if ( !CheckHeightBounds( objForm.ucAdEntry_txtHeight.value ) )
					{
						blnRetVal = false;
						strError += "The height field must be a value between 7.0 and 19.3\n";
					}
					// Check the height syntax
					if ( !CheckHeightSyntax( objForm.ucAdEntry_txtHeight.value ) )
					{
						blnRetVal = false;
						strError += "Height values can only have a decimal value of .0, .1, .2 or .3\n";
					}
			}								
		}
		// Colour
		if ( objForm.ucAdEntry_txtColour ) 
		{
			if ( objForm.ucAdEntry_txtColour.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter the horses colour.\n";
			}
		}
		// Price
		if ( objForm.ucAdEntry_txtHorsePrice ) 
		{
			if (( objForm.ucAdEntry_txtHorsePrice.value == '' ) || ( objForm.ucAdEntry_txtHorsePrice.value == '£' ))
			{
					blnRetVal = false;
					strError += "You must enter a price.\n";
			}
			else
			{
					// May have text but is it numeric?
					if ( !JustNumeric( objForm.ucAdEntry_txtHorsePrice.value, true )  ) 
					{
						blnRetVal = false;
						strError += "The price field only accepts numbers, the pound sign and a decimal point.\n";
					}
			}								
		}
		// Number of horses
		if ( objForm.ucAdEntry_txtNumHorses ) 
		{
			if ( objForm.ucAdEntry_txtNumHorses.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter the number of horses the box can carry.\n";
			}
			else
			{
				// May have text but is it numeric?
				if ( !JustNumeric( objForm.ucAdEntry_txtNumHorses.value, false )  ) 
				{
					blnRetVal = false;
					strError += "The number of horses field only accepts numbers.\n";
				}
			}
		}
		// Mileage
		if ( objForm.ucAdEntry_txtMileage ) 
		{
			if ( objForm.ucAdEntry_txtMileage.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter a mileage for the horse box.\n";
			}
			else 
			{
				// May have text but is it numeric?
				if ( !JustNumeric( objForm.ucAdEntry_txtMileage.value, false )  ) 
				{
					blnRetVal = false;
					strError += "The mileage field only accepts numbers.\n";
				}
			}
		}
		// Reg Letter
		if ( objForm.ucAdEntry_txtRegLetter ) 
		{
			if ( objForm.ucAdEntry_txtRegLetter.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter the registration letter of the horse box.\n";
			}
			else
			{
				// Make sure there is only 1 character there
				if ( objForm.ucAdEntry_txtRegLetter.value.length > 1 ) 
				{
					blnRetVal = false;
					strError += "You must only enter a single character for the registration letter.\n";
				}
			}
		}
		// Box Price
		if ( objForm.ucAdEntry_txtBoxPrice ) 
		{
			if (( objForm.ucAdEntry_txtBoxPrice.value == '' ) || ( objForm.ucAdEntry_txtBoxPrice.value == '£' ))
			{
					blnRetVal = false;
					strError += "You must enter a price for the horsebox.\n";
			}
			else
			{
					// May have text but is it numeric?
					if ( !JustNumeric( objForm.ucAdEntry_txtBoxPrice.value, true )  ) 
					{
						blnRetVal = false;
						strError += "The price field only accepts numbers, the pound sign and a decimal point.\n";
					}
			}
		}								
		// Advert text
		if ( objForm.ucAdEntry_txtAdText )
		{
			if ( objForm.ucAdEntry_txtAdText.value == '' ) 
			{
					blnRetVal = false;
					strError += "You must enter some text for the advert.\n";
			}								
		}														
		
		// Check for error and show box
		if ( !blnRetVal ) 
		{
			strError += "\nPlease correct the problem before clicking the next button.";
			alert ( strError );
		}

		// Return the result
		return blnRetVal;
		
	}			
	
	
	
	// Little function to just check for numbers
	function JustNumeric ( strInput, blnPriceCheck )
	{
		var blnRetVal;
		var intCount;
								
		var strNumeric = "0123456789. ";
		
		// If we are checking a price then add the pound sign to it
		if ( blnPriceCheck ) 
			strNumeric += unescape("%A3");
									
		blnRetVal = true;
		intCount  = 0;
		
		for ( intCount = 0; intCount < strInput.length; intCount++ )
		{																															
			if ( strNumeric.indexOf(strInput.charAt(intCount)) == -1 ) 
			{
				blnRetVal = false;
			}
		}
		
		return blnRetVal;
		
	}				
	
	// Check the height has been entered correctly.
	function CheckHeightBounds ( strInput )
	{
		var blnRetVal;
		var dblHeight;
		
		blnRetVal = true;
		// First check within range of 7.0 and 19.3
		dblHeight = parseFloat(strInput);
		if (( dblHeight < 7 ) || ( dblHeight > 19.3 ))
		{
			blnRetVal = false;
		}
									
		// Return
		return blnRetVal;
	}
	
		function CheckHeightBoundsCM ( strInput )
	{
		var blnRetVal;
		var dblHeight;
		
		blnRetVal = true;
		// First check within range of 50 and 150
		dblHeight = parseFloat(strInput);
		if (( dblHeight < 50 ) || ( dblHeight > 150 ))
		{
			blnRetVal = false;
		}
									
		// Return
		return blnRetVal;
	}
	
	// Check the syntax on the height field itself				
	function CheckHeightSyntax ( strInput )
	{
		var blnRetVal;
									
		blnRetVal = true;
		if ( strInput.indexOf(" ") != -1 )
		{
			blnRetVal = false;
		}
		else if ( strInput.indexOf(".") != -1 ) 
		{
			// Ok it has a decimal place in it so lets see if we have the correct value in there!
			if ( strInput.indexOf(".") != strInput.lastIndexOf(".") )
			{
				blnRetVal = false;
			}
			else
			{
				var strSplitString = strInput.split(".");
				switch ( strSplitString[1] )
				{
					case '0':
					case '1':
					case '2':
					case '3':
						blnRetVal = true;
						break;
					default:
						blnRetVal = false;
						break;
				}
			}
		}
		
		// Return
		return blnRetVal;
	}										
								
//-->
