function checkcode()
{

if (document.form1.VoucherCode.value == '')  {
	alert ("You must enter a voucher code to continue");
	document.form1.VoucherCode.focus();

	return false;
} else {
		
	var str = document.form1.VoucherCode.value;
	str = str.toLowerCase();
	str = (str).replace(/treat/, ""); /*Replaces treat with nothing*/
	str = (str).replace(/'/, ""); /*Replaces ' with nothing*/
	str = (str).replace(/£/, ""); /*Replaces ' with nothing*/
	str = (str).replace(/,/, ""); /*Replaces , with nothing*/
	str = (str).replace(/\s/g, ""); /*replaces all the whitespace with nothing*/
	
	var validate = str.toLowerCase();
	document.form1.VoucherCode.value = validate;
		
	if (document.form1.VoucherCode.value == '50abtavoucher')  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == 'discountedhaven')  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == '2for1adrenalinday')  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == 'freekidssporting')  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == '2nightsfor1hotel')  {
	return true;
	}

	if (document.form1.VoucherCode.value == '2for1dining')  {
	return true;
	}

	if (document.form1.VoucherCode.value == 'europeanflight')  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == "1weeksfreeaccommodation")  {
	return true;
	}
	 
	if (document.form1.VoucherCode.value == "1weeksfreeaccomodation")  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == "1weeksfreeacommodation")  {
	return true;
	}
	
	if (document.form1.VoucherCode.value == "1weeksfreeacomodation")  {
	return true;
	}

alert ("That does not look like a valid code");

document.form1.VoucherCode.focus();
	
	return false;
}

}




