	var currentDate = new Date();
			//currentDate.setTime(currentDate.getTime()+1000*60*60*24*3);
			var Regs = {url: /^(https?|ftp):\/\/([a-z0-9._-]+:[a-z0-9._-]+@)?[a-z0-9._\/~% -]+(\?([a-z0-9_-]+(=[a-zA-Z0-9+%?_-]+&?)?)*)?$/i,
						email: /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i,
						alnum: /^[a-z0-9-_]+$/i,
						phone: /^\+?[0-9\s\(\)\.-]+$/i};
				
			var Months = {0:'Jan', 1:'Feb', 2:'Mar', 3:'Apr', 4:'May', 5:'Jun', 6:'Jul', 7:'Aug', 8:'Sep', 9:'Oct', 10:'Nov', 11:'Dec'};
			
			$(document).ready(function(){
			
				$('img.h-top-link').hover(		
					function(){
						this.src = this.src.split('.gif')[0]+'_on.gif';
					},
					
					function(){
						this.src = this.src.split('.gif')[0].replace('_on', '')+'.gif';
					}
				);
			
			//	$('select[@name=day]').change(checkCollectionDate);
				//$('select[@name=month]').change(checkCollectionDate);
				//$('select[@name=year]').change(checkCollectionDate);
				
			
			});
			
			function markCollectionDate(){
				$('select[@name=day]').selectSelectedValue(currentDate.getDate());
				$('select[@name=month]').selectSelectedValue(Months[currentDate.getMonth()]);
				$('select[@name=year]').selectSelectedValue(currentDate.getFullYear());
			}
			
			function checkCollectionDate(){
		
				var year = $('select[@name=year]').selectSelectedValue();
				var month = $('select[@name=month]').selectSelectedIndex()*1;
				var date = $('select[@name=day]').selectSelectedValue();
				
				var checkDate = new Date(year,month,date);
				
				if(checkDate.getDate()!=date || checkDate.getMonth()!=month || checkDate.getFullYear()!=year){
					alert('You have to select a valid collection date.');
					markCollectionDate();
					return false;
				}			
				else if(currentDate > checkDate){
					alert('Invalid Collection Date!');
					markCollectionDate();
					return false;
				}
				return true;
			}
			
			jQuery.fn.selectSelectedIndex = function(index){
				var toReturn;
				this.each(function(){
					if(index) this.selectedIndex = index;
					else toReturn = this.selectedIndex;
				});
				return toReturn;
			}
			
			jQuery.fn.selectSelectedValue = function(value){
				var toReturn;
				this.each(function(){
					if(value) $('option[@value='+value+']').each(function(){ this.selected = true; });
					else toReturn = this.options[this.selectedIndex].value;
				});
				return toReturn;
			}
			
			jQuery.fn.radioChecked = function(value){
				var toReturn;
				this.each(function(){
					if(value){
						if(this.value==value) this.checked = true;
					}
					else{
						if(this.checked) toReturn = this.value;
					}
				});
				return toReturn;
			}
	
			function validateDelivery(){
				var total = 0;
				var size = Array(16, 16, 20, 20, 25, 25, 28, 28, 25, 32, 32, 30, 30);
				var q1, q2, s1, s2;
				q1 = 1*$('input[@name=quantity_1]').val();
				q2 = 1*$('input[@name=quantity_2]').val();
				s1 = 1*$('select[@name=size_1]').selectSelectedIndex();
				s2 = 1*$('select[@name=size_2]').selectSelectedIndex();

				if (q1+q2 == 1) {
					if ((s1 >= 4) || (s2 >= 4)) {
						total = 1;
					}
				} else if (q1+q2 > 1) {
					if ((s1 >= 2) || (s2 >= 2)) {
						total = 2;
					}
				}
				
				if(total == 0){
					alert('We only deliver for 25cm (approx. 1.5kg) and above.');

					$('input[@name=collection]').radioChecked('outlets');

					return false;
				}
			
				return true;			
			}
			
			function validateForm(){
				var cakeSelected = false;
				for(var i=1; i<=2; i++){
					if($('select[@name=cake_'+i+']').selectSelectedIndex() > 0){
						cakeSelected = true;
						if($('input[@name=quantity_'+i+']').val()==""){
							return formError('Please fill in the Quantity', $('input[@name=quantity_'+i+']'));
						}else{
							var a = parseInt($('input[@name=quantity_'+i+']').val());
							var b = parseFloat($('input[@name=quantity_'+i+']').val());
							if(a!=b || a!=$('input[@name=quantity_'+i+']').val() || a <= 0) return formError('Please fill in a valid quantity for the cake', $('input[@name=quantity_'+i+']'));
						} 
					}
				}
				
				if(!cakeSelected) return formError('Please select your Sweet Secrets Cake', $('select[@name=cake_1]'));
			
				if($('input[@name=collection]').radioChecked()=="outlets"){
					if($('select[@name=location]').selectSelectedIndex() < 1){
						return formError('Please choose a location to collect your cake', $('select[@name=location]'));
					}
				}
				
				if($('input[@name=name]').val()=="") return formError('Please fill in your name', $('select[@name=name]'));
				if($('input[@name=hand_phone]').val()=="") return formError('Please fill in your handphone number', $('select[@name=hand_phone]'));
				else if($('input[@name=hand_phone]').val().search(Regs['phone']) == -1) return formError('You have to key in a valid handphone number', $('select[@name=hand_phone]'));
				
				if($('input[@name=home_phone]').val()=="") return formError('Please fill in your home telephone', $('select[@name=home_phone]'));
				else if($('input[@name=home_phone]').val().search(Regs['phone']) == -1) return formError('You have to key in a valid home telephone number', $('select[@name=home_phone]'));
				
				if($('input[@name=email]').val()=="") return formError('Please fill in your email address', $('select[@name=email]'));
				else if($('input[@name=email]').val().search(Regs['email']) == -1) return formError('You have to key in a valid email address', $('select[@name=email]'));
				
				if($('textarea[@name=address]').val()=="") return formError('Please fill in your address', $('select[@name=address]'));
				
					
				if(!checkCollectionDate()) return false;
				
			}
			
			function formError(mess, field){
				alert(mess);
				field.focus();
				return false;
			}
			
