	function CheckHomeForm(theform)   {
		var msg="", selcountry, selregion, countryID, regionID, productID="";

		// assign correct value to productID
		selcountry=theform.countryID.selectedIndex;
		selregion=theform.regionID.selectedIndex;
		countryID=theform.countryID.options[selcountry].value;
		regionID=theform.regionID.options[selregion].value;

		if (regionID!="") productID=regionID;
		else  {
			if (countryID!="") productID=countryID;
			}
		theform.productID.value=productID;

		// now check arrival date is not in the past

		arrivalday=theform.arrivalday.options[theform.arrivalday.selectedIndex].value;
		arrivalmonthyear=theform.arrivalmonthyear.options[theform.arrivalmonthyear.selectedIndex].value;
		msg=checkDateNotInPast(arrivalday, arrivalmonthyear);	
		if (msg!="")  {
			alert(msg);
			return false;
			}
		else return true;
		}
