var Height;

function toggleContainer(divContainer,effectduration)
{
	if ($(divContainer).visible())
	{
		$('toggelImage').innerHTML = "<table width='100%'><tr><td><img align='left' src='../_images/printtoolbar/reloadbutton.JPG' width='24' height='24' onClick='loadSearchForm();'></td><td><img onclick='' alt='' align='right' src='_images/togglebuttonplus.png'></td></tr></table>";
		if (effectduration <= 0)
		{
			Effect.BlindUp($(divContainer),{queue: 'end', scope: 'togglebar', limit:2})	
		}
		else
		{
			Effect.BlindUp($(divContainer),{queue: 'end', scope: 'togglebar', limit:2, duration: effectduration})
		}
	}
	else
	{	
		$('toggelImage').innerHTML = "<table width='100%'><tr><td><img align='left' src='../_images/printtoolbar/reloadbutton.JPG' width='24' height='24' onClick='loadSearchForm();'></td><td><img onclick='' alt='' align='right' src='_images/togglebutton.png'></td></tr></table>";
		if (effectduration <= 0)
		{
			Effect.BlindDown($(divContainer),{queue: 'end', scope: 'togglebar', limit : 2})
		}
		else
		{
			Effect.BlindDown($(divContainer),{queue: 'end', scope: 'togglebar', limit : 2, duration: effectduration})
		}
	}		
}



function openCloseFormDivs(removeDivs, showOption)
{
	var divsToLoadArray = returnCommaSeperatedStringAsArray(returnSectionDivs(removeDivs,'residential'));

	if (divsToLoadArray.length > 0) 
	{
		for (var loopCount = 0; loopCount < divsToLoadArray.length; loopCount++) 
		{			
			$(divsToLoadArray[loopCount]).style.display = showOption;
		}
	}	
}

function switchTD()
{
	switch (tdField)
	{
		case 0:
			tdField = 1;
			return tdValue = "bgcolor='#FFFFFF' onMouseOver=\"this.style.backgroundColor='#f1f1f1';this.style.color='#000000';\" onMouseOut=\"this.style.backgroundColor='#FFFFFF';this.style.color='#333333';\"\"";
			break;
		case 1:
			tdField = 0;
			return tdValue = "bgcolor='#B1D7FE' onMouseOver=\"this.style.backgroundColor='#f1f1f1';this.style.color='#000000';\" onMouseOut=\"this.style.backgroundColor='#B1D7FE';this.style.color='#333333';\"\"";
			break;
	}
	
}

function marketTypeChanged(event) {
	if (event.target.value == 1 && !auctionShowing) { // should be showing and is not
		auctionDetails.toggle();
		auctionShowing = true;
	} else if(event.target.value != 1 && auctionShowing) { // should not be showing and is
		auctionDetails.toggle();
		auctionShowing = false;
	}
}
