// JavaScript Document

//controls which buying or renting option tab is selected

var intSetBuy=0;
var intSetRent=0;

function noChoice()
{
		document.getElementById('buying_tab').src = "new_design_images/buttons/buying_red.jpg" ;
		document.getElementById('renting_tab').src = "new_design_images/buttons/renting_red.jpg" ;
}

function swapBuy()
{
		document.getElementById('buying_tab').src = "new_design_images/buttons/buying_yellow.jpg" ;
		document.getElementById('renting_tab').src = "new_design_images/buttons/renting_red.jpg" ;
}

function swapRent()
{	
	document.getElementById('renting_tab').src = "new_design_images/buttons/renting_yellow.jpg" ;
	document.getElementById('buying_tab').src = "new_design_images/buttons/buying_red.jpg" ;

}

function makeBuy()
{
	intSetRent=0;
	intSetBuy=1;
}

function makeRent()
{
	intSetBuy=0;
	intSetRent=1;
}

function checkChoice()
{
	
	if (intSetBuy==1)
	{
		swapBuy();
	}
	
	else if (intSetRent==1)
	{
		swapRent();
	}
	
	else
	{
		swapBuy();
	}
}

//Swaps between the display of buying and renting search details

function loadChoices(TabName)
{
	if(TabName=='Rent')
			{
				//swapToRental();
			}
		else
			{
				//swapToSales();
			}
}

function defaultChoice()
{
	searchform.minrentval.style.display = "none";
	searchform.minsaleval.style.display = "block";
	searchform.maxrentval.style.display = "none";
	searchform.maxsaleval.style.display = "block";
}

function swapToRental()
{
	searchform.minrentval.style.display = "block";
	searchform.minsaleval.style.display = "none";
	searchform.maxrentval.style.display = "block";
	searchform.maxsaleval.style.display = "none";
	searchform.propertytype[1].checked = true;

	}

function swapToSales()
{
	searchform.minrentval.style.display = "none";
	searchform.minsaleval.style.display = "block";
	searchform.maxrentval.style.display = "none";
	searchform.maxsaleval.style.display = "block";
	searchform.propertytype[0].checked = true;
}
  