var section = ""
var content = ""

/****************************** Property for sale form **************************************/

var property_for_sale_form = "<form action='search.php?id=1' method='post'>";

property_for_sale_form = property_for_sale_form + "<p class='search_form_label'>Min price</p>";
property_for_sale_form = property_for_sale_form + "<input class='textbox' name='min_price' type='text' id='min_price' value='1'  size='20' maxlength='10' />";

property_for_sale_form = property_for_sale_form + "<p class='search_form_label'>Max price</p>";
property_for_sale_form = property_for_sale_form + "<input class='textbox' name='max_price' type='text' id='man_price' value='5000000' size='20' maxlength='10' />";

property_for_sale_form = property_for_sale_form + "<p class='search_form_label'>Type of property</p>";
property_for_sale_form = property_for_sale_form + "<select class='pulldown' size='1' name='type_of_property'>";
property_for_sale_form = property_for_sale_form + "<option value='house'>House</option>";
property_for_sale_form = property_for_sale_form + "<option value='flat'>Flat</option>";
property_for_sale_form = property_for_sale_form + "<option value='cottage'>Cottage</option>";
property_for_sale_form = property_for_sale_form + "</select>";

property_for_sale_form = property_for_sale_form + "<p class='search_form_label'>Number of bedrooms</p>";
property_for_sale_form = property_for_sale_form + "<select class='pulldown' size='1'  name='bedrooms'>";
property_for_sale_form = property_for_sale_form + "<option value='studio'>Studio</option>";
property_for_sale_form = property_for_sale_form + "<option value='1'>1</option>";
property_for_sale_form = property_for_sale_form + "<option value='2'>2</option>";
property_for_sale_form = property_for_sale_form + "<option value='3'>3</option>";
property_for_sale_form = property_for_sale_form + "<option value='4 or more'>4 or more</option>";
property_for_sale_form = property_for_sale_form + "</select>";

property_for_sale_form = property_for_sale_form + "<p class='search_form_label'>Location</p><select class='pulldown' size='1' name='location'>";
property_for_sale_form = property_for_sale_form + "<option value='scotland'>Scotland</option>";
property_for_sale_form = property_for_sale_form + "<option value='england'>England</option>";
property_for_sale_form = property_for_sale_form + "<option value='ireland'>Ireland</option>";
property_for_sale_form = property_for_sale_form + "<option value='wales'>Wales</option>";
property_for_sale_form = property_for_sale_form + "<option value='spain'>Spain</option>";
property_for_sale_form = property_for_sale_form + "<option value='portugal'>Portugal</option>";
property_for_sale_form = property_for_sale_form + "<option value='egypt'>Egypt</option>";
property_for_sale_form = property_for_sale_form + "<option value='dubai'>Dubai</option>";
property_for_sale_form = property_for_sale_form + "<option value='rest of europe'>Rest of Europe</option>";
property_for_sale_form = property_for_sale_form + "<option value='worldwide'>Worldwide</option>";
property_for_sale_form = property_for_sale_form + "</select>";

property_for_sale_form = property_for_sale_form + "<input type='hidden' name='section' value='1' />";
property_for_sale_form = property_for_sale_form + "<input class='search_submit' name='submit' type='submit' value='Search'>";

property_for_sale_form = property_for_sale_form + "</form>";

/****************************** Property for rent form **************************************/

var property_for_rent_form = "<form action='search.php?id=2' method='post'>";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Min price per month</p>";
property_for_rent_form = property_for_rent_form + "<input class='textbox' name='min_price' type='text' id='min_price' value='1'  size='20' maxlength='10' />";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Max price per month</p>";
property_for_rent_form = property_for_rent_form + "<input class='textbox' name='max_price' type='text' id='man_price' value='5000' size='20' maxlength='10' />";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Type of property</p>";
property_for_rent_form = property_for_rent_form + "<select class='pulldown' size='1' name='type_of_property'>";
property_for_rent_form = property_for_rent_form + "<option value='house'>House</option>";
property_for_rent_form = property_for_rent_form + "<option value='flat'>Flat</option>";
property_for_rent_form = property_for_rent_form + "<option value='cottage'>Cottage</option>";
property_for_rent_form = property_for_rent_form + "</select>";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Number of bedrooms</p>";
property_for_rent_form = property_for_rent_form + "<select class='pulldown' size='1'  name='bedrooms'>";
property_for_rent_form = property_for_rent_form + "<option value='studio'>Studio</option>";
property_for_rent_form = property_for_rent_form + "<option value='1'>1</option>";
property_for_rent_form = property_for_rent_form + "<option value='2'>2</option>";
property_for_rent_form = property_for_rent_form + "<option value='3'>3</option>";
property_for_rent_form = property_for_rent_form + "<option value='4 or more'>4 or more</option>";
property_for_rent_form = property_for_rent_form + "</select>";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Location</p><select class='pulldown' size='1' name='location'>";
property_for_rent_form = property_for_rent_form + "<option value='scotland'>Scotland</option>";
property_for_rent_form = property_for_rent_form + "<option value='england'>England</option>";
property_for_rent_form = property_for_rent_form + "<option value='ireland'>Ireland</option>";
property_for_rent_form = property_for_rent_form + "<option value='wales'>Wales</option>";
property_for_rent_form = property_for_rent_form + "<option value='spain'>Spain</option>";
property_for_rent_form = property_for_rent_form + "<option value='portugal'>Portugal</option>";
property_for_rent_form = property_for_rent_form + "<option value='egypt'>Egypt</option>";
property_for_rent_form = property_for_rent_form + "<option value='dubai'>Dubai</option>";
property_for_rent_form = property_for_rent_form + "<option value='rest of europe'>Rest of Europe</option>";
property_for_rent_form = property_for_rent_form + "<option value='worldwide'>Worldwide</option>";
property_for_rent_form = property_for_rent_form + "</select>";

property_for_rent_form = property_for_rent_form + "<p class='search_form_label'>Furnished/unfurnished</p>";
property_for_rent_form = property_for_rent_form + "<select class='pulldown' size='1' name='furnished'>";
property_for_rent_form = property_for_rent_form + "<option value='yes'>Furnished</option>";
property_for_rent_form = property_for_rent_form + "<option value='no'>Unfurnished</option>";

property_for_rent_form = property_for_rent_form + "</select><input type='hidden' name='section' value='2' />";

property_for_rent_form = property_for_rent_form + "<input class='search_submit' name='submit' type='submit' value='Search'>";

property_for_rent_form = property_for_rent_form + "</form>";

/******************************  Commercial property form **************************************/

var commercial_property_form = "<form action='search.php?id=3' method='post'>";

commercial_property_form = commercial_property_form + "<p class='search_form_label'>Type of property</p>";
commercial_property_form = commercial_property_form + "<select class='pulldown' size='1' name='type_of_property'>";
commercial_property_form = commercial_property_form + "<option value='office'>Office</option>";
commercial_property_form = commercial_property_form + "<option value='warehouse'>Warehouse</option>";
commercial_property_form = commercial_property_form + "<option value='industrial'>Industrial</option>";
commercial_property_form = commercial_property_form + "<option value='retail'>Retail</option>";
commercial_property_form = commercial_property_form + "<option value='farm'>Farm</option>";
commercial_property_form = commercial_property_form + "</select>";

commercial_property_form = commercial_property_form + "<p class='search_form_label'>Location</p><select class='pulldown' size='1' name='location'>";
commercial_property_form = commercial_property_form + "<option value='scotland'>Scotland</option>";
commercial_property_form = commercial_property_form + "<option value='england'>England</option>";
commercial_property_form = commercial_property_form + "<option value='ireland'>Ireland</option>";
commercial_property_form = commercial_property_form + "<option value='wales'>Wales</option>";
commercial_property_form = commercial_property_form + "<option value='spain'>Spain</option>";
commercial_property_form = commercial_property_form + "<option value='portugal'>Portugal</option>";
commercial_property_form = commercial_property_form + "<option value='egypt'>Egypt</option>";
commercial_property_form = commercial_property_form + "<option value='dubai'>Dubai</option>";
commercial_property_form = commercial_property_form + "<option value='rest of europe'>Rest of Europe</option>";
commercial_property_form = commercial_property_form + "<option value='worldwide'>Worldwide</option>";
commercial_property_form = commercial_property_form + "</select>";

commercial_property_form = commercial_property_form + "<input type='hidden' name='section' value='3' />";

commercial_property_form = commercial_property_form + "<input class='search_submit' name='submit' type='submit' value='Search'>";

commercial_property_form = commercial_property_form + "</form>";

/****************************** Holiday lets form **************************************/

var holiday_lets_form = "<form action='search.php?id=4' method='post'>";

holiday_lets_form = holiday_lets_form + "<p class='search_form_label'>Min price per week</p>";
holiday_lets_form = holiday_lets_form + "<input class='textbox' name='min_price' type='text' id='min_price' value='1'  size='20' maxlength='10' />";

holiday_lets_form = holiday_lets_form + "<p class='search_form_label'>Max price per week</p>";
holiday_lets_form = holiday_lets_form + "<input class='textbox' name='max_price' type='text' id='man_price' value='5000' size='20' maxlength='10' />";

holiday_lets_form = holiday_lets_form + "<p class='search_form_label'>Type of property</p>";
holiday_lets_form = holiday_lets_form + "<select class='pulldown' size='1' name='type_of_property'>";
holiday_lets_form = holiday_lets_form + "<option value='villa'>Villa</option>";
holiday_lets_form = holiday_lets_form + "<option value='apartment'>Apartment</option>";
holiday_lets_form = holiday_lets_form + "<option value='cottage'>Cottage</option>";
holiday_lets_form = holiday_lets_form + "<option value='caravan'>aravan</option>";
holiday_lets_form = holiday_lets_form + "<option value='chalet'>Chalet</option>";
holiday_lets_form = holiday_lets_form + "</select>";

holiday_lets_form = holiday_lets_form + "<p class='search_form_label'>Location</p><select class='pulldown' size='1' name='location'>";
holiday_lets_form = holiday_lets_form + "<option value='scotland'>Scotland</option>";
holiday_lets_form = holiday_lets_form + "<option value='england'>England</option>";
holiday_lets_form = holiday_lets_form + "<option value='ireland'>Ireland</option>";
holiday_lets_form = holiday_lets_form + "<option value='wales'>Wales</option>";
holiday_lets_form = holiday_lets_form + "<option value='spain'>Spain</option>";
holiday_lets_form = holiday_lets_form + "<option value='portugal'>Portugal</option>";
holiday_lets_form = holiday_lets_form + "<option value='egypt'>Egypt</option>";
holiday_lets_form = holiday_lets_form + "<option value='dubai'>Dubai</option>";
holiday_lets_form = holiday_lets_form + "<option value='rest of europe'>Rest of Europe</option>";
holiday_lets_form = holiday_lets_form + "<option value='worldwide'>Worldwide</option>";
holiday_lets_form = holiday_lets_form + "</select>";

holiday_lets_form = holiday_lets_form + "<input type='hidden' name='section' value='4' />";

holiday_lets_form = holiday_lets_form + "<input class='search_submit' name='submit' type='submit' value='Search'>";

holiday_lets_form = holiday_lets_form + "</form>";


function buildForm()
	{
	findRadioBtn1()	
	document.getElementById('section_search_form').innerHTML = content;
	}
	
function findRadioBtn1()
	{
	for (var i=0; i<document.form1.section.length; i++)
		{
		if (document.form1.section[i].checked)
			{
			section = document.form1.section[i].value;
			if (section == "property for sale")
				{
				content = property_for_sale_form;
				}
			else if (section == "property for rent")
				{
				content = property_for_rent_form;
				}
			else if (section == "commercial property")
				{
				content = commercial_property_form;
				}
			else 
				{
				content = holiday_lets_form;
				}
			}
		} 
	}
