// option text Minimum Price -  What the user sees
var secondBox = new Array(
          new Array("0","100,000", "200,000", "300,000", "400,000", "500,000", "600,000", "700,000", "800,000", "900,000", "1,000,000", "2,000,000", "3,000,000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("0 pw","100 pw", "200 pw", "300 pw", "400 pw", "500 pw", "600 pw", "700 pw", "800 pw", "900 pw", "1000 pw", "2000 pw", "3000 pw") /* options for second combo when Option 2  selected in the first combo*/);
// option values Minimum Price -  Whats processed
var secondBox1 = new Array(
          new Array("0","100000", "200000", "300000", "400000", "500000", "600000", "700000", "800000", "900000", "1000000", "2000000", "3000000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "2000", "3000") /* options for second combo when Option 2  selected in the first combo*/);

// option text Maximum Price -  What the user sees
var thirdBox = new Array(
          new Array("100,000", "200,000", "300,000", "400,000", "500,000", "600,000", "700,000", "800,000", "900,000", "1,000,000", "2,000,000", "3,000,000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("100 pw", "200 pw", "300 pw", "400 pw", "500 pw", "600 pw", "700 pw", "800 pw", "900 pw", "1000 pw", "2000 pw", "3000 pw") /* options for second combo when Option 2  selected in the first combo*/);
// option values Maximum Price -  Whats processed
var thirdBox1 = new Array(
          new Array("100000", "200000", "300000", "400000", "500000", "600000", "700000", "800000", "900000", "1000000", "2000000", "3000000"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "2000", "3000") /* options for second combo when Option 2  selected in the first combo*/);

// option text
var fourthBox = new Array(
          new Array("All Types", "Flat", "House"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("All Types", "Flat", "House") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var fourthBox1 = new Array(
          new Array("", "'Flat'", "'House'"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("", "'Flat'", "'House'") /* options for second combo when Option 2  selected in the first combo*/);

function changeForm()
{
     var index = document.myform.category.selectedIndex;
     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;
}