//makeBuy(); swapToSales(); PropetType('Buy')
// 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()
{
	intSetRent=1;
	intSetBuy=0;
}

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()
{
	document.searchform.minrentval.style.display = "none";
	document.searchform.minsaleval.style.display = "block";
	document.searchform.maxrentval.style.display = "none";
	document.searchform.maxsaleval.style.display = "block";
	document.searchform.propertytype[0].checked  = true;

}

function swapToRental()
{
	document.searchform.minrentval.style.display = "block";
	document.searchform.minsaleval.style.display = "none";	
	document.searchform.maxrentval.style.display = "block";
	document.searchform.maxsaleval.style.display = "none";	
	
	document.searchform.propertytype[1].checked  = true;


	}

function swapToSales()
{
	document.searchform.minrentval.style.display = "none";
	document.searchform.minsaleval.style.display = "block";	
	document.searchform.maxrentval.style.display = "none";
	document.searchform.maxsaleval.style.display = "block";	
	
	document.searchform.propertytype[0].checked  =  true;
}
  