/* $Revision: 4 $
 * $Author: Kiran $
 * $Date: 11/12/09 2:17p $
 * $Logfile: /Development/Property Phase1/Web/BuyerManager/js/REzyBuyers.js $
 * $NoKeywords: $
 */
 
/* Purpose: functions for the buyer/renter registration form */
function listbox_selectall() 
{ 
	var listbox = document.getElementById('ListBox2');
	for(var count=0; count < listbox.options.length; count++) 
	{            
	listbox.options[count].selected = true;
	}   	
}
function TermsCondition()
{  
   emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/BuyerManager/TermsAndConditions.asp?page=welcome&logout=yes'  , 'Terms and conditions', 'width=500px,height=400px,top=500px,center=1,resize=0,scrolling=0,isShowClose=1') 
}
function AddNewSearCriteria()
{  
   emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/BuyerManager/AddNewSearchCriteria.asp?page=welcome&logout=yes'  , 'Add New Requirements', 'width=500px,height=400px,top=200px,center=1,resize=0,scrolling=0,isShowClose=1')
}

function ChangeSearchCriteria(objPropType)
{
var rowBR, rowLs, rowBlds
rowBR=document.getElementById("BRoom");
rowLs= document.getElementById("Lsize");
rowBlds= document.getElementById("BldSize");


if( objPropType.value == 'House')
{
		rowBR.style.display = '';
		rowLs.style.display = '';
		rowBlds.style.display = '';
}
else if(objPropType.value == 'Land Residential' )
{
		rowBR.style.display = 'none';
		rowLs.style.display = '';
		rowBlds.style.display = 'none';
}

else if(objPropType.value == 'Land Commercial')
{
		rowBR.style.display = 'none';
		rowLs.style.display = '';
		rowBlds.style.display = 'none';
}
else if(objPropType.value == 'Apartment')
{
		rowBR.style.display = '';
		rowLs.style.display = 'none';
		rowBlds.style.display = '';
}
else if(objPropType.value == 'Townhouse')
{
		rowBR.style.display = '';
		rowLs.style.display = '';
		rowBlds.style.display = '';
}
else if(objPropType.value == 'Farm')
{
		rowBR.style.display = '';
		rowLs.style.display = '';
		rowBlds.style.display = 'none';
}
else if(objPropType.value == 'Commercial')
{
		rowBR.style.display = 'none';
		rowLs.style.display = '';
		rowBlds.style.display = '';
}
else
{
		rowBR.style.display = 'none';
		rowLs.style.display = '';
		rowBlds.style.display = '';
}
changeUnit();
}

function SaveLogin(str)
{
	if(str == 'check')
	{
		if((document.form1.txtUserName.value.length > 0) && (document.form1.txtPassword.value.length > 0))
		{
			document.form1.submit();
		}
		else
		{
			if ( document.form1.txtUserName.value == '')
			{
				alert('Please enter User name.');
				document.form1.txtUserName.focus();
			}
			if(document.form1.txtPassword.value == '')
			{
				alert('Please enter Password.');
				document.form1.txtPassword.focus();
			}	
		  	return false;
		}
	}
}

function changeUnit()
{	var proptype
	proptype=document.getElementById("PropertyType");
	if(proptype.value == 'Farm')
	{
	document.getElementById('divm').style.display= 'none';
	document.getElementById('divh').style.display = '';
	} 
	else 
	{
		document.getElementById('divm').style.display= '';
		document.getElementById('divh').style.display = 'none';
	}
}

function OpenWin()
{
	window.open('/buyermanager/forgottenpassword.asp', 'password', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=375,height=250,ScreenX=200, Left=200, ScreenY=200, Top=200');
    return false;
}