// Added by Expert Agent for powering iFrame Resizing

function resizeFrame(result) {
    if (getScrollY() > 0)
    scroll(0,0);
    document.getElementById("powcont").style.height = result + "px";
}

function getScrollY() {
    var scrOfY = 0;
    if (typeof (window.pageYOffset) == 'number') {
        //Netscape compliant
        scrOfY = window.pageYOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
    }
    return scrOfY;
}


// Search things by Barry Wang 2009 (Two wongs don't make a wang!)

function Search()
{

    var minbeds, minprice, maxprice, department, location
	minbeds = document.getElementById("MinBeds").value
    minprice = document.getElementById("MinPrice").value
    maxprice = document.getElementById("MaxPrice").value
    department = document.getElementById("Department").value
    location = document.getElementById("Location").value
    var pg;
    if (department == 2)
    	pg = "pfl";
    else
    	pg = "pfs";
    document.location = pg + ".htm?dep=" + department + "&minprice=" + minprice + "&maxprice=" + maxprice + "&districts=" + location + "&minbeds=" + minbeds
}
function Lettings_Prices()
{
	document.getElementById("MinPrice").options.length = 0
	var oItem
	
	oItem = document.createElement("Option");                
	oItem.text = "No Minimum";  //Textbox's value
	oItem.value = "";  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "500PCM";  //Textbox's value
	oItem.value = 500;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "600PCM";  //Textbox's value
	oItem.value = 600;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "700PCM";  //Textbox's value
	oItem.value = 700;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "800PCM";  //Textbox's value
	oItem.value = 800;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "900PCM";  //Textbox's value
	oItem.value = 900;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "1000PCM";  //Textbox's value
	oItem.value = 1000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "2000PCM";  //Textbox's value
	oItem.value = 2000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "3000PCM";  //Textbox's value
	oItem.value = 3000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "4000PCM";  //Textbox's value
	oItem.value = 5000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "5000PCM+";  //Textbox's value
	oItem.value = 5000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	
	
	document.getElementById("MaxPrice").options.length = 0

	oItem = document.createElement("Option");                
	oItem.text = "No Maximum";  //Textbox's value
	oItem.value = "";  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "500PCM";  //Textbox's value
	oItem.value = 500;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "600PCM";  //Textbox's value
	oItem.value = 600;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "700PCM";  //Textbox's value
	oItem.value = 700;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "800PCM";  //Textbox's value
	oItem.value = 800;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "900PCM";  //Textbox's value
	oItem.value = 900;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "1000PCM";  //Textbox's value
	oItem.value = 1000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "2000PCM";  //Textbox's value
	oItem.value = 2000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "3000PCM";  //Textbox's value
	oItem.value = 3000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "4000PCM";  //Textbox's value
	oItem.value = 5000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "5000PCM+";  //Textbox's value
	oItem.value = 5000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

}
function Sales_Prices()
{
	document.getElementById("MinPrice").options.length = 0
	var oItem
	
	oItem = document.createElement("Option");                
	oItem.text = "No Minimum";  //Textbox's value
	oItem.value = "";  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "100,000";  //Textbox's value
	oItem.value = 100000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "150,000";  //Textbox's value
	oItem.value = 150000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "200,000";  //Textbox's value
	oItem.value = 200000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "250,000";  //Textbox's value
	oItem.value = 250000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "300,000";  //Textbox's value
	oItem.value = 300000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "350,000";  //Textbox's value
	oItem.value = 350000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "400,000";  //Textbox's value
	oItem.value = 400000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "450,000";  //Textbox's value
	oItem.value = 450000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "500,000";  //Textbox's value
	oItem.value = 500000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "600,000";  //Textbox's value
	oItem.value = 600000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "700,000";  //Textbox's value
	oItem.value = 700000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "800,000";  //Textbox's value
	oItem.value = 800000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "900,000";  //Textbox's value
	oItem.value = 900000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "1,000,000";  //Textbox's value
	oItem.value = 1000000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "2,000,000";  //Textbox's value
	oItem.value = 2000000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "3,000,000+";  //Textbox's value
	oItem.value = 3000000;  //Textbox's value
	document.getElementById("MinPrice").options.add(oItem);


		
	document.getElementById("MaxPrice").options.length = 0

	oItem = document.createElement("Option");                
	oItem.text = "No Maximum";  //Textbox's value
	oItem.value = "";  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	
	
	oItem = document.createElement("Option");                
	oItem.text = "100,000";  //Textbox's value
	oItem.value = 100000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "150,000";  //Textbox's value
	oItem.value = 150000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "200,000";  //Textbox's value
	oItem.value = 200000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "250,000";  //Textbox's value
	oItem.value = 250000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "300,000";  //Textbox's value
	oItem.value = 300000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "350,000";  //Textbox's value
	oItem.value = 350000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "400,000";  //Textbox's value
	oItem.value = 400000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "450,000";  //Textbox's value
	oItem.value = 450000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "500,000";  //Textbox's value
	oItem.value = 500000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);	

	oItem = document.createElement("Option");                
	oItem.text = "600,000";  //Textbox's value
	oItem.value = 600000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "700,000";  //Textbox's value
	oItem.value = 700000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "800,000";  //Textbox's value
	oItem.value = 800000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "900,000";  //Textbox's value
	oItem.value = 900000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "1,000,000";  //Textbox's value
	oItem.value = 1000000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "2,000,000";  //Textbox's value
	oItem.value = 2000000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);

	oItem = document.createElement("Option");                
	oItem.text = "3,000,000+";  //Textbox's value
	oItem.value = 3000000;  //Textbox's value
	document.getElementById("MaxPrice").options.add(oItem);
}
function switchPrices(value)
{
	if (value=="1")
	{
		//Sales Prices
		Sales_Prices()
	}
	else
	{
		//Lettings Prices
		Lettings_Prices()
	}
}
