/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var tArea=new Array("All","Feltham","Cranford","Hanworth","Harlington","Hayes","Heston", "Hounslow", "Isleworth", "Southall", "Twickenham  ", "Whitton", "Colnbrook", "Langley", "Slough");
var tMode=new Array("--Select--","Rent","Sale");
var tType=new Array("All","Studio","1-Bed","2-Bed","3-Bed","4-Bed","5-Bed", "Commercial  ");
var tFurnished= new Array("Furnished","Part Furnished", "Unfurnished");
var d;
function setPrice(){
    var x=document.getElementById("tMode").value;
    //alert(x);
    if(x=="Sale"){
        document.stForm.tMinPrice.options.length=0;
        document.stForm.tMinPrice.options[0]=new Option(" 50,000", "50000", true, false);
        document.stForm.tMinPrice.options[1]=new Option(" 100,000", "100000", false, false);
        document.stForm.tMinPrice.options[2]=new Option(" 150,000", "150000", false, false);
        document.stForm.tMinPrice.options[3]=new Option(" 200,000", "200000", false, false);
        document.stForm.tMinPrice.options[4]=new Option(" 250,000", "250000", false, false);
        document.stForm.tMinPrice.options[5]=new Option(" 300,000", "300000", false, false);
        document.stForm.tMinPrice.options[6]=new Option(" 350,000", "350000", false, false);
        document.stForm.tMinPrice.options[7]=new Option(" 400,000", "400000", false, false);
        document.stForm.tMinPrice.options[8]=new Option(" 450,000", "450000", false, false);

        document.stForm.tMaxPrice.options.length=0;
        document.stForm.tMaxPrice.options[0]=new Option(" 100,000", "100000", true, false);
        document.stForm.tMaxPrice.options[1]=new Option(" 150,000", "150000", false, false);
        document.stForm.tMaxPrice.options[2]=new Option(" 200,000", "200000", false, false);
        document.stForm.tMaxPrice.options[3]=new Option(" 250,000", "250000", false, false);
        document.stForm.tMaxPrice.options[4]=new Option(" 300,000", "300000", false, false);
        document.stForm.tMaxPrice.options[5]=new Option(" 350,000", "350000", false, false);
        document.stForm.tMaxPrice.options[6]=new Option(" 400,000", "400000", false, false);
        document.stForm.tMaxPrice.options[7]=new Option(" 450,000", "450000", false, false);
        document.stForm.tMaxPrice.options[8]=new Option(" 500,000", "500000", false, false);

    }
    else{
        //tMinPrice=new Array(" 50", " 75"," 100"," 150"," 200"," 300"," 400"," 500"," 600"," 700"," 800+");
        document.stForm.tMinPrice.options.length=0;
        document.stForm.tMinPrice.options[0]=new Option(" 50", "50", true, false);
        document.stForm.tMinPrice.options[1]=new Option(" 75", "75", false, false);
        document.stForm.tMinPrice.options[2]=new Option(" 100", "100", false, false);
        document.stForm.tMinPrice.options[3]=new Option(" 150", "150", false, false);
        document.stForm.tMinPrice.options[4]=new Option(" 200", "200", false, false);
        document.stForm.tMinPrice.options[5]=new Option(" 300", "300", false, false);
        document.stForm.tMinPrice.options[6]=new Option(" 400", "400", false, false);
        document.stForm.tMinPrice.options[7]=new Option(" 500", "500", false, false);
        document.stForm.tMinPrice.options[8]=new Option(" 600", "600", false, false);
        document.stForm.tMinPrice.options[9]=new Option(" 700", "700", false, false);
        document.stForm.tMinPrice.options[10]=new Option(" 800+", "801", false, false);

        document.stForm.tMaxPrice.options.length=0;
        document.stForm.tMaxPrice.options[0]=new Option(" 100", "100", true, false);
        document.stForm.tMaxPrice.options[1]=new Option(" 150", "150", false, false);
        document.stForm.tMaxPrice.options[2]=new Option(" 200", "200", false, false);
        document.stForm.tMaxPrice.options[3]=new Option(" 300", "300", false, false);
        document.stForm.tMaxPrice.options[4]=new Option(" 400", "400", false, false);
        document.stForm.tMaxPrice.options[5]=new Option(" 600", "600", false, false);
        document.stForm.tMaxPrice.options[6]=new Option(" 800", "800", false, false);
        document.stForm.tMaxPrice.options[7]=new Option(" 1000", "1000", false, false);
        document.stForm.tMaxPrice.options[8]=new Option(" 1400", "1400", false, false);
        document.stForm.tMaxPrice.options[9]=new Option(" 1800", "1800", true, false);
        document.stForm.tMaxPrice.options[10]=new Option(" 2000+", "2001", false, false);

        
    }
}

function searchTab(){
    document.write('<form action=property_list.php method="get" name=stForm>');
    document.write('<table name="stForm" class="hepm" cellpadding="2" cellspacing="0">');
    document.write('<tr><td colspan="2"  align="center"><img alt="Property Search" src=res/ps1.png /></td></tr>')
    /*** AREA or LOCATION***/
    document.write('<tr><td>Location:<br />');
    document.write('<select name="tArea">');
    var i = 0;
    while ( i < tArea.length ) {
        document.write('<option value=' + tArea[i] + '>' + tArea[i] + '</option>');
        i++;
    }
    document.write('</select>');
    document.write('</td>');


    /*** SALE or RENT***/
    document.write('<td>For Sale/Let:<sup>*</sup><br />');
    document.write('<select id="tMode" name="tMode" onchange=setPrice()>');
    document.write('<option value="sel" >--Select--</option>');
    document.write('<option value="Rent" >Rent</option>');
    document.write('<option value="Sale" >Sale</option>');
    /*var j = 0;
    while ( j < tMode.length ) {
        document.write('<option value=' + tMode[j] + '>' + tMode[j] + '</option>');
        j++;
    }*/
    document.write('</select>');
    document.write('</td></tr>');

    /*** Property Type - Studio - 1-Bed, 2-BEd***/
    document.write('<tr><td colspan="2">Property Type:<br />');
    document.write('<select name="tType">');
    var k = 0;
    while ( k < tType.length ) {
        document.write('<option value=' + tType[k] + '>' + tType[k] + '</option>');
        k++;
    }
    document.write('</select>');
    document.write('</td></tr>');

    /*** FURNISHED ***/
    document.write('<tr><td>Furnished:<br />');
    document.write('<select name="tFurnished">');
    var m = 0;
    while ( m < tFurnished.length ) {
        document.write('<option value=' + tFurnished[m] + '>' +tFurnished[m] + '</option>');
        m++;
    }
    document.write('</select>');
    document.write('</td></tr>');

    /*** Minmum Price ***/
    document.write('<tr><td>Min(in GBP) :<br />');
    document.write('<select name="tMinPrice" size="1" width="90%">');
    /*var n = 0;
    while ( n < tMinPrice.length ) {
        document.write('<option value=' + tMinPrice[n] + '>' + tMinPrice[n] + '</option>');
        n++;
    }*/
    document.write('</select>');
    document.write('</td>');

    /*** Maximum Price ***/
    document.write('<td>Max(in GBP) :<br />');
    document.write('<select name="tMaxPrice" size="1" width="90%">');
    /*var p = 0;
    while ( p < tMaxPrice.length ) {
        document.write('<option value=' + tMaxPrice[p] + '>' + tMaxPrice[p] + '</option>');
        p++;
    }*/
    document.write('</select>');
    document.write('</td></tr>');

    document.write('<tr> <td align="center" colspan="2"><br /><input type="submit" name="submit" value="Search"/></td></tr></table>');
    document.write('<br /><br /><br />');
    document.write('<align=center><img alt=" Call no : +44(0)20 8897 3335" src="res/heCall.png" ></img>');
    document.write('</form>');
    return true;

}
