function checkAll() {
allbox = eval("document.registerform.allpostcodes");
if (allbox.checked == true)
{
	box = eval("document.registerform.SW5");
	if (box.checked == false) box.checked = true;
	box = eval("document.registerform.SW7");
	if (box.checked == false) box.checked = true;
	box = eval("document.registerform.SW10");
	if (box.checked == false) box.checked = true;
}
else
{
	box = eval("document.registerform.SW5");
	if (box.checked == true) box.checked = false;
	box = eval("document.registerform.SW7");
	if (box.checked == true) box.checked = false;
	box = eval("document.registerform.SW10");
	if (box.checked == true) box.checked = false;
}
}

function changeform(obj)
{
	if (obj.enquirytype.value == "Buying")
	{
		document.getElementById('formlayer').innerHTML = "<table width='372' border='0' cellspacing='0' cellpadding='0'><tr><td width='107'>Price Band:</td><td align='left'>&pound;<input name='lower' type='text' size='4' />, 000 to &pound;<input name='upper' type='text' size='4' />, 000</td></tr><tr><td>No. of Bedrooms:</td><td>	<select name='bedrooms'><option selected value=''>Select</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5+</option></select></td></tr><tr><td>Postcode(s):</td><td><input name='allpostcodes' type='checkbox' value='yes' onClick='checkAll()' /> All <input name='SW5' type='checkbox' value='yes' /> SW5 <input name='SW7' type='checkbox' value='yes' /> SW7 <input name='SW10' type='checkbox' value='yes' /> SW10</td></tr><tr><td width='107'>Other Requirements:</td><td align='left'><textarea name='message' cols='27' rows='4'></textarea></td></tr><tr><td width='107'>&nbsp;</td><td><input name='Submit Details' type='submit' value='Submit' /></td></tr></table>";
	}
	if (obj.enquirytype.value == "Selling")
	{
		document.getElementById('formlayer').innerHTML = "<table width='372' border='0' cellspacing='0' cellpadding='0'><tr><td width='107'>Price sought:</td><td align='left'>&pound;<input name='lower' type='text' size='4' />, 000 to &pound;<input name='upper' type='text' size='4' />, 000<br />OR <input name='require_valuation' type='checkbox' value='yes' /> Require Valuation</td></tr><tr><td>No. of Bedrooms:</td><td>	<select name='bedrooms'><option selected value=''>Select</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5+</option></select></td></tr><tr><td>Postcode:</td><td><input name='SW5' type='checkbox' value='yes' /> SW5 <input name='SW7' type='checkbox' value='yes' /> SW7 <input name='SW10' type='checkbox' value='yes' /> SW10</td></tr><tr><td width='107'>Other Details:</td><td align='left'><textarea name='message' cols='27' rows='4'></textarea></td></tr><tr><td width='107'>&nbsp;</td><td><input name='Submit Details' type='submit' value='Submit' /></td></tr></table>";
	}
	if (obj.enquirytype.value == "General")
	{
		document.getElementById('formlayer').innerHTML = "<table width='372' border='0' cellspacing='0' cellpadding='0'><tr><td width='107'>Message:</td><td align='left'><textarea name='message' cols='27' rows='4'></textarea></td></tr><tr><td width='107'>&nbsp;</td><td><input name='Submit Details' type='submit' value='Submit' /></td></tr></table>";
	}
	if (obj.enquirytype.value == "Lettings")
	{
		document.getElementById('formlayer').innerHTML = "<table width='372' border='0' cellspacing='0' cellpadding='0'><tr><td width='107'>Details:</td><td align='left'><textarea name='lettings' cols='27' rows='4'></textarea></td></tr><tr><td width='107'>&nbsp;</td><td><input name='Submit Details' type='submit' value='Submit' /></td></tr></table>";
	}
}