// option text
var secondBox = new Array(
          new Array("£0","£100,000", "£125,000", "£150,000", "£175,000", "£200,000", "£250,000", "£300,000", "£350,000", "£400,000", "£450,000", "£500,000", "£550,000", "£600,000", "£700,000", "£800,000", "£900,000", "£1,000,000", "£1,250,000", "£1,500,000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("£0 pcm","£500 pcm", "£550 pcm", "£600 pcm", "£650 pcm", "£700 pcm", "£750 pcm", "£800 pcm", "£900 pcm", "£1,000 pcm", "£1,100 pcm", "£1,200 pcm", "£1,300 pcm", "£1,400 pcm", "£1,500 pcm", "£1,750 pcm", "£2,000 pcm", "£2,250 pcm", "£2,500 pcm", "£2,750 pcm") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var secondBox1 = new Array(
          new Array("0","100000", "125000", "150000", "175000", "200,000", "250,000", "300000", "350000", "400000", "450000", "500000", "550000", "600000", "700000", "800000", "900000", "1000000", "1250000", "1500000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("0","500", "550", "600", "650", "700", "750", "800", "900", "1000", "1100", "1200", "1300", "1400", "1500", "1750", "2000", "2250", "2500", "2750") /* options for second combo when Option 2  selected in the first combo*/);

// option text
var thirdBox = new Array(
          new Array("£100,000", "£125,000", "£150,000", "£175,000", "£200,000", "£250,000", "£300,000", "£350,000", "£400,000", "£450,000", "£500,000", "£550,000", "£600,000", "£700,000", "£800,000", "£900,000", "£1,000,000", "£1,250,000", "£1,500,000", "£2,000,000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("£500 pcm", "£550 pcm", "£600 pcm", "£650 pcm", "£700 pcm", "£750 pcm", "£800 pcm", "£900 pcm", "£1,000 pcm", "£1,100 pcm", "£1,200 pcm", "£1,300 pcm", "£1,400 pcm", "£1,500 pcm", "£1,750 pcm", "£2,000 pcm", "£2,250 pcm", "£2,500 pcm", "£2,750 pcm", "£3,000 pcm") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var thirdBox1 = new Array(
          new Array("100000", "125000", "150000", "175000", "200,000", "250,000", "300000", "350000", "400000", "450000", "500000", "550000", "600000", "700000", "800000", "900000", "1000000", "1250000", "1500000", "2000000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("500", "550", "600", "650", "700", "750", "800", "900", "1000", "1100", "1200", "1300", "1400", "1500", "1750", "2000", "2250", "2500", "2750", "3000") /* options for second combo when Option 2  selected in the first combo*/);

// option text
var fourthBox = new Array(
          new Array("All Types", "Apartment", "House"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("All Types", "Apartment", "House", "Maisonette", "Semi Detached", "Terraced", "Studio") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var fourthBox1 = new Array(
          new Array("", "'Apartment'", "'House'"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("0", "2", "1", "5", "9", "13", "15") /* options for second combo when Option 2  selected in the first combo*/);
/*
	<option value=\"\">All Locations</option>
	<!-- <option value=\"Earlsfield\">Earlsfield</option> -->
	<option value=\"Merton Abbey\">Merton Abbey</option>
	<option value=\"Merton Park\">Merton Park</option>
	<option value=\"Morden\">Morden</option>
	<option value=\"Motspur Park\">Motspur Park</option>
	<option value=\"New Malden\">New Malden</option>
	<option value=\"Old Merton Park\">Old Merton Park</option>	
	<option value=\"Raynes Park\">Raynes Park</option>
	<option value=\"South Wimbledon\">South Wimbledon</option>
	<!-- <option value=\"Southfields\">Southfields</option>	 
	<option value=\"Tooting\">Tooting</option> -->
	<option value=\"Wandsworth\">Wandsworth</option>
	<option value=\"West Wimbledon\">West Wimbledon</option>	
	<option value=\"Wimbledon\">Wimbledon</option>
	<option value=\"Wimbledon Chase\">Wimbledon Chase</option>
	<option value=\"Other Areas\">Other Locations</option>
*/
// areas text
var area_box_text = new Array(
          new Array("All Locations", "Earlsfield","Merton Abbey", "Merton Park", "Morden", "Motspur Park", "New Malden","Old Merton Park","Raynes Park","Southfields","South Wimbledon","Wandsworth","West Wimbledon","Wimbledon","Wimbledon Chase","Other Locations"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("All Locations", "Earlsfield", "Merton Abbey", "Merton Park", "Morden", "Motspur Park", "New Malden","Old Merton Park","Raynes Park","South Wimbledon","Southfields","Tooting","Wandsworth","West Wimbledon","Wimbledon","Wimbledon Chase","Other Locations") /* options for second combo when Option 2  selected in the first combo*/);
// areas values
var area_box_vals = new Array(
          new Array("", "Earlsfield","Merton Abbey", "Merton Park", "Morden", "Motspur Park", "New Malden","Old Merton Park","Raynes Park","Southfields","South Wimbledon","Wandsworth","West Wimbledon","Wimbledon","Wimbledon Chase","Other Locations"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("", "Earlsfield", "Merton Abbey", "Merton Park", "Morden", "Motspur Park", "New Malden","Old Merton Park","Raynes Park","South Wimbledon","Southfields","Tooting","Wandsworth","West Wimbledon","Wimbledon","Wimbledon Chase","Other Locations") /* options for second combo when Option 2  selected in the first combo*/);


function changeForm()
{

     var index = document.myform.category.selectedIndex;

     area_values = area_box_text[index];
	 area_options = area_box_vals[index];
     for (i = 0; i<area_options.length; i++)
     {
          document.myform.alo[i] = new Option (area_values[i], area_options[i]);
     }

     values = secondBox[index];
	 thevalues = secondBox1[index];
     for (i = 0; i<values.length; i++)
     {
          document.myform.lop[i] = new Option (values[i], thevalues[i]);
     }

	 values2 = thirdBox[index];
	 thevalues2 = thirdBox1[index];
	 
     for (i = 0; i<values2.length; i++)
     {
          document.myform.hip[i] = new Option (values2[i], thevalues2[i]);
     }
	 document.myform.hip.selectedIndex=values2.length-1
	 values3 = fourthBox[index];
	 thevalues3 = fourthBox1[index];
	 
     for (i = 0; i<values3.length; i++)
     {
     document.myform.typ.options.length=values3.length-1
     document.myform.typ[i] = new Option (values3[i], thevalues3[i]);
     }
	 if (document.myform.category.value=='Buy')
	 {document.myform.dbt.value='1'}
	 if (document.myform.category.value=='Let')
	 {document.myform.dbt.value='2'}
}
function selectAlo(){
var selectedValue=document.getElementById("areas").options[document.getElementById("areas").selectedIndex].value;
if (document.getElementById("areas").selectedIndex > 0){
document.getElementById("areas").name=('alo'+ selectedValue);
	//alert(document.getElementById("areas").name);
	}
}
// resets the select menus to default buy values
/*function refreshSelects(){
	document.getElementById("category").selectedIndex=0;
	document.getElementById("typ").selectedIndex=0;
	document.getElementById("lop").selectedIndex=0;
	document.getElementById("hip").selectedIndex=19;
	document.getElementById("areas").selectedIndex=0;
	document.getElementById("bed").selectedIndex=0;
	document.myform.dbt.value=1;
}

addLoadEvent(refreshSelects);*/