function updateFilterFields(savedSearchId) { if ( savedSearchId > "" ) { //get the filter parameters for the Saved_Search with Saved_Search_Id = savedSearchId $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=getsavedsearch&savedsearchid=" + savedSearchId, success: function(xml) { if ( $("status", xml).text() == "OK") { $("#MinBedrooms").val( $("minbedrooms", xml).text() ); $("#MinBedrooms").val( $("minbedrooms", xml).text() ); $("#MinBathrooms").val( $("minbathrooms", xml).text() ); $("#MinSqFt").val( $("minsqft", xml).text() ); $("#MinAcreage").val( $("minacreage", xml).text() ); $("#MinPrice").val( $("minprice", xml).text() ); $("#MaxPrice").val( $("maxprice", xml).text() ); $("#PropertyType").val( $("propertytype", xml).text() ); $("#PropertyStyle").val( $("propertystyle", xml).text() ); $("#City").val( $("city", xml).text() ); $("#County").val( $("county", xml).text() ); $("#Zip").val( $("zip", xml).text() ); $("#DeleteSearch").show(); } else { alert("not ok"); } } }); } else { $("#DeleteSearch").hide(); } } function showLoginBar() { //see if we are currently logged in if ( $("#loginlink").text() == "log out" ) { //logged in... $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=logout", success: function(msg) { if ( msg == 'OK') { //$("#loginlink").text("login"); //$("#loginwelcomemsg").text(""); //We now need to refresh the page to handle issues if we are in the user center area. If we are in the user center, this will kick us out to the login page. location.reload(true); } } }); } else { //not logged in... if (get_cookie("loginusername")>"") { $("#chkRememberLogin").get(0).checked = true; } $("#loginUserName").val(get_cookie("loginusername")); $("#loginPassword").val(get_cookie("loginpassword")); $("#loginbar").slideToggle("fast"); if ( $("#loginlink").text() == "login" ) { $("#loginlink").text("close"); } else { $("#loginlink").text("login"); } } } function checkUsernameAvailable() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=checkusername&username=" + $("#username").val(), success: function(msg) { if (msg == "AVAILABLE") { alert("The user name " + $("#username").val() + " IS avalable!"); } else { alert("This user name is NOT avalable. Please choose a different user name."); } } }); } function checkLoginFromLoginBar() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=login&username=" + $("#loginUserName").val() + "&password="+ $("#loginPassword").val(), success: function(msg) { if (msg > "") { document.cookie="userfirstname=" + msg; //showLoggedIn(); if ($("#chkRememberLogin").get(0).checked) { document.cookie="loginusername=" + $("#loginUserName").val() + "; expires=Fri, 1 Jul 2044 20:47:11 UTC"; document.cookie="loginpassword=" + $("#loginPassword").val() + "; expires=Fri, 1 Jul 2044 20:47:11 UTC"; } else { document.cookie="loginusername="; document.cookie="loginpassword="; } location.reload(true); } else { //$("#ErrorMsg").html("Invalid user name / password!"); //Need to redirect to a full login page window.location="loginfo.asp"; alert("Invalid user name / password!"); } } }); } function showLoggedIn() { if ( $("#loginlink").text() == "close" ) { $("#loginbar").slideToggle("fast"); } $("#loginlink").text("log out"); $("#loginwelcomemsg").text("Welcome " + get_cookie("userfirstname") + "!"); } function showLogin() { strHtml = "

Login to your HomesByOwner account

" strHtml += "" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
" strHtml += " :
" strHtml += "" strHtml += " :
 
" strHtml += "

Not a Member? Sign up for free today!

" //strHtml += "

Sign up for free today

" strHtml += "" strHtml += "" strHtml += "      " $("#mybox").html(strHtml); } function showRegister() { strHtml = "

Register for your free Buyer Match account

" strHtml += "
" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " //strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
" strHtml += " :
" strHtml += " :
" strHtml += "
If you forget your password, we will ask you the question you select from the list below. If the answer you provide at that time matches the answer you submit below, we will send your account information to your email address.
" //strHtml += "" //strHtml += " " //strHtml += "
" //strHtml += "" //strHtml += " :

" strHtml += " :
" strHtml += " :
" strHtml += " : - -   Ext.
" strHtml += " :

To ensure the home sellers on this site are protected from third-party entities inappropriately using this system for solicitation, you agree that by registering for this account, you may be contacted via email or phone to verify that you are a home buyer and not a commercial company, mortgage broker, or realtor. If you are using this system for commercial purposes we reserve the right to terminate your account.
 
" $("#mybox").html(strHtml); } function registerUser() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=registeruser&Users_User_Name=" + $("#username").val() + "&Users_Password=" + $("#password").val() + "&Users_Password_Verify=" + $("#password2").val() + "&Users_First_Name=" + $("#firstname").val() + "&Users_Last_Name=" + $("#lastname").val() + "&Users_Email=" + $("#email").val() + "&Users_Phone_PrimaryA=" + $("#phone1").val() + "&Users_Phone_PrimaryB=" + $("#phone2").val() + "&Users_Phone_PrimaryC=" + $("#phone3").val() + "&Users_Phone_PrimaryD=" + $("#phone4").val() + "&trackall=" + $("#trackall").get(0).checked, success: function(msg) { if (msg == "OK") { document.cookie="userfirstname=" + $("#firstname").val(); switch ( $("#screen").val() ) { case "SAVEFAVORITE": showFavorite(); break; case "SAVESEARCH": showSaveSearch(); break; case "EMAILPROPERTIES": showEmailProperties(true); break; } showLoggedIn(); alert("Thank you for registering!"); } else { alert(msg); } } }); } function saveTrackAll() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=saveTrackAll&trackall=" + $("input[@name=trackall]")[0].checked, success: function(msg) { if (msg == 'OK') { $("#ResultsMsg").html("Your choice has been saved!"); $( "input[@name='cancel']:eq(0)").val('Done') ; } else { $("#ResultsMsg").html("Error updating your choice. Please try again!"); } } }); } function showEmailProperties(isFinished) { //isFinished is set to true if the user has just registered their account. if ( ! isFinished ) { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=checkTrackAll", success: function(msg) { if ( msg == "TRUE" ) { $("input[@name=trackall]")[0].checked = "CHECKED"; } } }); strHtml = "

Email Notification

" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
" strHtml += "  
" } else { strHtml = "

Email Notifications

" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
You are signed up to receive email notifications of new and changed properties.
" } $("#mybox").html(strHtml); } function showSaveSearch() { strHtml = "

Saved Search

" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
Name your search:
Email me when properties like these are added or changed
 
" $("#mybox").html(strHtml); //See if this is an existing saved search $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=checkSavedSearch&filterurl="+ $("input[@name=filterurl]").val(), success: function(msg) { if ( ! (msg == "NOSAVEDSEARCH")) { $( "input[@name='add']:eq(0)").val('Update Saved Search') ; $( "input[@name='searchname']:eq(0)").val( msg.substr(1) ); //if ( msg.substr(0,1) == '1' ) { // $("input[@name=tracksearch]")[0].checked = "CHECKED"; //} } else { //This is not an existing saved search $( "input[@name='searchname']:eq(0)").val( $("input[@name=filterstr]").val() ) ; } } }); } function showFavorite() { //See if this is an existing favorite $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=checkfavorite&source=" + $("input[@name=source]").val() + "&home_id="+ $("input[@name=home_id]").val(), success: function(msg) { if ( ! (msg == "NOCOMMENTS")) { $("#comments").val(msg); $( "input[@name='add']:eq(0)").val('Update Note') ; $( "input[@name='delete']:eq(0)").show() ; //$( "input[@name='cancel']:eq(0)").val('Done') ; } else { //This is not an existing favorite } } }); strHtml = "

Favorite - " + $("input[@name=address]").val() + "   view all my favorites

" strHtml += ""; strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += " " strHtml += "
You can save any notes you wish to make about " + $("input[@name=address]").val() + " here:
  
" $("#mybox").html(strHtml); } function checkLogin() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=login&username=" + $("#username").val() + "&password="+ $("#password").val(), success: function(msg) { if (msg > "") { switch ( $("#screen").val() ) { case "SAVEFAVORITE": showFavorite(); break; case "SAVESEARCH": showSaveSearch(); break; case "EMAILPROPERTIES": showEmailProperties(false); } showLoggedIn(); $("#loginwelcomemsg").text("Welcome " + msg + "!"); } else { $("#ErrorMsg").html("Invalid user name / password!"); } } }); } function saveSearch() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=addsearch&name=" + escape($("input[@name=searchname]").val()) + "&tracksearch=" + $("input[@name=tracksearch]")[0].checked + "&filterurl="+ $("input[@name=filterurl]").val(), success: function(msg) { if (msg == 'OK') { $("#ResultsMsg").html("Your saved search has been saved!"); $( "input[@name='add']:eq(0)").val('Update Search') ; $( "input[@name='cancel']:eq(0)").val('Done') ; } else { $("#ResultsMsg").html("Error updating your saved search. Please try again!"); } } }); } function deleteSearch(savedSearchId) { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=deletesavedsearch&savedsearchid=" + savedSearchId, success: function(msg) { if (msg == 'OK') { location.reload(true); } else { alert("Error deleting your saved search - please try again.") } } }); } function deleteFavorite(favoriteId) { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=deletefavorite&source=" + $("input[@name=source]").val() + "&home_id="+ $("input[@name=home_id]").val(), success: function(msg) { if (msg == 'OK') { location.reload(true); } else { alert("Error deleting your favorite home - please try again.") } } }); } function addFavorite() { $.ajax({ type: "POST", url: "favorites_xml.asp", data: "function=addfavorite&source=" + $("input[@name=source]").val() + "&home_id="+ $("input[@name=home_id]").val() + "&comments=" + escape($("#comments").val()), success: function(msg) { if (msg == 'OK') { $("#ResultsMsg").html("Your favorite has been saved!"); $( "input[@name='add']:eq(0)").val('Update Note') ; $( "input[@name='delete']:eq(0)").show() ; $( "input[@name='cancel']:eq(0)").val('Done') ; } else { $("#ResultsMsg").html("Error updating your favorites. Please try again!"); } } }); }