function range (option, minmax) {
	if (option != 0 && option != 47)
	{
		if (minmax == "min") {
			newindex = option + 1;
			currindex = document.getElementById('maxprice').selectedIndex;
			if (currindex < newindex) {
				document.getElementById('maxprice').selectedIndex = newindex;
			}
		}
		if (minmax == "max") {
			newindex = option - 1;
			currindex = document.getElementById('minprice').selectedIndex;
			if (currindex > newindex) {
				document.getElementById('minprice').selectedIndex = newindex;
			}
		}
	}
}

function rangerent (option, minmax) {
	if (option != 0 && option != 14)
	{
		if (minmax == "min") {
			newindex = option;
			currindex = document.getElementById('maxpricerent').selectedIndex;
			if (currindex < newindex) {
				document.getElementById('maxpricerent').selectedIndex = newindex;
			}
		}
		if (minmax == "max") {
			newindex = option;
			currindex = document.getElementById('minpricerent').selectedIndex;
			if (currindex > newindex) {
				document.getElementById('minpricerent').selectedIndex = newindex;
			}
		}
	}
}

function rangecom (option, minmax) {
	if (option != 0 && option != 14)
	{
		if (minmax == "min") {
			newindex = option;
			currindex = document.getElementById('maxpricecom').selectedIndex;
			if (currindex < newindex) {
				document.getElementById('maxpricecom').selectedIndex = newindex;
			}
		}
		if (minmax == "max") {
			newindex = option;
			currindex = document.getElementById('minpricecom').selectedIndex;
			if (currindex > newindex) {
				document.getElementById('minpricecom').selectedIndex = newindex;
			}
		}
	}
}

function hs(itemID, iState)
{
	htmlItem = document.getElementById(itemID);
	if (htmlItem)
	{
		if (iState == 0)
		{  // hide
			htmlItem.style.display = 'none';
		}
		else
		{  // show
			htmlItem.style.display = '';
		}
	}
}

function pausecomp(millis)
{
	var date = new Date();
	var curDate = null;
	
	do { curDate = new Date(); }
	while(curDate-date < millis);
} 

function ps (itemID, iState, pause) {
	htmlItem = document.getElementById(itemID);
	if (htmlItem)
	{
		if (iState == 0)
		{  // hide
			pausecomp(pause);
			htmlItem.style.display = 'none';
		}
		else
		{  // show
			pausecomp(pause);
			htmlItem.style.display = '';
		}
	}
}
 
defaultStep=3
step=defaultStep
function scrollDivRight(id){
document.getElementById(id).scrollLeft+=step
timerRight=setTimeout("scrollDivRight('"+id+"')",10)
}

function scrollDivLeft(id){
document.getElementById(id).scrollLeft-=step
timerLeft=setTimeout("scrollDivLeft('"+id+"')",10)
}

function changeDivImage(which)
{
	if(which == "rent")
	{
		document.getElementById("selling").style.backgroundImage = "url(assets/box-rent-board.jpg)";
		document.getElementById("selling").innerHTML = '<h2>Property to Let</h2><p>Howards Residential Lettings offer a comprehensive range of services to all <a href="landlords.php">Landlords</a></p>';
	}
	else
	{
		document.getElementById("selling").style.backgroundImage = "url(assets/box-sale-board.jpg)";
		document.getElementById("selling").innerHTML = '<h2>Howards Sellings Tips</h2><p>Please click below for handy tips and advice on how to best prepare your home for sale.</p><p><a href="selling-tips.php">more...</a></p>';
	}
}