// JScript source code

/*
function CheckDefaultSearch(VOWSearch) {
	var tmpValid = "0"
	//alert(document.form1.TYP.selectedIndex)
	if (document.form1.TYP.selectedIndex <= 0)
				{
				//document.getElementById("TYP_Label").innerHTML = " * Required"
				//document.form1.FirstName.focus();
				//tmpValid++
				}
	
	
	if (tmpValid == "0") {
		if (VOWSearch == 1 )
			{
			document.form1.action="do-vow-search.asp"
			}
				return (true);
		}
			
		else {
			return (false)
			}
	}
*/

///////////////////////////////////////////////////////////////////

function SubmitContact(){

var tmpValid = "0"

	if ((isWhitespace(document.form1.Name.value)))
	{
	alert("Name is required.")
	document.form1.Name.focus();
	tmpValid++
	}
	

	else if ((isWhitespace(document.form1.Email.value)))
	{
	alert("Email is required.")
	document.form1.Email.focus();
	tmpValid++
	}
	
	else if (!(isEmail(document.form1.Email.value)))
	{
	alert("The Email Address you specified is not valid.  Please try again.")
	document.form1.Email.focus();
	tmpValid++
	}
	
	

if (tmpValid == "0")
{
document.form1.submit();
}

}

///////////////////////////////////////////////////////////////////
//Registration Page Functions

function CheckReg(){

var tmpValid = "0"

	if ((isWhitespace(document.RegForm.FirstName.value)))
	{
	alert("First Name is required.")
	document.RegForm.FirstName.focus();
	tmpValid++
	}
	
	else if ((isWhitespace(document.RegForm.LastName.value)))
	{
	alert("Last Name is required.")
	document.RegForm.LastName.focus();
	tmpValid++
	}

	else if ((isWhitespace(document.RegForm.Email.value)))
	{
	alert("Email is required.")
	document.RegForm.Email.focus();
	tmpValid++
	}
	
	else if (!(isEmail(document.RegForm.Email.value)))
	{
	alert("The Email Address you specified is not valid.  Please try again.")
	document.RegForm.Email.focus();
	tmpValid++
	}
	
	else if ((isWhitespace(document.RegForm.Password.value)))
	{
	alert("Password is required.")
	document.RegForm.Password.focus();
	tmpValid++
	}
	
	
	else if ((isWhitespace(document.RegForm.VerifyPassword.value)))
	{
	alert("Please confirm your Password is correct by typing it in again.")
	document.RegForm.VerifyPassword.focus();
	tmpValid++
	}
	
	
	else if (!((document.RegForm.Password.value) == (document.RegForm.VerifyPassword.value)))
	{
	alert("The verification Password you entered is the same as the specified Password value.\nPlease try again.")
	document.RegForm.Password.focus();
	tmpValid++
	}

        else if (!(document.RegForm.Terms.checked)) 
        {
	alert("You must agree to the Terms of Use before completing your registration.")
	document.RegForm.Terms.focus();
	tmpValid++
        }
		
	
	

if (tmpValid == "0")
{
document.RegForm.submit();
}

}



function CheckLogon(){

var tmpValid = "0"


	if ((isWhitespace(document.LogonForm.Email.value)))
	{
	alert("Email is required.")
	document.LogonForm.Email.focus();
	tmpValid++
	}
	
	else if (!(isEmail(document.LogonForm.Email.value)))
	{
	alert("The Email Address you specified is not valid.  Please try again.")
	document.LogonForm.Email.focus();
	tmpValid++
	}
	
	else if ((isWhitespace(document.LogonForm.Password.value)))
	{
	alert("Password is required.")
	document.LogonForm.Password.focus();
	tmpValid++
	}
	
	

if (tmpValid == "0")
{
document.LogonForm.action = '/my-account/DoLogon.asp';
document.LogonForm.submit();
}

}


function CheckPassword(){

var tmpValid = "0"


	if ((isWhitespace(document.LogonForm.Username.value)))
	{
	alert("Username/ Email is required.")
	document.LogonForm.Username.focus();
	tmpValid++
	}
	
	else if (!(isEmail(document.LogonForm.Username.value)))
	{
	alert("The Email Address you specified is not valid.  Please try again.")
	document.LogonForm.Username.focus();
	tmpValid++
	}
	
	

if (tmpValid == "0")
{
document.LogonForm.action = 'ForgotPassword.asp';
document.LogonForm.submit();
}

}



function toggleForgotPassword() {
   document.getElementById("reg1a").style.display = 'none';
   document.getElementById("reg1b").style.display = 'none';
   document.getElementById("reg1c").style.display = 'none';
   document.getElementById("reg1d").style.display = 'none';
   document.getElementById("psswd1a").style.display = '';
   document.getElementById("psswd1b").style.display = '';
   document.getElementById("psswd1c").style.display = '';
   document.getElementById("psswd1d").style.display = '';
}


function toggleRegisterLoad() {
   document.getElementById("reg1a").style.display = '';
   document.getElementById("reg1b").style.display = '';
   document.getElementById("reg1c").style.display = '';
   document.getElementById("reg1d").style.display = '';
   document.getElementById("psswd1a").style.display = 'none';
   document.getElementById("psswd1b").style.display = 'none';
   document.getElementById("psswd1c").style.display = 'none';
   document.getElementById("psswd1d").style.display = 'none';
}


///////////////////////////////////////////////////////////////////
//Recently Viewed

	    function getImage(vLN){
			var imgName = 'http://images.cmititestbank.com/mlsni/thumbs/' + vLN + '.jpg';
			document.getElementById('ViewedProperty').src=imgName;
		}
	    function getViewDate(vDate){
			document.getElementById('dynloadviewdate').innerHTML= '<font face=Arial size=1>Viewed: <font color=#666666>' + vDate + '</font></font>';
		}
	    function getPrice(vPrice){
			document.getElementById('dynloadprice').innerHTML= '<b><font face=Arial style=\'font-size: 9pt\'>' + vPrice + '</font></b>';
		}
	    function getDesc(vDesc){
			document.getElementById('dynloaddesc').innerHTML= '<font face=Arial size=1>' + vDesc + '</font>';
		}
	    function getAddress(vAddress){
			document.getElementById('dynloadaddress').innerHTML= '<font face=Arial size=1>' + vAddress + '</font>';
		}
	    function getDetails(vDetails){
			document.getElementById('dynloaddetails').innerHTML= '<font face=Arial size=1 color=\"#666666\"><u><a href=\"/chicago-real-estate/property-information.asp?ln=' + vDetails + '\">Details</font></a></u></font>';
		}




function HighlightRow(Level_id1) {
		
			var thisLevel1 = document.getElementById(Level_id1);
				thisLevel1.className = 'tdHighlight'	
			}

function SetHighlightIndex(Level_id1) {
		
			var thisLevel1 = document.getElementById(Level_id1);
				thisLevel1.className = 'tdNormalHighlight'	
			}
			
function ResetRow(Level_id1) {
			var thisLevel1 = document.getElementById(Level_id1);
				thisLevel1.className = 'tdNormal'
			}




	var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
	function highlightTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(this!=activeRow){
			this.setAttribute('origCl',this.className);
			this.origCl = this.className;
		}
		this.className = arrayOfRolloverClasses[tableObj.id];
		
		activeRow = this;
		
	}
	
	function clickOnTableRow()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
		if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
			activeRowClickArray[tableObj.id].className='';
		}
		this.className = arrayOfClickClasses[tableObj.id];
		
		activeRowClickArray[tableObj.id] = this;
				
	}
	
	function resetRowStyle()
	{
		var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

		if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
			this.className = arrayOfClickClasses[tableObj.id];
			return;	
		}
		
		var origCl = this.getAttribute('origCl');
		if(!origCl)origCl = this.origCl;
		this.className=origCl;
		
	}
		
	function addTableRolloverEffect(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}
		for(var no=0;no<rows.length;no++){
			rows[no].onmouseover = highlightTableRow;
			rows[no].onmouseout = resetRowStyle;
			
			if(whichClassOnClick){
				rows[no].onclick = clickOnTableRow;	
			}
		}
		
	}

	function fxnHighlightRow(tableId,whichClass,whichClassOnClick)
	{
		arrayOfRolloverClasses[tableId] = whichClass;
		arrayOfClickClasses[tableId] = whichClassOnClick;
		
		var tableObj = document.getElementById(tableId);
		var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){
			var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');
		}

				rows[0].className = arrayOfClickClasses[0];	


		
	}

///////////////////////////////////////////////////////////////////
//MOrtgage Calculator Function


function Morgcal()
{
	form = document.MortgageForm
	LoanAmount= form.Price.value
		
	DownPayment= form.Downpayment.value
	AnnualInterestRate = form.Interest.value/100
	Years= form.Term.value
		MonthRate=AnnualInterestRate/12
	NumPayments=Years*12
	Prin=LoanAmount-DownPayment
	
	MonthPayment=Math.floor((Prin*MonthRate)/(1-Math.pow((1+MonthRate),(-1*NumPayments)))*100)/100
	
        form.NumberOfPayments.value=NumPayments
	form.MonthlyPayment.value=MonthPayment
}



function CalculateMortgage(){

var tmpValid = "0"


	if ((isWhitespace(document.MortgageForm.Price.value)))
	{
	alert("List Price is required.")
	document.MortgageForm.Price.focus();
	tmpValid++
	}
	
	else if (!(isFloat(document.MortgageForm.Price.value)))
	{
	alert("The Price field must be a numeric value only.  Please exclude any dollar signs.")
	document.MortgageForm.Price.focus();
	tmpValid++
	}

	else if ((isWhitespace(document.MortgageForm.Interest.value)))
	{
	alert("Interest Rate is required.")
	document.MortgageForm.Interest.focus();
	tmpValid++
	}
	
	else if (!(isFloat(document.MortgageForm.Interest.value)))
	{
	alert("The Interest Rate field must be a numeric value only.  Please exclude any percentage signs.")
	document.MortgageForm.Interest.focus();
	tmpValid++
	}

	else if ((!(isFloat(document.MortgageForm.Taxes.value))) && (!(isWhitespace(document.MortgageForm.Taxes.value))))
	{
	alert("Annual Taxes must be a numeric value only.")
	document.MortgageForm.Taxes.focus();
	tmpValid++
	}

	else if ((!(isFloat(document.MortgageForm.Downpayment.value))) && (!(isWhitespace(document.MortgageForm.Downpayment.value))))
	{
	alert("Downpayment must be a numeric value only.")
	document.MortgageForm.Downpayment.focus();
	tmpValid++
	}

	else if ((isWhitespace(document.MortgageForm.Term.value)))
	{
	alert("The Loan Term (in years) is required.")
	document.MortgageForm.Term.focus();
	tmpValid++
	}
	
	else if (!(isFloat(document.MortgageForm.Term.value)))
	{
	alert("The Loan Term field must be a numeric value only.")
	document.MortgageForm.Term.focus();
	tmpValid++
	}

	else if ((!(isFloat(document.MortgageForm.Assessments.value))) && (!(isWhitespace(document.MortgageForm.Assessments.value))))
	{
	alert("Monthly Assessments must be a numeric value only.")
	document.MortgageForm.Assessments.focus();
	tmpValid++
	}
	
	

if (tmpValid == "0")
{

if (document.MortgageForm.Taxes.value == '') {
document.MortgageForm.Taxes.value = '0';
}

if (document.MortgageForm.Downpayment.value == '') {
document.MortgageForm.Downpayment.value = '0';
}

if (document.MortgageForm.Assessments.value == '') {
document.MortgageForm.Assessments.value = '0';
}

	form = document.MortgageForm
	LoanAmount= form.Price.value
		
	DownPayment= form.Downpayment.value
	AnnualInterestRate = form.Interest.value/100
	Years= form.Term.value
		MonthRate=AnnualInterestRate/12
	NumPayments=Years*12
	Prin=LoanAmount-DownPayment
	MonthPayment=Math.floor((Prin*MonthRate)/(1-Math.pow((1+MonthRate),(-1*NumPayments)))*100)/100
        MonthTax = form.Taxes.value/12
        MonthAssessments = form.Assessments.value - 0
        MonthTotal = MonthPayment + MonthTax + MonthAssessments
	
        
        document.getElementById('dynloadnumpayments').innerHTML=NumPayments.toFixed(0)
	document.getElementById('dynloadmonthpayment').innerHTML='$' + MonthPayment.toFixed(2)
        document.getElementById('dynloadmonthtax').innerHTML='$' + MonthTax.toFixed(2)
        document.getElementById('dynloadmonthassessments').innerHTML='$' + MonthAssessments.toFixed(2)
        document.getElementById('dynloadmonthtotal').innerHTML='$' + MonthTotal.toFixed(2)
}

}


function CalculateMortgageListing(vLP, vTAX, vASM) {
toggle2expand();

if ((isFloat(vLP)))
{
document.MortgageForm.Price.value = vLP;
}
else if (!(isFloat(vLP)))
{
document.MortgageForm.Price.value = 0;
}


if ((isFloat(vTAX)))
{
document.MortgageForm.Taxes.value = vTAX;
}
else if (!(isFloat(vTAX)))
{
document.MortgageForm.Taxes.value = 0;
}


if ((isFloat(vASM)))
{
document.MortgageForm.Assessments.value = vASM;
}
else if (!(isFloat(vASM)))
{
document.MortgageForm.Assessments.value = 0;
}


CalculateMortgage();
}

///////////////////////////////////////////////////////////////////
	
	function CheckLNSearch() {
	var tmpValid = "0"

//alert("ss")
	if (isWhitespace(document.formLN.LN.value) || document.formLN.LN.value =='Enter MLS or Web ID #')
				{
				tmpValid++
				}
				
	
	if (tmpValid == "0") {
	document.getElementById("LN_Label").innerHTML = "Please wait...<BR>"
		document.formLN.submit();
				return (true);
		}
			
		else {
			document.getElementById("LN_Label").innerHTML = "Please Enter a Listing or Web ID Number<BR>"
			return (false)
			}
	}
	
	/////////////////////////////
	
      function setMinPrice() {

          var i = document.form1.maxprice.selectedIndex;

          if( i > 0 && i < document.form1.minprice.selectedIndex )
          {
              document.form1.minprice.options[i-1].selected = true; 
          }
      }

      function setMaxPrice() {

          var i = document.form1.minprice.selectedIndex;

          if( i > 0 &&
              i < (document.form1.minprice.length - 1) )
          {
              if( i > document.form1.maxprice.selectedIndex )
              {
                  document.form1.maxprice.options[i+1].selected = true; 
              }
          }
          else
          {
              document.form1.maxprice.options[0].selected = true; 
          }
      }
		

/////////////////////////////////////////////////////
			
function toggleLoad() {
   document.getElementById("collapse1").style.display = '';
   document.getElementById("expand1").style.display = 'none';
   document.getElementById("collapse2").style.display = 'none';
   document.getElementById("expand2").style.display = '';
   document.getElementById("hidethis1a").style.display = '';
   document.getElementById("hidethis1b").style.display = '';
   document.getElementById("hidethis1c").style.display = '';
   document.getElementById("hidethis2a").style.display = 'none';
}


function toggle1collapse() {
   document.getElementById("expand1").style.display = '';
   document.getElementById("collapse1").style.display = 'none';
   document.getElementById("hidethis1a").style.display = 'none';
   document.getElementById("hidethis1b").style.display = 'none';
   document.getElementById("hidethis1c").style.display = 'none';
}

function toggle1expand() {
   document.getElementById("collapse1").style.display = '';
   document.getElementById("expand1").style.display = 'none';
   document.getElementById("hidethis1a").style.display = '';
   document.getElementById("hidethis1b").style.display = '';
   document.getElementById("hidethis1c").style.display = '';
   document.getElementById("expand2").style.display = '';
   document.getElementById("collapse2").style.display = 'none';
   document.getElementById("hidethis2a").style.display = 'none';
}

function toggle2collapse() {
   document.getElementById("expand2").style.display = '';
   document.getElementById("collapse2").style.display = 'none';
   document.getElementById("hidethis2a").style.display = 'none';
}

function toggle2expand() {
   document.getElementById("collapse2").style.display = '';
   document.getElementById("expand2").style.display = 'none';
   document.getElementById("hidethis2a").style.display = '';
   document.getElementById("expand1").style.display = '';
   document.getElementById("collapse1").style.display = 'none';
   document.getElementById("hidethis1a").style.display = 'none';
   document.getElementById("hidethis1b").style.display = 'none';
   document.getElementById("hidethis1c").style.display = 'none';
}

// for Developments Navigation

function toggle2collapseDevs() {
   document.getElementById("expand2").style.display = '';
   document.getElementById("collapse2").style.display = 'none';
   document.getElementById("hidethis2a").style.display = 'none';
}

function toggle2expandDevs() {
   document.getElementById("collapse2").style.display = '';
   document.getElementById("expand2").style.display = 'none';
   document.getElementById("hidethis2a").style.display = '';

}

///////////////////////////////////////////////////////////////////
//this function updates some viewing values and then refreshes the developments
	function ReFreshDevelopments(ChangedInput,NewValue) {

                document.form1.Developer.value = document.form1.Developer.value;
                document.form1.Neighborhood.value = document.form1.Neighborhood.value;
		document.form1.DevelopmentStatus.value = document.form1.DevelopmentStatus.value;
		document.form1.DevelopmentName.value = document.form1.DevelopmentName.value;			
		document.form1.submit()
		
	}


	function ReFreshVendors(ChangedInput,NewValue) {
			
		document.form1.submit()
		
	}
	

	function PageJump(vPage) {
 
                //document.form1.Developer.value = document.DevSearchForm.Developer.value;
                //document.form1.Neighborhood.value = document.DevSearchForm.Neighborhood.value;
		//document.form1.DevelopmentStatus.value = document.DevSearchForm.DevelopmentStatus.value;
		//document.form1.DevelopmentName.value = document.DevSearchForm.DevelopmentName.value;
                document.form1.CurrentPage.value = vPage;					
		document.form1.submit()
		
	}


	function DeveloperSearch() {
 
                document.form1.Developer.value = document.DevSearchForm.Developer.value;
                document.form1.Neighborhood.value = document.DevSearchForm.Neighborhood.value;
		document.form1.DevelopmentStatus.value = document.DevSearchForm.DevelopmentStatus.value;
		document.form1.DevelopmentName.value = document.DevSearchForm.DevelopmentName.value;					
		document.form1.submit()
		
	}

///////////////////////////////////////////////////////////////////
//this function updates some viewing values and then refeshes chicago-real-estate/listings.asp
	function ReFeshSearchResults(ChangedInput,NewValue) {
		//alert(ChangedInput)
		//alert(NewValue)
		
					
		if (ChangedInput == 'SortBy')  //they are changing the sort by field
			{
			document.SearchNavForm.SearchNavsortby.value = NewValue
			}
		
		if (ChangedInput == 'NumberPerPage')  //they are changing the sort by field
			{
			document.SearchNavForm.SearchNavPropsPerPage.value = NewValue
			}
		
		if (ChangedInput == 'PageNo')  //they are changing the sort by field
			{
			//alert(NewValue)
			document.SearchNavForm.searchPage.value = NewValue
			}
		
		document.SearchNavForm.submit()
		
	}
	

///////////////////////////////////////////////////////////////////
//this function updates the stored properties for "compare" chicago-real-estate/listings.asp
	function UpdateCompareList(WhatField,LN) {
		
		//they are adding to the list		
		if	(document.getElementById(WhatField).checked == true) {  // add this ln to the compare list
			if (document.SearchNavForm.CompareList.value == '')  //no values yet so just add it
				{
				 document.SearchNavForm.CompareList.value = LN
				 }
			else // we have LN's on the list to add it the end
				{
				document.SearchNavForm.CompareList.value = document.SearchNavForm.CompareList.value + ',' + LN 
				}
		}
		
		// they are removing the LN from the list, run the steps below
		if	(document.getElementById(WhatField).checked == false)  // remove this ln from the compare list
			{
				var CheckForMultiple = document.SearchNavForm.CompareList.value.indexOf(','); //checking to see how many ln's we have
					if (CheckForMultiple==-1) // only one ln on the list so just delete it
						{ 
						document.SearchNavForm.CompareList.value = '' 
						}
					else // we have more than one LN pull out the ln they want to remove
						{
						
						var x
						var ArrayValues = document.SearchNavForm.CompareList.value
							
							var arrLnList = new Array()
								arrLnList = ArrayValues.split(',')
								for (x in arrLnList)
									{
									if (arrLnList[x] == LN) // if this is the LN they want out, then remove it
										{
										arrLnList.splice(x,1)
										}
									}
							var NewCompareList = arrLnList.join() // put the array back to a string
							document.SearchNavForm.CompareList.value = NewCompareList
						}
						
			}
		
		
	}
	
	///////////////////////////////////////////////////////////////////
//this function submits the go to detail page value chicago-real-estate/listings.asp
	function ViewDetails(DetailsPage,LN) {
		
		//alert(ChangedInput)
		//alert(NewValue)
					
			document.SearchNavForm.detailPage.value = DetailsPage
		
		//document.SearchNavForm.action = "property-information.asp"
		document.SearchNavForm.action = "log-Detail-view.asp?LN=" + LN
		document.SearchNavForm.submit()
		
	}
	
	
	
	
	///////////////////////////////////////////////////////////////////
//this function opens and center a window
	function winBRopen(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}


//////////////////////////////////////////////////////////////////
		//flip flop article editor
		function showDetailTab(ShowWhat) {
				var description_Level = document.getElementById("description");
				var details_Level = document.getElementById("details");
				var MapPropery_Level = document.getElementById("MapPropery");
				
				if (ShowWhat == 'description')
					 {					
						description_Level.style.display = "block";
						description_Level.style.visibility = "visible";
						details_Level.style.display = "none";
						details_Level.style.visibility = "hidden";
						MapPropery_Level.style.display = "none";
						MapPropery_Level.style.visibility = "hidden";
						//flip flop the tabs
						document.descr.src= "/images/descr_on.jpg"
						document.detail.src= "/images/detail_off.jpg"
						document.listingmap.src= "/images/map_off.jpg"
					}
					
					else if (ShowWhat == 'details')
						{
							details_Level.style.display = "block";
							details_Level.style.visibility = "visible";
							description_Level.style.display = "none";
							description_Level.style.visibility = "hidden";
							MapPropery_Level.style.display = "none";
							MapPropery_Level.style.visibility = "hidden";
							//flip flop the tabs
							document.descr.src= "/images/descr_off.jpg"
							document.detail.src= "/images/detail_on.jpg"
							document.listingmap.src= "/images/map_off.jpg"
						}
					
					else if (ShowWhat == 'MapPropery')
						{
							MapPropery_Level.style.display = "block";
							MapPropery_Level.style.visibility = "visible";
							details_Level.style.display = "none";
							details_Level.style.visibility = "hidden";
							description_Level.style.display = "none";
							description_Level.style.visibility = "hidden";
							//flip flop the tabs
							document.descr.src= "/images/descr_off.jpg"
							document.detail.src= "/images/detail_off.jpg"
							document.listingmap.src= "/images/map_on.jpg"
						}
							
			}
			
	
	//////////////////////////////////////////////////////////////////
		//flip flop article editor
		function ChangeContactTab(ShowWhat) {
				var ContactAgent_Level = document.getElementById("ContactAgent");
				var SendToFriend_Level = document.getElementById("SendToFriend");
				
				if (ShowWhat == 'ContactAgent')
					 {					
						ContactAgent_Level.style.display = "block";
						ContactAgent_Level.style.visibility = "visible";
						SendToFriend_Level.style.display = "none";
						SendToFriend_Level.style.visibility = "hidden";
						//flip flop the tabs
						document.sendAgent.src= "/images/contactAgent_on.jpg"
						document.sendfriend.src= "/images/SendToFriend_off.jpg"
						
					}
					
					else if (ShowWhat == 'SendToFriend')
						{
						SendToFriend_Level.style.display = "block";
						SendToFriend_Level.style.visibility = "visible";
						ContactAgent_Level.style.display = "none";
						ContactAgent_Level.style.visibility = "hidden";
						
						//flip flop the tabs
						document.sendAgent.src= "/images/contactAgent_off.jpg"
						document.sendfriend.src= "/images/SendToFriend_on.jpg"
						}
			}
			
			
//////////////////////////////////////////////////////////////////
		//check contact agent /includes/property-details.asp
		function checkContactAgent(){
			var tmpValid = "0"
			if (isWhitespace(document.formAgentContact.name.value))
				{
				tmpValid++
				
				}
				
		else if (!(isEmail(document.formAgentContact.email.value)))
				{
				tmpValid++
				
				}
		
		if (tmpValid == "0") {
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			
			else {
				document.getElementById("displayfields").style.display = "block";
				document.getElementById("displayfields").style.visibility = "visible";
				
				return (false)
				}
		}


//////////////////////////////////////////////////////////////////
		//checks send to firend on /includes/property-details.asp
		function checkSendToFriend(){
			var tmpValid = "0"
		if (isWhitespace(document.formSendToFriend.fromname.value))
				{
				tmpValid++
				}
				
		else if (!(isEmail(document.formSendToFriend.fromemail.value)))
				{
				tmpValid++
				}
		
		else if (isWhitespace(document.formSendToFriend.toname.value))
				{
				tmpValid++
				}
				
		else if (!(isEmail(document.formSendToFriend.toemail.value)))
				{
				tmpValid++
				}
		
		if (tmpValid == "0") {
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			
			else {
				document.getElementById("displaysendtofriend").style.display = "block";
				document.getElementById("displaysendtofriend").style.visibility = "visible";
				
				return (false)
				}
		}
			
	//////////////////////////////////////
			
	//////////////////////////////////////
		function scrollWindow(v,h)
		{
		window.scrollTo(v,h)
		}
////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//Registration Page Functions

function CheckRegUpdate(){

var tmpValid = "0"

	if ((isWhitespace(document.RegForm.FirstName.value)))
	{
	alert("First Name is required.")
	document.RegForm.FirstName.focus();
	tmpValid++
	}
	
	else if ((isWhitespace(document.RegForm.LastName.value)))
	{
	alert("Last Name is required.")
	document.RegForm.LastName.focus();
	tmpValid++
	}

	else if ((isWhitespace(document.RegForm.Email.value)))
	{
	alert("Email is required.")
	document.RegForm.Email.focus();
	tmpValid++
	}
	
	else if (!(isEmail(document.RegForm.Email.value)))
	{
	alert("The Email Address you specified is not valid.  Please try again.")
	document.RegForm.Email.focus();
	tmpValid++
	}
	
	else if ((isWhitespace(document.RegForm.Password.value)))
	{
	alert("Password is required.")
	document.RegForm.Password.focus();
	tmpValid++
	}
	
	
	else if ((isWhitespace(document.RegForm.VerifyPassword.value)))
	{
	alert("Please confirm your Password is correct by typing it in again.")
	document.RegForm.VerifyPassword.focus();
	tmpValid++
	}
	
	
	else if (!((document.RegForm.Password.value) == (document.RegForm.VerifyPassword.value)))
	{
	alert("The verification Password you entered is the same as the specified Password value.\nPlease try again.")
	document.RegForm.Password.focus();
	tmpValid++
	}

        
	
	

if (tmpValid == "0")
{
document.RegForm.submit();
}

}


////////////////////////////////////
function confirm_DeleteFav(id){
				var Vendor
				
				if (confirm("Deleting the property will permenetly remove it form your favorite list. You can not undo this action.\n Are you sure you want to continue? Click OK to delete this property. Click Cancel to do nothing")) {
					location.href="doDeleteFavorite.asp?id=" + id;
				}
				else {
					//do nothing
				}       
			}
//////////////////////////////////////////////////////////////////

function CheckAdvancedSearch() {
	var tmpValid = "0"
	//alert(document.form1.TYP.selectedIndex)
	if (document.form1.TYP.selectedIndex <= 0)
				{
				document.getElementById("TYP_Label").innerHTML = " * Required"
				tmpValid++
				}
	
	if (document.form1.area.selectedIndex <= 0)
				{
				document.getElementById("Area_Label").innerHTML = " * Required<BR>"
				tmpValid++
				}
	
	
	if (tmpValid == "0") {
			document.getElementById("TYP_Label").innerHTML = ""
			document.getElementById("Area_Label").innerHTML = ""
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=10px; color=CC0000'><b>Searching\, please wait...</b></span><BR><BR>"
			return (true);
		}
			
		else {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=10px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continueing</b></span><BR><BR>"
			return (false)
			}
	}
	
	//////////////////////////////////////////////////////////////////
		//flip flop article editor
		function showAdvancedOptions(ShowWhat,whatimage) {
				var description_Level = document.getElementById(ShowWhat);
				var details_Level = document.getElementById("details");
				var MapPropery_Level = document.getElementById("MapPropery");
				
				if (document.getElementById(ShowWhat).style.display == "none")
					 {					
						document.getElementById(ShowWhat).style.display = "block";
						document.getElementById(ShowWhat).style.visibility = "visible";
						
						//flip flop the tabs
						
						document.getElementById(whatimage).src= "/images/beginhomesearch.jpg"
						//document.detail.src= "/images/detail_off.jpg"
						
					}
					
					else 
						{
						document.getElementById(ShowWhat).style.display = "none";
						document.getElementById(ShowWhat).style.visibility = "hidden";
						
						//flip flop the tabs
						document.getElementById(whatimage).src= "/images/beginhomesearch.jpg"
						}
					
					
							
			}
	
//////////////////////////////////////////////////////////////////
		//flip flop Search Name Box
		function ShowSaveBox(ShowWhat) {
				var description_Level = document.getElementById(ShowWhat);
				
				
				if (document.getElementById(ShowWhat).style.display == "none")
					 {					
						document.getElementById(ShowWhat).style.display = "block";
						document.getElementById(ShowWhat).style.visibility = "visible";
						
					}
					
					else 
						{
						document.getElementById(ShowWhat).style.display = "none";
						document.getElementById(ShowWhat).style.visibility = "hidden";
						
						}
					
					
							
			}

///////////////////////////////////////////////////////////////////