// 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", "Det Bungalow", "Det House", "End Terr House", "Semi Det Bungalow", "Semi Det House", "Terraced House"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("All Types", "Apartment", "Det Bungalow", "Det House", "End Terr House", "Semi Det Bungalow", "Semi Det House", "Terraced House") /* options for second combo when Option 2  selected in the first combo*/);
// option values
var fourthBox1 = new Array(
          new Array("", "'Apartment / Flat'", "'Detached Bungalow'", "'Detached House'", "'End Terraced House'", "'Semi - Detached Bungalow'", "'Semi - Detached House'", "'Terraced House'"), /* options for second combo when Option 1  selected in the first combo*/
          new Array("", "'Apartment / Flat'", "'Detached Bungalow'", "'Detached House'", "'End Terraced House'", "'Semi - Detached Bungalow'", "'Semi - Detached House'", "'Terraced House'") /* options for second combo when Option 2  selected in the first combo*/);

function changeForm()
{
     var index = document.quicksearchForm.category.selectedIndex;
	 values = secondBox[index];
	 thevalues = secondBox1[index];
     for (i = 0; i<values.length; i++)
     {
          document.quicksearchForm.lop[i] = new Option (values[i], thevalues[i]);
     }
	 values2 = thirdBox[index];
	 thevalues2 = thirdBox1[index];
	 
     for (i = 0; i<values2.length; i++)
     {
          document.quicksearchForm.hip[i] = new Option (values2[i], thevalues2[i]);
     }
	 document.quicksearchForm.hip.selectedIndex=values2.length-1
	 values3 = fourthBox[index];
	 thevalues3 = fourthBox1[index];
	 
     for (i = 0; i<values3.length; i++)
     {
     document.quicksearchForm.typ.options.length=values3.length-1
     document.quicksearchForm.typ[i] = new Option (values3[i], thevalues3[i]);
     }
	 if (document.quicksearchForm.category.value=='Buy')
	 {document.quicksearchForm.dbt.value='1';document.quicksearchForm.fid.value='11307'}
	 if (document.quicksearchForm.category.value=='Let')
	 {document.quicksearchForm.dbt.value='2';document.quicksearchForm.fid.value='17307'}
}
function selectAlo(){
var selectedValue=document.getElementById("areas").options[document.getElementById("areas").selectedIndex].value;

}
// 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.quicksearchForm.hip.selectedIndex=19;
	document.getElementById("areas").selectedIndex=0;
	document.getElementById("bed").selectedIndex=0;
	document.quicksearchForm.fid.value=11307;
	document.quicksearchForm.dbt.value=1;
}

//quick links javascript
function go()
{
	box = document.getElementsByName("qlinks");
	destination = box[0].options[box[0].selectedIndex].value;
	if (destination) location.href = destination;
}


