// option text
var secondBox = new Array(
          new Array("£0","£75,000", "£100,000", "£125,000", "£150,000", "£175,000", "£200,000", "£300,000", "£400,000", "£500,000", "£600,000", "£700,000", "£900,000", "£1,000,000", "£3,000,000", "£3,000,000+"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("£0 pcm","£50 pcm", "£100 pcm", "£150 pcm", "£200 pcm", "£250 pcm", "£300 pcm", "£350 pcm", "£400 pcm", "£450 pcm", "£500 pcm", "£700 pcm", "£900 pcm", "£1,000 pcm", "£3,500 pcm", "£6,000 pcm", "£8,500 pcm", "£10,000 pcm") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var secondBox1 = new Array(
          new Array("0","75000", "100000", "125000", "150000", "175000", "200000", "300000", "400000", "500000", "600000", "700000", "900000", "1000000", "3000000", "10000000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("0","50", "100", "150", "200", "250", "300", "350", "400", "450", "500", "700", "900", "1000", "3500", "6000", "8500", "10000") /* options for second combo when Option 2  selected in the first combo*/);

// option text
var thirdBox = new Array(
          new Array("£75,000", "£100,000", "£125,000", "£150,000", "£175,000", "£200,000", "£300,000", "£400,000", "£500,000", "£600,000", "£700,000", "£800,000", "£900,000", "£1,000,000", "£3,000,000", "£3,000,000+"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("£50 pcm", "£100 pcm", "£150 pcm", "£200 pcm", "£250 pcm", "£300 pcm", "£350 pcm", "£400 pcm", "£450 pcm", "£500 pcm", "£700 pcm", "£900 pcm", "£1,000 pcm", "£3,500 pcm", "£6,000 pcm", "£8,500 pcm", "£10,000 pcm+") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var thirdBox1 = new Array(
          new Array("75000", "100000", "125000", "150000", "175000", "200000", "300000", "400000", "500000", "600000", "700000", "800000", "900000", "1000000", "3000000", "10000000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("50", "100", "150", "200", "250", "300", "350", "400", "450", "500", "700", "900", "1000", "3500", "6000", "8500", "10000+") /* 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") /* 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("", "'Apartment'", "'House'") /* options for second combo when Option 2  selected in the first combo*/);

function changeForm()
{
     var index = document.forms.myform.category.selectedIndex;
     values = secondBox[index];
	 thevalues = secondBox1[index];
     for (i = 0; i<values.length; i++)
     {
          document.forms.myform.lop[i] = new Option (values[i], thevalues[i]);
     }
	 values2 = thirdBox[index];
	 thevalues2 = thirdBox1[index];
	 
     for (i = 0; i<values2.length; i++)
     {
          document.forms.myform.hip[i] = new Option (values2[i], thevalues2[i]);
     }
	 document.forms.myform.hip.selectedIndex=values2.length-1
	 values3 = fourthBox[index];
	 thevalues3 = fourthBox1[index];
	 
     for (i = 0; i<values3.length; i++)
     {
     document.forms.myform.typ.options.length=values3.length-1
     document.forms.myform.typ[i] = new Option (values3[i], thevalues3[i]);
     }
	 if (document.forms.myform.category.value=='Buy')
	 {document.forms.myform.dbt.value='1'}
	 if (document.forms.myform.category.value=='Let')
	 {document.forms.myform.dbt.value='2'}
}

// resets the select menus to default buy values
function refresh_qsSelects(){
	document.getElementById('category').selectedIndex=0;
	document.getElementById('typ').selectedIndex=0;
	document.getElementById('lop').selectedIndex=0;
	document.getElementById('hip').selectedIndex=19;
	document.getElementById('bed').selectedIndex=0;
	document.myform.dbt.value=1;
}