Skip to content

Instantly share code, notes, and snippets.

@lswilson
Created January 3, 2014 16:09
Show Gist options
  • Save lswilson/8240518 to your computer and use it in GitHub Desktop.
Save lswilson/8240518 to your computer and use it in GitHub Desktop.
find a rental: advice.min.js
;(function($){var locOpts={},$locAutocomplete=$("#location-autocomplete");if(typeof window.baseSvcUrl!=="undefined")locOpts.baseSvcUrl=window.baseSvcUrl;if(typeof window.baseValidationUrl!=="undefined")locOpts.baseValidationUrl=window.baseValidationUrl;if($locAutocomplete.length)$locAutocomplete.locationAutocomplete(locOpts);if(!Modernizr.input.placeholder)$("input[type=text]").each(function(){var $input=$(this),placeholder=$input.attr("placeholder");if(!placeholder)return true;$input.setVal=function(){if($input.is(":focus")){$input.removeClass("quiet");
if($input.val()===placeholder){$input.val("");$input.trigger("focus")}}else if($input.val()==="")$input.val(placeholder).addClass("quiet");else $input.removeClass("quiet")};$input.setVal();$input.on("focus blur change",function(){$input.setVal()})});$(document).ready(function(){var blogLocOpts={urlPrepend:"http://www.realtor.com/realestateandhomes-search/",urlAppend:""};if(typeof window.baseSvcUrl!=="undefined")blogLocOpts.baseSvcUrl=window.baseSvcUrl;if(typeof window.baseValidationUrl!=="undefined")blogLocOpts.baseValidationUrl=
window.baseValidationUrl;var $blogFindAHome=$("#find-a-home-loc"),$blogFindARental=$("#find-a-rental-loc");if($blogFindAHome.length)$blogFindAHome.locationAutocomplete(blogLocOpts);if($blogFindARental.length)$blogFindARental.locationAutocomplete({urlPrepend:"http://www.realtor.com/homesforrent/",urlAppend:""});(function(){var $body=$("body");$("#uscToolbarB").click(function(){$body.removeClass("ucstoolbar-open ucstoolbar-closed")});$("#uscToolbarA").click(function(){$body.removeClass("ucstoolbar-open ucstoolbar-closed")});
if(!window.MV)window.MV={};$.extend(true,window.MV,{util:{Cookie:{getSub:function(cookieName,subVar){try{var searchID=utils.ReadCookie(cookieName);if(searchID)searchID=utils.parseUrlVars(searchID)[subVar];return searchID?searchID:""}catch(e){}}}}})})()})})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment