function FAClicktoCall(b,a,d,c){DoReport(d,c)}function FAEmailAgent(a,c,b){EmailAgent(a,"idlisting",c)}function FAAgentDirectory(a,c,b){ClearSearchCookie(RecordType.Agent);window.setTimeout(function(){window.open(a,"_new")},100);DoReport(c,b)}function FAListingDetail(b,c,a){ClearSearchCookie(RecordType.Agent);window.setTimeout(function(){top.location.href=b},100);DoReport(c,a)}$(function(){if($("#dialog-wrap").length==0){$(document.body).prepend($('<div id="dialog-wrap"></div>'))}});;function FLListingDetail(b,c,a){ClearSearchCookie(RecordType.Listing);a=typeof(isResults)!="undefined"?505:506;DoReport(c,a);top.location.href=b}var ErrorImg=Static+"/Reno/GlobalResources/Images/NoPhoto_150x118.jpg";function THUMLoaded(a){$(".thumb-loader").hide();$("#THUM-"+a).fadeTo(1,1)}function THUMErr(a){$("#THUM-"+a).attr("src",ErrorImg);THUMLoaded(a)};;function MortgageCalc(c){c=c.replace("$","").replace(/,/g,"");var b=/\.00$/;if(b.test(c)){c=c.replace(b,"")}var a="/reno/widgets/mortgagecalc/mortgagecalc.aspx?price="+c;ShowDialog(a,function(){MC.calculateMortgage()});$("#MC-AskPrice").keyup(function(d){$("#MC-AskPrice").val(FormatCurrencyForCulture($("#MC-AskPrice").val().asNumber()))})}function FlashClickToCall(c){var b=300;var d=125;var a="/reno/widgets/video/featuredagent/clicktocall.aspx?n="+escape(c);ShowDialog(a,b,d)}function EmailBroker(b,a){EmailAgent(b,"idbroker",a)}function EmailAgent(d,b,a){var c="/reno/widgets/emailagent/emailagent.aspx?"+b+"="+d+"&reportData="+escape(a)+"&referrer="+escape(window.location.href);ShowDialog(c,function(){$("#agent_form").validate({rules:{email_agent_user_name:{required:true},email_agent_user_email:{required:true,email:true},email_agent_user_message:{required:true}}})})}function EmailFriend(f,b,a,c){if(c==undefined){c=""}var e="";if(SiteLang!=null){e="/"+SiteLang}var d=e+"/reno/widgets/emailfriend/emailfriend.aspx?"+b+"="+f+"&reportData="+escape(a)+"&referrer="+escape(window.location.href)+"&canonical="+escape(c);ShowDialog(d,function(){jQuery.validator.addMethod("emails",function(g,h){return this.optional(h)||/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*(\s*[,]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*(\s*([,])?\s*)?$/.test(g)},"Invalid email address(es)");$("#friend_form").validate({rules:{email_friend_user_name:{required:true},email_friend_user_email:{required:true,email:true},email_friend_email:{required:true,emails:true}}})})}function SendToCell(a){URL=window.location.href+"/send-cell?message="+a;ShowDialog(URL,function(){$("#sendtocell_form").validate({rules:{sendtocell_phone:{required:true,number:true},sendtocell_to_email:{required:true}},messages:{sendtocell_to_email:"Select a cell carrier",sendtocell_phone:"Please provide numbers only"},errorPlacement:function(c,b){if(b[0]==$("#sendtocell_to_email")[0]){$("#sendtocell_to_email").parent().append(c)}else{if(b[0]==$("#sendtocell_phone")[0]){$("#sendtocell_phone").parent().append(c)}}}})})}function VideoOnDemand(b){var a="<br/><div style='height:250px' id='flashcontent-"+b+"'></div>";$.modal(a,{minWidth:320,onShow:function(){swap_flash(".has_flash");swfobject.embedSWF("/reno/widgets/video/swf/featured.20110413.swf","flashcontent-"+b,"300","250","9",false,{lid:b,isFeaturedListing:"false",xmlPath:"/reno/widgets/video/videoondemand/getxml.aspx",key:"wR/4ANbN9n76THZ6zoiPU6SD81NaTlyIsSJdpfbziAE=",autoplay:"true"},{},{"class":"GL_flashPlayer"})},onClose:function(){$.modal.close();swap_flash(".has_flash")}})};;var PlayButton;var stepcarousel={ajaxloadingmsg:'<div style="margin: 1em; font-weight: bold"><img src="ajaxloadr.gif" style="vertical-align: middle" /> Fetching Content. Please wait...</div>',defaultbuttonsfade:0.4,configholder:{},getCSSValue:function(a){return(a=="auto")?0:parseInt(a)},getremotepanels:function(b,a){a.$belt.html(this.ajaxloadingmsg);b.ajax({url:a.contenttype[1],async:true,error:function(c){a.$belt.html("Error fetching content.<br />Server Response: "+c.responseText)},success:function(c){a.$belt.html(c);a.$panels=a.$gallery.find("."+a.panelclass);stepcarousel.alignpanels(b,a)}})},getoffset:function(b,a){return(b.offsetParent)?b[a]+this.getoffset(b.offsetParent,a):b[a]},getCookie:function(b){var a=new RegExp(b+"=[^;]+","i");if(document.cookie.match(a)){return document.cookie.match(a)[0].split("=")[1]}return null},setCookie:function(a,b){document.cookie=a+"="+b},fadebuttons:function(a,b){a.$leftnavbutton.fadeTo("fast",b==0?this.defaultbuttonsfade:1);a.$rightnavbutton.fadeTo("fast",b==a.lastvisiblepanel?this.defaultbuttonsfade:1);if(b==a.lastvisiblepanel){stepcarousel.stopautostep(a)}},addnavbuttons:function(c,a,b){a.$leftnavbutton=c('<img src="'+a.defaultbuttons.leftnav[0]+'">').css({zIndex:50,position:"absolute",left:a.offsets.left+a.defaultbuttons.leftnav[1]+"px",top:a.offsets.top+a.defaultbuttons.leftnav[2]+"px",cursor:"hand",cursor:"pointer"}).attr({title:"Back "+a.defaultbuttons.moveby+" panels"}).appendTo("body");a.$rightnavbutton=c('<img src="'+a.defaultbuttons.rightnav[0]+'">').css({zIndex:50,position:"absolute",left:a.offsets.left+a.$gallery.get(0).offsetWidth+a.defaultbuttons.rightnav[1]+"px",top:a.offsets.top+a.defaultbuttons.rightnav[2]+"px",cursor:"hand",cursor:"pointer"}).attr({title:"Forward "+a.defaultbuttons.moveby+" panels"}).appendTo("body");a.$leftnavbutton.bind("click",function(){stepcarousel.stepBy(a.galleryid,-a.defaultbuttons.moveby)});a.$rightnavbutton.bind("click",function(){stepcarousel.stepBy(a.galleryid,a.defaultbuttons.moveby)});if(a.panelbehavior.wraparound==false){this.fadebuttons(a,b)}return a.$leftnavbutton.add(a.$rightnavbutton)},alignpanels:function(g,b){var f=0;b.paneloffsets=[f];b.panelwidths=[];b.$panels.each(function(k){var i=g(this);i.css({"float":"none",position:"absolute",left:f+"px"});i.bind("click",function(l){return b.onpanelclick(l.target)});f+=stepcarousel.getCSSValue(i.css("marginRight"))+parseInt(i.get(0).offsetWidth||i.css("width"));b.paneloffsets.push(f);b.panelwidths.push(f-b.paneloffsets[b.paneloffsets.length-2])});b.paneloffsets.pop();var c=0;var j=b.$panels.length-1;b.lastvisiblepanel=j;for(var e=b.$panels.length-1;e>=0;e--){c+=(e==j?b.panelwidths[j]:b.paneloffsets[e+1]-b.paneloffsets[e]);if(b.gallerywidth>c){b.lastvisiblepanel=e}}b.$belt.css({width:f+"px"});b.currentpanel=(b.panelbehavior.persist)?parseInt(this.getCookie(b.galleryid+"persist")):0;b.currentpanel=(typeof b.currentpanel=="number"&&b.currentpanel<b.$panels.length)?b.currentpanel:0;var a=b.paneloffsets[b.currentpanel]+(b.currentpanel==0?0:b.beltoffset);b.$belt.css({left:-a+"px"});if(b.defaultbuttons.enable==true){var d=this.addnavbuttons(g,b,b.currentpanel);g(window).bind("load resize",function(){b.offsets={left:stepcarousel.getoffset(b.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(b.$gallery.get(0),"offsetTop")};b.$leftnavbutton.css({left:b.offsets.left+b.defaultbuttons.leftnav[1]+"px",top:b.offsets.top+b.defaultbuttons.leftnav[2]+"px"});b.$rightnavbutton.css({left:b.offsets.left+b.$gallery.get(0).offsetWidth+b.defaultbuttons.rightnav[1]+"px",top:b.offsets.top+b.defaultbuttons.rightnav[2]+"px"})})}if(b.autostep&&b.autostep.enable){var h=b.$gallery.add(typeof d!="undefined"?d:null);h.bind("click",function(){b.autostep.status="stopped";stepcarousel.stopautostep(b)});h.mouseenter(function(){stepcarousel.stopautostep(b);b.autostep.hoverstate="over";jQuery("#fa_statusD").html("[paused] "+PlayButton)});b.steptimer=setInterval(function(){stepcarousel.autorotate(b.galleryid)},b.autostep.pause)}this.createpaginate(g,b);this.statusreport(b.galleryid);b.oninit();b.onslideaction(this)},restartCarousel:function(b){var a=stepcarousel.configholder[b];a.steptimer=setInterval(function(){stepcarousel.autorotate(b)},a.autostep.pause);a.autostep.hoverstate="out";jQuery("#fa_statusD").html("");this.stepBy(b,1,true)},stepTo:function(d,b){var c=stepcarousel.configholder[d];if(typeof c=="undefined"){return}stepcarousel.stopautostep(c);var b=Math.min(b-1,c.paneloffsets.length-1);var a=c.paneloffsets[b]+(b==0?0:c.beltoffset);if(c.panelbehavior.wraparound==false&&c.defaultbuttons.enable==true){this.fadebuttons(c,b)}c.$belt.animate({left:-a+"px"},c.panelbehavior.speed,function(){c.onslideaction(this)});c.currentpanel=b;this.statusreport(d)},stepBy:function(f,a,e){var c=stepcarousel.configholder[f];if(typeof c=="undefined"){return}if(!e){stepcarousel.stopautostep(c)}var g=(a>0)?"forward":"back";var d=c.currentpanel+a;if(c.panelbehavior.wraparound==false){d=(g=="back"&&d<=0)?0:(g=="forward")?Math.min(d,c.lastvisiblepanel):d;if(c.defaultbuttons.enable==true){stepcarousel.fadebuttons(c,d)}}else{if(d>c.lastvisiblepanel&&g=="forward"){d=(c.currentpanel<c.lastvisiblepanel)?c.lastvisiblepanel:0}else{if(d<0&&g=="back"){d=(c.currentpanel>0)?0:c.lastvisiblepanel}}}var b=c.paneloffsets[d]+(d==0?0:c.beltoffset);if(d==0&&g=="forward"||c.currentpanel==0&&g=="back"&&c.panelbehavior.wraparound==true){c.$belt.animate({left:-c.paneloffsets[c.currentpanel]-(g=="forward"?100:-30)+"px"},"normal",function(){c.$belt.animate({left:-b+"px"},c.panelbehavior.speed,function(){c.onslideaction(this)})})}else{c.$belt.animate({left:-b+"px"},c.panelbehavior.speed,function(){c.onslideaction(this)})}c.currentpanel=d;this.statusreport(f)},autorotate:function(b){var a=stepcarousel.configholder[b];this.stepBy(b,a.autostep.moveby,true)},stopautostep:function(a){clearTimeout(a.steptimer)},statusreport:function(e){var d=stepcarousel.configholder[e];if(d.statusvars.length==3){var g=d.currentpanel;var a=0;for(var c=g;c<d.paneloffsets.length;c++){a+=d.panelwidths[c];if(a>d.gallerywidth){break}}g+=1;c=(c+1==g)?g:c;var f=[g,c,d.panelwidths.length];for(var b=0;b<d.statusvars.length;b++){window[d.statusvars[b]]=f[b];d.$statusobjs[b].text(f[b]+" ")}}stepcarousel.selectpaginate(jQuery,e)},createpaginate:function(j,b){if(b.$paginatediv.length==1){var c=b.$paginatediv.find('img["data-over"]:eq(0)');var m=[],k=[],a=[],e=c.attr("data-moveby")||1;var f=(e==1?0:1)+Math.floor((b.lastvisiblepanel+1)/e);var l=j("<div>").append(c.clone()).html();srcs=[c.attr("src"),c.attr("data-over"),c.attr("data-select")];for(var g=0;g<f;g++){var d=Math.min(g*e,b.lastvisiblepanel);a.push(l.replace(/>$/,' data-index="'+g+'" data-moveto="'+d+'" title="Move to Panel '+(d+1)+'">')+"\n");m.push(d)}var h=j("<span></span>").replaceAll(c).append(a.join("")).find("img");h.css({cursor:"pointer"});b.$paginatediv.bind("click",function(i){var n=j(i.target);if(n.is("img")&&n.attr("data-over")){stepcarousel.stepTo(b.galleryid,parseInt(n.attr("data-moveto"))+1)}});b.$paginatediv.bind("mouseover mouseout",function(i){var n=j(i.target);if(n.is("img")&&n.attr("data-over")){if(parseInt(n.attr("data-index"))!=b.pageinfo.curselected){n.attr("src",srcs[(i.type=="mouseover")?1:0])}}});b.pageinfo={controlpoints:m,$controls:h,srcs:srcs,prevselected:null,curselected:null}}},selectpaginate:function(d,c){var b=stepcarousel.configholder[c];if(b.$paginatediv.length==1){for(var a=0;a<b.pageinfo.controlpoints.length;a++){if(b.pageinfo.controlpoints[a]<=b.currentpanel){}b.pageinfo.curselected=a}if(typeof b.pageinfo.prevselected!=null){b.pageinfo.$controls.eq(b.pageinfo.prevselected).attr("src",b.pageinfo.srcs[0])}b.pageinfo.$controls.eq(b.pageinfo.curselected).attr("src",b.pageinfo.srcs[2]);b.pageinfo.prevselected=b.pageinfo.curselected}},loadcontent:function(c,a){var b=stepcarousel.configholder[c];b.contenttype=["ajax",a];stepcarousel.stopautostep(b);stepcarousel.resetsettings($,b);stepcarousel.init(jQuery,b)},init:function(b,a){PlayButton=jQuery("#fa_statusD").html();jQuery("#fa_statusD").html("");a.gallerywidth=a.$gallery.width();a.offsets={left:stepcarousel.getoffset(a.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(a.$gallery.get(0),"offsetTop")};a.$belt=a.$gallery.find("."+a.beltclass);a.$panels=a.$gallery.find("."+a.panelclass);a.$paginatediv=b("#"+a.galleryid+"-paginate");if(a.autostep){a.autostep.pause+=a.panelbehavior.speed}a.onpanelclick=(typeof a.onpanelclick=="undefined")?function(c){}:a.onpanelclick;a.onslideaction=(typeof a.onslide=="undefined")?function(){}:function(c){b(c).stop();a.onslide()};a.oninit=(typeof a.oninit=="undefined")?function(){}:a.oninit;a.beltoffset=stepcarousel.getCSSValue(a.$belt.css("marginLeft"));a.statusvars=a.statusvars||[];a.$statusobjs=[b("#"+a.statusvars[0]),b("#"+a.statusvars[1]),b("#"+a.statusvars[2])];a.currentpanel=0;stepcarousel.configholder[a.galleryid]=a;if(a.contenttype[0]=="ajax"&&typeof a.contenttype[1]!="undefined"){stepcarousel.getremotepanels(b,a)}else{stepcarousel.alignpanels(b,a)}},resetsettings:function(b,a){a.$gallery.unbind();a.$belt.stop();a.$panels.remove();if(a.$leftnavbutton){a.$leftnavbutton.remove();a.$rightnavbutton.remove()}if(a.$paginatediv.length==1){a.$paginatediv.unbind();a.pageinfo.$controls.eq(0).attr("src",a.pageinfo.srcs[0]).removeAttr("data-index").removeAttr("data-moveto").removeAttr("title").end().slice(1).remove()}if(a.autostep){a.autostep.status=null}if(a.panelbehavior.persist){stepcarousel.setCookie(window[a.galleryid+"persist"],0)}},setup:function(a){document.write('<style type="text/css">\n#'+a.galleryid+"{overflow: hidden;}\n</style>");jQuery(document).ready(function(b){a.$gallery=b("#"+a.galleryid);stepcarousel.init(b,a)});jQuery(window).bind("unload",function(){stepcarousel.resetsettings($,a);if(a.panelbehavior.persist){stepcarousel.setCookie(a.galleryid+"persist",a.currentpanel)}jQuery.each(a,function(b,c){c=null});a=null})}};;function Pager(h){var b=$("ol",h),c=$("a.next",h),g=$("a.previous",h),f=$("#current-list",h),a=$("#total-lists",h),e=b.length,d=0;b.hide();b.eq(d).show();prev=function(){if(d<=0){return}else{b.hide();d--;b.eq(d).show();f.html(d+1)}};next=function(){if(d>=e-1){return}else{b.hide();d++;b.eq(d).show();f.html(d+1)}};g.click(prev);c.click(next);f.html(d+1);a.html(e)}$(function(){var a={modules:$(".quick-links-widget")};a.modules.each(function(b){a["inst"+b]=new Pager(this)})});;function DoLPSSearch(){var a=new Array();$('select:visible[id^="lps_"]').each(function(){if($(this).val()!=""){a.push($(this).val())}});$('input[type="text"][id^="lps_"]').each(function(){if($(this).val()!=""){if($(this).val()!=$(this).attr("default")){var m=SEOFriendly($(this).val())+$(this).attr("seosuffix");a.push(m)}}});$('input:checked[id^="lps_"]').each(function(){if($(this).val()!=""){a.push($(this).val())}});if($("#lps_form_slider_price_value").length>0){if($("#lps_form_slider_price_value").val()!=""){a.push($("#lps_form_slider_price_value").val())}}var j=new Array();if(SiteLang!=null){j.push(SiteLang)}j.push(lpsconfig.channel);var k="location";if($("#tabs_search_type").length>0){k=$("#tabs_search_type .selected").attr("id").replace("tab_","")}else{if($("#search_type").length>-1){$("#search_type input[type='radio']").each(function(){if(this.checked){k=this.value}})}}if(k=="map_area"){a.push("map-view");if($("#LPSLocationSuggested_MapArea").val()==""){if(lpsconfig.location_selection_required==false){j.push(lpsconfig.seo_location_default)}else{window.alert(lpsconfig.error_no_location_selection);return}}else{j.push($("#LPSLocationSuggested_MapArea").val())}var c=String.Format("{0}-{1}-{2}-{3}-map",(Math.round(Map.getBounds().getNorthEast().lat()*1000000)/1000000),(Math.round(Map.getBounds().getNorthEast().lng()*1000000)/1000000),(Math.round(Map.getBounds().getSouthWest().lat()*1000000)/1000000),(Math.round(Map.getBounds().getSouthWest().lng()*1000000)/1000000));j.push(c)}else{if(k=="radius"){a.push("map-view");if($("#LPSLocationSuggested_Radius").val()==""){if(lpsconfig.location_selection_required==false){j.push(lpsconfig.seo_location_default)}else{window.alert(lpsconfig.error_no_location_selection);return}}else{j.push($("#LPSLocationSuggested_Radius").val())}j.push($("#distance_range_seo").val())}else{if($("#LPSTerm").length>0){if($("#LPSLocationSuggested").val()==""){if($("#LPSTerm").val()!=""){if($("#LPSTerm").val()!=$("#LPSTerm").attr("default")){var f=new Array();f.push("ss=true");f.push("channel="+lpsconfig.channel);f.push("Language="+SiteLang);f.push("keyword="+escape($("#LPSTerm").val()));if(a.length>0){f.push("Criteria="+a.join("/"))}var h=lpsconfig.searchserviceroot+"SmartSearch.aspx?"+f.join("&");$.getJSON(h,function(n,m){if(n!=null&&n.matchgroup!=null&&n.matchgroup.length>0&&n.matchgroup[0].match!=null&&n.matchgroup[0].match.length>0){window.setTimeout(function(){var p="";if(SiteLang!=null){p="/"+SiteLang}p+=n.matchgroup[0].match[0].seopath;p=p.replace(/\/$/gi,"");if(n.matchgroup.length>1||n.matchgroup[0].match.length>1){p+="?"+f.join("&")}$.cookies.del("Term");$.cookies.del("LocationSuggested");$.cookies.del("Channel");var o={hoursToLive:1};$.cookies.set("Term",$("#LPSTerm").val(),o);if(k=="radius_radio"||k=="map_area_radio"){d(n,k);return false}if(window.DEBUG){if(window.prompt("The Smart Search result. OK to follow, Cancel to remain -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",p)){SafeURL(p)}}else{SafeURL(p)}},10)}else{window.alert(String.Format(lpsconfig.error_smart_search,$("#LPSTerm").val()));$.cookies.del("Term");$.cookies.del("LocationSuggested");$.cookies.del("Channel")}});return false}else{if(lpsconfig.location_selection_required==false){j.push(lpsconfig.seo_location_default)}else{window.alert(lpsconfig.error_no_location_selection);return}}}else{if(lpsconfig.location_selection_required==false){j.push(lpsconfig.seo_location_default)}else{window.alert(lpsconfig.error_no_location_selection);return}}}else{j.push($("#LPSLocationSuggested").val())}}else{if($("#LPSLocationSuggested").val()==""){if(lpsconfig.location_selection_required==false){j.push(lpsconfig.seo_location_default)}else{window.alert(lpsconfig.error_no_location_selection);return}}else{j.push($("#LPSLocationSuggested").val())}}}}j.push(a.join("/"));var g="/"+j.join("/");var e=$("#LPSLocationSuggested").val();g=g.replace(/\/$/gi,"");if(k=="radius_radio"){var l="/reno/widgets/search/landingpages/data/MapActions.aspx?query_type=get_map_center_zoom&SEO="+e;$.getJSON(l,function(m){if(m.isDefined){g=g+"/"+m.Latitude+"-"+m.Longitude+"-"+Math.round(m.Radius*10)/10+"-radius";SafeURL(g)}});return}else{if(k=="map_area_radio"){var l="/reno/locations/GetMapAreaSearch.aspx?SEOQuery=/sales/"+e;$.get(l,function(m){g=m+"/"+a.join("/");SafeURL(g)});return}}g="http://"+self.location.host+g;if(window.DEBUG){if(window.prompt("The search result. OK to follow, Cancel to remain -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",g)){SafeURL(g)}}else{SafeURL(g)}function b(n,m){if(m=="radius_radio"){var p=n.split("/")[2];var o="/reno/widgets/search/landingpages/data/MapActions.aspx?query_type=get_map_center_zoom&SEO="+p;$.getJSON(o,function(q){if(q.isDefined){window.location.href=n+"/"+q.Latitude+"-"+q.Longitude+"-"+Math.round(q.Radius*10)/10+"-radius"}})}else{if(m=="map_area_radio"){var o="/reno/locations/GetMapAreaSearch.aspx?SEOQuery="+n;$.get(o,function(q){window.location.href=q})}}}function d(p,m){var r=document.createElement("div"),n=document.createElement("h2"),q=document.createElement("div"),o=false;i=0;q.className="dym";$.each(p.matchgroup,function(t,w){if(w.directive=="only_keyword_zip_usa"){b(w.match[0].seopath);o=true;return}else{if(w.directive.indexOf("address")==-1&&w.directive.indexOf("agent")==-1&&w.directive.indexOf("building")==-1){var u=document.createElement("div"),v=document.createElement("div");u.className="match";v.className="description";v.innerHTML=w.description;u.appendChild(v);$.each(w.match,function(x,z){var y=document.createElement("div");var A=document.createElement("a");A.innerHTML=z.title;y.appendChild(A);y.onclick=function(){b(z.seopath,m)};u.appendChild(y);i++});q.appendChild(u)}}});if(o){return false}n.innerHTML="Did You Mean to Search For...";r.appendChild(n);r.appendChild(q);if(i>0){$.modal(r)}else{alert("Your search for '"+s._term+"' returned zero results. Please try another term.")}}}function SEOFriendly(a){a=trim(a.replace(/[^a-z\s\-']+/gi,""));a=a.replace(/\s+/g,"-");return a}$(function(){if(typeof lpsconfig=="undefined"){return}if($("#PriceRange").length==0){return}$("#PriceRange").slider({orientation:"horizontal",range:true,min:0,max:PriceMinOpts.length-1,step:1,values:[GetPriceMinDefault(PriceMinOpts[0][1]),GetPriceMaxDefault(PriceMaxOpts[PriceMaxOpts.length-1][1])],slide:function(b,a){$("#PriceRange-amount").text(""+GetMinPrice(a.values[0],0).replace("Min","0")+" - "+GetMaxPrice(a.values[1],0))},stop:function(b,a){if(a.values[0]==0&&a.values[1]==PriceMaxOpts.length-1){$("#lps_form_slider_price_value").val("")}else{$("#lps_form_slider_price_value").val(GetMinPrice(a.values[0],1)+"-"+GetMaxPrice(a.values[1],1)+"-price")}}}).addClass("handle");$("#PriceRange-amount").text(""+GetMinPrice($("#PriceRange").slider("values",0),0).replace("Min","0")+" - "+GetMaxPrice($("#PriceRange").slider("values",1),0))});function GetMinPrice(c,a){if(a==0){try{return AddCurrencySymbol(PriceMinOpts[c][a])}catch(b){return PriceMinOpts[c][a]}}else{return PriceMinOpts[c][a]}}function GetMaxPrice(c,a){if(a==0){if(PriceMaxOpts[c][a].toLowerCase()=="max"){return"Max"}else{try{return AddCurrencySymbol(PriceMinOpts[c][a])}catch(b){return PriceMinOpts[c][a]}}}else{return PriceMaxOpts[c][a]}}function GetPriceMinDefault(b){for(var a=0;a<PriceMinOpts.length;a++){if(parseFloat(b)<=parseFloat(PriceMinOpts[a][1])){return a}}return 0}function GetPriceMaxDefault(b){for(var a=PriceMaxOpts.length-1;a>=0;a--){if(parseFloat(b)>=parseFloat(PriceMaxOpts[a][1])){return a}}return PriceMaxOpts.length-1}function TabAction(a,b){$("#"+a+">li").removeClass("selected");$("#"+b).addClass("selected")}function SwitchSearchType(a){$(".location").removeClass("none").addClass("none");$("#searchby_"+a).removeClass("none");switch(a){case"type_location":InitializeSuggest_Location();$(".view-toggle").show();TryLoadLocationFromDefaults("LPSTerm","LPSLocationSuggested");break;case"type_radius":InitializeSuggest_Radius();Try_Initialize_Radius_Selector();$(".view-toggle").show();TryLoadLocationFromDefaults("LPSTerm_Radius","LPSLocationSuggested_Radius",function(){ajaxAdjustRadiusSelector($("#LPSLocationSuggested_Radius").val())});break;case"type_map_area":InitializeSuggest_MapArea();Try_Initialize_MapArea_Map();$(".view-toggle").hide();TryLoadLocationFromDefaults("LPSTerm_MapArea","LPSLocationSuggested_MapArea",function(){RecenteringEnabled=false;getMapRecentering($("#LPSLocationSuggested_MapArea").val(),function(){RecenteringEnabled=true})});break}window.searchHeight.setHeight()}function TryLoadLocationFromDefaults(c,b,a){if($("#global_lps_selected_location_name").val()!=""&&$("#global_lps_selected_location_seo").val()!=""){$("#"+c).val($("#global_lps_selected_location_name").val());$("#"+b).val($("#global_lps_selected_location_seo").val());Exec(a)}}function SearchHeightObj(){this.init=function(){this.criteria=$(">.criteria","#location_search");this.setHeight()};this.setHeight=function(){this.criteria.css("height","");this.criteria.height(this.criteria.height())}}$(function(){if(typeof lpsconfig=="undefined"){return}$("#LPSTerm").bind("paste",function(e){if(e.type=="paste"){$("#LPSLocationSuggested").val("")}});$(".scg_content select:eq(0)").attr("disabled",false);eval($(".scg_content select:eq(0)").attr("reload"));InitializeSuggest_Location();if(lpsconfig.location_selection_required){if($("#LPSTerm").length>0){$("#LPSTerm").val(lpsconfig.default_region_name);$("#LPSLocationSuggested").val(lpsconfig.seo_location_default)}}if($("#LPSTerm_Radius").length>0){$("#LPSTerm_Radius").val(lpsconfig.default_region_name);$("#LPSLocationSuggested_Radius").val(lpsconfig.seo_location_default)}if($("#LPSTerm_MapArea").length>0){$("#LPSTerm_MapArea").val(lpsconfig.default_region_name);$("#LPSLocationSuggested_MapArea").val(lpsconfig.seo_location_default)}$("#LPSTerm, #LPSTerm_Radius, #LPSTerm_MapArea").one("mouseenter",function(){window["input_"+this.id].orignalValue=this.value});window.searchHeight=new SearchHeightObj();window.searchHeight.init()});function InitializeSuggest_Location(){if($("#LPSTerm").length>0){if($LPSSuggest!=null){$LPSSuggest.UnbindEvents()}var a="LPSTerm";var b="LPSLocationSuggested";var c="LPSSuggestContainer";var d=function(){$("#global_lps_selected_location_name").val($("#LPSTerm").val());$("#global_lps_selected_location_seo").val($("#LPSLocationSuggested").val())};$LPSSuggest=new $LPSSuggestObject.Json(a,b,c,d);$LPSSuggest.BindEvents()}}function InitializeSuggest_Radius(){if($("#LPSTerm_Radius").length>0){if($LPSSuggest!=null){$LPSSuggest.UnbindEvents()}var a="LPSTerm_Radius";var b="LPSLocationSuggested_Radius";var c="LPSSuggestContainer_Radius";var d=function(){$("#global_lps_selected_location_name").val($("#LPSTerm_Radius").val());$("#global_lps_selected_location_seo").val($("#LPSLocationSuggested_Radius").val())};$LPSSuggest=new $LPSSuggestObject.Json(a,b,c,d);$LPSSuggest.BindEvents()}}var RecenteringEnabled=true;function InitializeSuggest_MapArea(){if($("#LPSTerm_MapArea").length>0){if($LPSSuggest!=null){$LPSSuggest.UnbindEvents()}var a="LPSTerm_MapArea";var b="LPSLocationSuggested_MapArea";var c="LPSSuggestContainer_MapArea";var d=function(){RecenteringEnabled=false;getMapRecentering($("#LPSLocationSuggested_MapArea").val(),function(){RecenteringEnabled=true});$("#global_lps_selected_location_name").val($("#LPSTerm_MapArea").val());$("#global_lps_selected_location_seo").val($("#LPSLocationSuggested_MapArea").val())};$LPSSuggest=new $LPSSuggestObject.Json(a,b,c,d);$LPSSuggest.BindEvents()}}var Radius_Selector_Initialized=false;function Try_Initialize_Radius_Selector(){try{if(!Radius_Selector_Initialized&&$("#distance_range").length>0&&RadiusOpts!=undefined&&RadiusOpts.length>0){var a=0;for(var d=RadiusOpts.length-1;d>=0;d--){var c=parseFloat(RadiusOpts[d].replace(/[^0-9\.]+/g,""));var f=parseFloat(lpsconfig.default_map_radius);if(c<=f){a=d;break}}if(a==0){a=parseInt(RadiusOpts.length/2,10)}$("#distance_range_values").html(RadiusOpts[a].toLowerCase());$("#distance_range_seo").val(RadiusOpts[a].replace(/[^0-9\.]+/g,"")+"-radius");$("#distance_range").slider({range:"min",min:0,max:RadiusOpts.length-1,step:1,value:a,slide:function(g,e){$("#distance_range_values").html(RadiusOpts[e.value].toLowerCase())},stop:function(g,e){$("#distance_range_seo").val(RadiusOpts[e.value].replace(/[^0-9\.]+/g,"")+"-radius")}});Radius_Selector_Initialized=true}}catch(b){}}var Map=null;function Try_Initialize_MapArea_Map(){if(Map==null){var d=lpsconfig.default_map_radius;var c=lpsconfig.default_map_center[0];var a=lpsconfig.default_map_center[1];var b={zoom:1,scrollwheel:false,center:new google.maps.LatLng(c,a),mapTypeId:google.maps.MapTypeId.ROADMAP,streetViewControl:false,scrollwheel:false,minZoom:1,navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeControl:false,scaleControl:false};Map=new google.maps.Map($("#search_widget_map")[0],b);RecenterMap(c,a,d,function(){window.setTimeout(function(){google.maps.event.addListener(Map,"drag",function(){if(RecenteringEnabled){ensureBounds()}});google.maps.event.addListener(Map,"zoom_changed",function(){if(RecenteringEnabled){getMapCenter()}});google.maps.event.addListener(Map,"dragend",function(){if(RecenteringEnabled){ensureBounds();getMapCenter()}})},100)})}}function getMapCenter(){var b="";if(SiteLang!=null){b="/"+SiteLang}var a=b+"/reno/widgets/search/landingpages/data/MapActions.aspx?NE={0},{1}&SW={2},{3}&GZ={4}&query_type=recenter_map";a=String.Format(a,Map.getBounds().getNorthEast().lat(),Map.getBounds().getNorthEast().lng(),Map.getBounds().getSouthWest().lat(),Map.getBounds().getSouthWest().lng(),Map.getZoom());$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:a,data:"{}",cache:false,dataType:"jsonp",error:function(d,c,e){$.log("Json Error Message: error("+e+') "'+c+'"')},success:function(c){if(c.isDefined){$("#LPSTerm_MapArea").val(c.Name);$("#LPSLocationSuggested_MapArea").val(c.SEO);$("#global_lps_selected_location_name").val(c.Name);$("#global_lps_selected_location_seo").val(c.SEO)}else{}}})}function ajaxAdjustRadiusSelector(b,a){var d="";if(SiteLang!=null){d="/"+SiteLang}var c=d+"/reno/widgets/search/landingpages/data/MapActions.aspx?query_type=get_map_center_zoom&doAdjustRadius=false&SEO="+b;$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:c,data:"{}",cache:false,dataType:"jsonp",error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(e){if(e.isDefined){AdjustRadiusSelector(e.Radius,a)}else{}}})}function AdjustRadiusSelector(e,a){var f=0;for(var d=RadiusOpts.length-1;d>=0;d--){var b=parseFloat(RadiusOpts[d].replace(/[^0-9\.]+/g,""));var c=parseFloat(e);if(b<=c){f=d;break}}$("#distance_range").slider({value:f});$("#distance_range_values").html(RadiusOpts[f].toLowerCase());$("#distance_range_seo").val(RadiusOpts[f].replace(/[^0-9\.]+/g,"")+"-radius");Exec(a)}function getMapRecentering(b,a){var d="";if(SiteLang!=null){d="/"+SiteLang}var c=d+"/reno/widgets/search/landingpages/data/MapActions.aspx?query_type=get_map_center_zoom&SEO="+b;$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:c,data:"{}",cache:false,dataType:"jsonp",error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(e){if(e.isDefined){RecenterMap(e.Latitude,e.Longitude,e.Radius,a)}else{}}})}function RecenterMap(d,c,e,a){var b={strokeOpacity:0,strokeWeight:0,fillOpacity:0,center:new google.maps.LatLng(d,c),radius:(e*1.609)*1000};var f=new google.maps.Circle(b);f.setMap(Map);Map.fitBounds(f.getBounds());f.setMap(null);Exec(a)}function ensureBounds(){var b=Map.getBounds().getSouthWest();var c=Map.getBounds().getNorthEast();var a;if(c.lat()>85){a=new google.maps.LatLngBounds(b,new google.maps.LatLng(85,c.lng()));Map.fitBounds(a)}else{if(b.lat()<-85){a=new google.maps.LatLngBounds(new google.maps.LatLng(-85,b.lng()),c);Map.fitBounds(a)}}}$(function(){if(typeof lpsconfig=="undefined"){return}if(SchoolDistrictsEnabled){if($('select[module="school_districts"]').length>0){var a="/reno/utility/GetSchoolDistricts.aspx";$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:a,data:"{}",cache:true,dataType:"jsonp",error:function(c,b,d){$.log("School districts failed to load")},success:function(c){if(c.length>0){for(var b=0;b<c.length;b++){ele=c[b];opt=document.createElement("option");opt.text=ele.Name;opt.value=ele.SEO;$('select[module="school_districts"]')[0].options.add(opt)}}}})}}});function SafeURL(a){var b=document.createElement("form");b.setAttribute("action",a);b.setAttribute("method","get");b.setAttribute("target","_top");document.body.appendChild(b);b.submit()};;function DoSCGTab(id){$(".scg_tab,.scg_content").removeClass("none").addClass("none").attr("disabled",true);$(String.Format("#scg_tab_{0},#scg_content_{0}",id)).removeClass("none").attr("disabled",false);if($("#scg_content_"+id+" select:first")[0].options.length<=1){$("#scg_content_"+id+" select").each(function(){ResetSelect($(this))});$("#scg_content_"+id+" select:first").attr("disabled",false);eval($("#scg_content_"+id+" select:first").attr("reload"))}window.searchHeight.setHeight()}function ResetSelect(a){a.removeClass("disabled").addClass("disabled").attr("disabled",true);var b=a[0].options;b.length=0;b[0]=new Option(a.attr("default"),"")}function DefaultToTopSelected(){var a="";var b="";$(".scg_content:not(.none) select").each(function(){if($(this)[0].selectedIndex>0){a=$(this).val();b=$(this)[0].options[$(this)[0].selectedIndex].text}});if(a==""){if($("#LPSTerm").attr("default")!=""){$("#LPSTerm").val($("#LPSTerm").attr("default"));$("#LPSLocationSuggested").val("")}else{$("#LPSTerm").val("All Locations");$("#LPSLocationSuggested").val(lpsconfig.searchtoplevelseo)}TryLoadDefaultLocation();return}else{$("#LPSLocationSuggested").val(a);$("#LPSTerm").val(b);TryLoadDefaultLocation()}}var arrFirstLoaded=new Array();function LoadSCG(a,k,i,b,c,m,q){var f="#scg_combo_"+i+"_"+c;if(k.indexOf("|")>-1&&b.indexOf("|")>-1){var g=true;if($.inArray(f,arrFirstLoaded)==-1){if($(f).attr("first_load_seo")!=""){g=false}}var l=k.split("|");var p=b.split("|");if(g){LoadSCG(a,l[0],i,p[0],c,m,q);LoadSCG(a,l[1],i,p[1],c,m,q);return}else{LoadSCG(a,l[0],i,p[0],c,m,q);return}}else{if($(f)[0].selectedIndex==0){$("#scg_content_"+i+" select").each(function(r){if(r==m-2){var s=$(this).attr("onchange").toString();if(s.indexOf("|")>-1){$(this).trigger("change");return}}})}}var d=new Array();$("#scg_content_"+i+" select").each(function(r){if(r>=m){d.push($(this))}});d.reverse();for(var n=0;n<d.length;n++){ResetSelect(d[n])}DefaultToTopSelected();q=q.replace("offices","broker");q=q.replace("associates","agent");var h="#scg_combo_"+i+"_"+b;var e=$("#scg_combo_"+i+"_"+c)[0].options;if(e.selectedIndex>0){var o=e[e.selectedIndex].text;o=trim(o.replace(/\([0-9,]+\)/,""));$("#LPSTerm").val(o);$("#LPSLocationSuggested").val(a);TryLoadDefaultLocation()}if(a==""||b==""){return}var j=String.Format("/reno/search/service.aspx?Channel={0}&SearchType={1}&ReturnType=json&Language={2}&MaxReturns=350&Term={3}",q,k,SiteLang,a);$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:j,data:"{}",dataType:"jsonp",error:function(s,r,t){$.log("Json Error Message: error("+t+') "'+r+'"')},success:function(v){var t="";if(v.group&&v.group.length>0&&v.group[0].option&&v.group[0].option.length>0){ResetSelect($(h));for(var u=0;u<v.group[0].option.length;u++){var s=v.group[0].option[u];var r=$(h)[0].options;if(s.title!=null&&s.title!=""&&s.valueseo!=null&&s.valueseo!=""&&s.count!=null&&s.count!=""&&!isNaN(s.count)&&s.count>0){r[r.length]=new Option(s.title,s.valueseo)}}$(h).removeClass("disabled").attr("disabled",false);TryLoadDefaultLocation();if($.inArray(h,arrFirstLoaded)==-1){if($(h).attr("first_load_seo")!=""){$(h).val($(h).attr("first_load_seo"));$(h).trigger("change");arrFirstLoaded.push(h)}}}}})}function TryLoadDefaultLocation(){if($("#global_lps_selected_location_name").length>0&&$("#global_lps_selected_location_seo").length>0){$("#global_lps_selected_location_name").val($("#LPSTerm").val());$("#global_lps_selected_location_seo").val($("#LPSLocationSuggested").val())}};;var $LPSSuggestObject=function(){};var $LPSSuggest=null;$LPSSuggestObject.Json=function(a,b,c,d){this.SuggestType="Suggest";this.TextInputId="#"+a;this.TextSelectedDataId="#"+b;this.ResponseContainerId="#"+c;this.ExecuteCallback=function(){Exec(d)}};$LPSSuggestObject.Json.prototype.CloseSuggest=function(){$($LPSSuggest.ResponseContainerId).html("");$($LPSSuggest.ResponseContainerId).removeClass("open closed");$($LPSSuggest.ResponseContainerId).addClass("closed")};$LPSSuggestObject.Json.prototype.SuggestSelect=function(a){$($LPSSuggest.TextSelectedDataId).val($("#suggest-data-"+a).attr("name"));$($LPSSuggest.TextInputId).val($("#suggest-data-"+a).html().replace(/<[^>]+>/g,""));$LPSSuggest.CloseSuggest();$LPSSuggest.ExecuteCallback()};$LPSSuggestObject.Json.prototype.TotalSuggestMatches=function(){return $($LPSSuggest.ResponseContainerId+" > div").length};$LPSSuggestObject.Json.prototype.ScrollToItem=function(a){$($LPSSuggest.ResponseContainerId+" > div").toggleClass("suggest-over",false);$("#suggest-data-"+a).toggleClass("suggest-over",true)};$LPSSuggestObject.Json.prototype.CurrentSuggestIndex=function(){var a=$($LPSSuggest.ResponseContainerId+" > div");var c=-1;for(var b=0;b<a.length;b++){if(a[b].className.indexOf("suggest-over")>-1){c=b;break}}return c};$LPSSuggestObject.Json.prototype.StopProcessingEvents=function(a){if(a&&a.preventDefault){a.preventDefault();return false}else{if(window.event&&window.event.returnValue){window.eventReturnValue=false}}};$LPSSuggestObject.Json.prototype.UnbindEvents=function(){$($LPSSuggest.TextInputId).unbind("keyup.suggest, keydown.suggest, blur.suggest")};$LPSSuggestObject.Json.prototype.BindEvents=function(){var a;$($LPSSuggest.TextInputId).bind("keyup.suggest",function(c){var b;if(window.event){b=c.keyCode}else{if(c.which){b=c.which}}switch(b){case 13:if($($LPSSuggest.ResponseContainerId).hasClass("open")){$LPSSuggest.CloseSuggest();$LPSSuggest.StopProcessingEvents(c);$.log("Enter Key Released");return false}$.log("Enter Key Released");return false;break;case 27:$LPSSuggest.CloseSuggest();$.log("Escape Key Released");return false;break;case 40:$LPSSuggest.ScrollToItem($LPSSuggest.CurrentSuggestIndex()+1);$.log("Down Key Released: index "+parseFloat($LPSSuggest.CurrentSuggestIndex()+1));break;case 38:$LPSSuggest.ScrollToItem($LPSSuggest.CurrentSuggestIndex()-1);$.log("Up Key Released: index "+parseFloat($LPSSuggest.CurrentSuggestIndex()-1));break;case 32:$.log("Space Released");break;default:$.log(String.fromCharCode(b)+" Key Released ("+b+")");if(trim($($LPSSuggest.TextInputId).val()).length>1){$($LPSSuggest.TextSelectedDataId).val("");var d=String.Format("{0}Service.aspx?Channel={1}&SearchType={2}&MaxReturns={3}&ReturnType=json&Term={4}",lpsconfig.searchserviceroot,lpsconfig.channel,$LPSSuggest.SuggestType,lpsconfig.max_suggest_returns,trim($($LPSSuggest.TextInputId).val()));$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:d,data:"{}",dataType:"jsonp",beforeSend:function(e){if(a!=null){a.abort()}a=e},error:function(f,e,g){$LPSSuggest.CloseSuggest();$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(h){var e="";if(h.group&&h.group.length>0&&h.group[0].option&&h.group[0].option.length>0){$($LPSSuggest.TextSelectedDataId).val("");for(var f=0;f<h.group[0].option.length;f++){var g='<div class="suggest-data" id="suggest-data-{0}" name="{1}" onmousedown="$LPSSuggest.SuggestSelect({2})" onmouseover="$LPSSuggest.ScrollToItem({3})">{4}</div>';e+=String.Format(g,f,h.group[0].option[f].valueseo,f,f,h.group[0].option[f].title)}$($LPSSuggest.ResponseContainerId).html(e);$($LPSSuggest.ResponseContainerId).toggleClass("open",true).toggleClass("closed",false)}else{$LPSSuggest.CloseSuggest();$.log('Suggest Term "'+$($LPSSuggest.TextInputId).val()+'" = No Matches')}}})}else{$LPSSuggest.CloseSuggest();$.log('Suggest Term "'+$($LPSSuggest.TextInputId).val()+'" = Too Short')}break}});$($LPSSuggest.TextInputId).bind("keydown.suggest",function(c){var b;if(window.event){b=c.keyCode}else{if(c.which){b=c.which}}switch(b){case 13:if($($LPSSuggest.ResponseContainerId).hasClass("open")){if($LPSSuggest.CurrentSuggestIndex()>-1){$LPSSuggest.SuggestSelect($LPSSuggest.CurrentSuggestIndex());$LPSSuggest.StopProcessingEvents(c);$.log("Enter Key Down");return false}if($LPSSuggest.TotalSuggestMatches()==1){$LPSSuggest.SuggestSelect(0);$.log("Enter Key Down");return false}}$.log("Enter Key Down");return false;break;case 27:$LPSSuggest.CloseSuggest();$.log("Escape Key Down");return false;break;case 40:$.log("Down Key Pressed");break;case 38:$.log("Up Key Pressed");break;case 32:$.log("Space Pressed");break;default:$.log(String.fromCharCode(b)+" Key Down ("+b+")");return true;break}});$($LPSSuggest.TextInputId).bind("blur.suggest",function(){$LPSSuggest.CloseSuggest();$($LPSSuggest.TextInputId).css("font-color","#ccc")});$($LPSSuggest.TextInputId).dblclick(function(){$($LPSSuggest.TextInputId).css("font-color","#000");$($LPSSuggest.TextInputId).val("")})};;(function($){$.formatCurrency={};$.formatCurrency.regions=[];$.formatCurrency.regions[""]={symbol:"$",positiveFormat:"%s%n",negativeFormat:"(%s%n)",decimalSymbol:".",digitGroupSymbol:",",groupDigits:true};
$.fn.formatCurrency=function(destination,settings){if(arguments.length==1&&typeof destination!=="string"){settings=destination;destination=false
}var defaults={name:"formatCurrency",colorize:false,region:"",global:true,roundToDecimalPlace:2,eventOnDecimalsEntered:false};defaults=$.extend(defaults,$.formatCurrency.regions[""]);
settings=$.extend(defaults,settings);if(settings.region.length>0){settings=$.extend(settings,getRegionOrCulture(settings.region))}settings.regex=generateRegex(settings);
return this.each(function(){$this=$(this);var num="0";num=$this[$this.is("input, select, textarea")?"val":"html"]();if(num.search("\\(")>=0){num="-"+num
}if(num===""||(num==="-"&&settings.roundToDecimalPlace===-1)){return}if(isNaN(num)){num=num.replace(settings.regex,"");if(num===""||(num==="-"&&settings.roundToDecimalPlace===-1)){return
}if(settings.decimalSymbol!="."){num=num.replace(settings.decimalSymbol,".")}if(isNaN(num)){num="0"}}var numParts=String(num).split(".");var isPositive=(num==Math.abs(num));
var hasDecimals=(numParts.length>1);var decimals=(hasDecimals?numParts[1].toString():"0");var originalDecimals=decimals;num=Math.abs(numParts[0]);
num=isNaN(num)?0:num;if(settings.roundToDecimalPlace>=0){decimals=parseFloat("1."+decimals);decimals=decimals.toFixed(settings.roundToDecimalPlace);
if(decimals.substring(0,1)=="2"){num=Number(num)+1}decimals=decimals.substring(2)}num=String(num);if(settings.groupDigits){for(var i=0;i<Math.floor((num.length-(1+i))/3);
i++){num=num.substring(0,num.length-(4*i+3))+settings.digitGroupSymbol+num.substring(num.length-(4*i+3))}}if((hasDecimals&&settings.roundToDecimalPlace==-1)||settings.roundToDecimalPlace>0){num+=settings.decimalSymbol+decimals
}var format=isPositive?settings.positiveFormat:settings.negativeFormat;var money=format.replace(/%s/g,settings.symbol);money=money.replace(/%n/g,num);
var $destination=$([]);if(!destination){$destination=$this}else{$destination=$(destination)}$destination[$destination.is("input, select, textarea")?"val":"html"](money);
if(hasDecimals&&settings.eventOnDecimalsEntered&&originalDecimals.length>settings.roundToDecimalPlace){$destination.trigger("decimalsEntered",originalDecimals)
}if(settings.colorize){$destination.css("color",isPositive?"black":"red")}})};$.fn.toNumber=function(settings){var defaults=$.extend({name:"toNumber",region:"",global:true},$.formatCurrency.regions[""]);
settings=jQuery.extend(defaults,settings);if(settings.region.length>0){settings=$.extend(settings,getRegionOrCulture(settings.region))}settings.regex=generateRegex(settings);
return this.each(function(){var method=$(this).is("input, select, textarea")?"val":"html";$(this)[method]($(this)[method]().replace("(","(-").replace(settings.regex,""))
})};$.fn.asNumber=function(settings){var defaults=$.extend({name:"asNumber",region:"",parse:true,parseType:"Float",global:true},$.formatCurrency.regions[""]);
settings=jQuery.extend(defaults,settings);if(settings.region.length>0){settings=$.extend(settings,getRegionOrCulture(settings.region))}settings.regex=generateRegex(settings);
settings.parseType=validateParseType(settings.parseType);var method=$(this).is("input, select, textarea")?"val":"html";var num=$(this)[method]();
num=num?num:"";num=num.replace("(","(-");num=num.replace(settings.regex,"");if(!settings.parse){return num}if(num.length==0){num="0"}if(settings.decimalSymbol!="."){num=num.replace(settings.decimalSymbol,".")
}return window["parse"+settings.parseType](num)};function getRegionOrCulture(region){var regionInfo=$.formatCurrency.regions[region];if(regionInfo){return regionInfo
}else{if(/(\w+)-(\w+)/g.test(region)){var culture=region.replace(/(\w+)-(\w+)/g,"$1");return $.formatCurrency.regions[culture]}}return null}function validateParseType(parseType){switch(parseType.toLowerCase()){case"int":return"Int";
case"float":return"Float";default:throw"invalid parseType"}}function generateRegex(settings){if(settings.symbol===""){return new RegExp("[^\\d"+settings.decimalSymbol+"-]","g")
}else{var symbol=settings.symbol.replace("$","\\$").replace(".","\\.");return new RegExp(symbol+"|[^\\d"+settings.decimalSymbol+"-]","g")}}})(jQuery);
var $SuggestObject=function(){};$SuggestObject.Json=function(){this.SuggestType="SuggestAll_AddParentSEO";this.TextInputId="#Term";this.TextSelectedDataId="#LocationSuggested";this.ResponseContainerId="#SuggestContainer";var a="";if(SiteLang!=null){a="/"+SiteLang}this.SubmitSearch=function(){window.location.href=String.Format("{0}/{1}/{2}",a,$("input[name=Channel]:checked").val(),$("#LocationSuggested").val())}};$SuggestObject.Json.prototype.CloseSuggest=function(){$($Suggest.ResponseContainerId).html("");$($Suggest.ResponseContainerId).removeClass("open closed");$($Suggest.ResponseContainerId).addClass("closed")};$SuggestObject.Json.prototype.SuggestSelect=function(a){$($Suggest.TextSelectedDataId).val($("#suggest-data-"+a).attr("name"));$($Suggest.TextInputId).val($("#suggest-data-"+a).html().replace(/<[^>]+>/g,""));$Suggest.CloseSuggest()};$SuggestObject.Json.prototype.TotalSuggestMatches=function(){return $($Suggest.ResponseContainerId+" > div").length};$SuggestObject.Json.prototype.ScrollToItem=function(a){$($Suggest.ResponseContainerId+" > div").toggleClass("suggest-over",false);$("#suggest-data-"+a).toggleClass("suggest-over",true)};$SuggestObject.Json.prototype.CurrentSuggestIndex=function(){var a=$($Suggest.ResponseContainerId+" > div");var c=-1;for(var b=0;b<a.length;b++){if(a[b].className.indexOf("suggest-over")>-1){c=b;break}}return c};$SuggestObject.Json.prototype.StopProcessingEvents=function(a){if(a&&a.preventDefault){a.preventDefault();return false}else{if(window.event&&window.event.returnValue){window.eventReturnValue=false}}};$(document).ready(function(){var a=null;$($Suggest.TextInputId).keyup(function(c){var b;if(window.event){b=c.keyCode}else{if(c.which){b=c.which}}switch(b){case 13:if($($Suggest.ResponseContainerId).hasClass("open")){$Suggest.CloseSuggest();$Suggest.StopProcessingEvents(c)}$.log("Enter Key Released");if(typeof(Search)=="function"){Search()}return false;break;case 27:$Suggest.CloseSuggest();$.log("Escape Key Released");return false;break;case 40:$Suggest.ScrollToItem($Suggest.CurrentSuggestIndex()+1);$.log("Down Key Released: index "+parseFloat($Suggest.CurrentSuggestIndex()+1));break;case 38:$Suggest.ScrollToItem($Suggest.CurrentSuggestIndex()-1);$.log("Up Key Released: index "+parseFloat($Suggest.CurrentSuggestIndex()-1));break;default:$.log(String.fromCharCode(b)+" Key Released ("+b+")");$("#LocationSuggested").val("");if($($Suggest.TextInputId).val().length>1){var d=String.Format("{0}Service.aspx?Channel={1}&SearchType={2}&MaxReturns=10&ReturnType=json&Language={3}&Term={4}",CacheObject.SearchServiceRoot,CacheObject.Channel,$Suggest.SuggestType,SiteLang,$($Suggest.TextInputId).val());$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:d,data:"{}",dataType:"jsonp",beforeSend:function(e){if(a!=null){a.abort()}a=e},error:function(f,e,g){$Suggest.CloseSuggest();$.log("Json Error Message: error("+g+') "'+e+'"')},success:function(h){var e="";if(h.group&&h.group.length>0&&h.group[0].option&&h.group[0].option.length>0){$("#LocationSuggested").val("");for(var f=0;f<h.group[0].option.length;f++){var g='<div class="suggest-data" id="suggest-data-{0}" name="{1}" onmousedown="$Suggest.SuggestSelect({2})" onmouseover="$Suggest.ScrollToItem({3})">{4}</div>';e+=String.Format(g,f,h.group[0].option[f].valueseo,f,f,h.group[0].option[f].title)}$($Suggest.ResponseContainerId).html(e);$($Suggest.ResponseContainerId).toggleClass("open",true).toggleClass("closed",false)}else{$Suggest.CloseSuggest();$.log('Suggest Term "'+$($Suggest.TextInputId).val()+'" = No Matches')}}})}else{$Suggest.CloseSuggest();$.log('Suggest Term "'+$($Suggest.TextInputId).val()+'" = Too Short')}break}})});$(document).ready(function(){$($Suggest.TextInputId).keydown(function(b){var a;if(window.event){a=b.keyCode}else{if(b.which){a=b.which}}switch(a){case 13:if($($Suggest.ResponseContainerId).hasClass("open")){if($Suggest.CurrentSuggestIndex()>-1){$Suggest.SuggestSelect($Suggest.CurrentSuggestIndex());$Suggest.StopProcessingEvents(b);$.log("Enter Key Down");return false}if($Suggest.TotalSuggestMatches()==1){$Suggest.SuggestSelect(0);$.log("Enter Key Down");return false}}$.log("Enter Key Down");if(typeof(Search)=="function"){Search()}return false;break;case 27:$Suggest.CloseSuggest();$.log("Escape Key Down");return false;break;case 40:$.log("Down Key Pressed");break;case 38:$.log("Up Key Pressed");break;default:$.log(String.fromCharCode(a)+" Key Down ("+a+")");return true;break}})});$(document).ready(function(){$($Suggest.TextInputId).blur(function(){$Suggest.CloseSuggest();$($Suggest.TextInputId).css("font-color","#ccc")})});$(document).ready(function(){$($Suggest.TextInputId).dblclick(function(){$($Suggest.TextInputId).css("font-color","#000");$($Suggest.TextInputId).val("")})});var $Suggest=new $SuggestObject.Json();;$(function(){if($.cookies.get("Term")!=null&&$.cookies.get("Term")!=""){$("#Term").val($.cookies.get("Term"))}if($.cookies.get("LocationSuggested")!=null&&$.cookies.get("LocationSuggested")!=""){$("#LocationSuggested").val($.cookies.get("LocationSuggested"))}if($.cookies.get("Channel")!=null&&$.cookies.get("Channel")!=""){$("input[name='Channel']").val($.cookies.get("Channel"))}});function ResetSearch(){$("#Term").val("");$.cookies.del("Term");$.cookies.del("LocationSuggested");$.cookies.del("Channel");SwapType(CacheObject.Channel)}var L1="#Location1";var L2="#Location2";var L3="#Location3";var L4="#Location4";var LS="#LocationSelected";var L1234="#Location1, #Location2, #Location3, #Location4";var L123="#Location1, #Location2, #Location3";var L12="#Location1, #Location2";var L234="#Location2, #Location3, #Location4";var L34="#Location3, #Location4";var RegionSEO;var OtherCriteria="#PriceMin, #PriceMax, #Bedrooms";function SwapType(a){CacheObject.Channel=a;$(L1234).html("");$(L1234).get(0).selectedIndex=0;$(LS).val("");$(L1234).unbind();$(OtherCriteria).html("");$(".search-options > label").removeClass("active");document.getElementById(a).nextSibling.className="active"}function GetJson(d,b,c){var a=String.Format("{0}Service.aspx?Channel={1}&SearchType={2}&Term={3}&ReturnType=json",CacheObject.SearchServiceRoot,CacheObject.Channel,d,b);$(document).ready(function(){$.ajax({type:"GET",url:a,cache:false,data:"{}",contentType:"application/json; charset=utf-8",dataType:"jsonp",timeout:3000,success:function(e){c(e)},error:function(f,e,g){$.log("Json Error Message: error("+g+') "'+e+'"');c(null)}})})}function ValidateJsonResponse(a){if(a==null){return false}if(a.group==null){return false}if(a.group.length<1){return false}if(a.group[0].option==null){return false}if(a.group[0].option.length<1){return false}return true}function Fader(){if(arguments.length==0){return}for(var x=0;x<arguments.length;x++){eval(String.Format("$('{0}').fadeTo(10, 0.25, function(){{ $('{1}').fadeTo(400, 1.0); }});",arguments[x],arguments[x]))}}function LoadSelect(e,d,h,b){var c=0;if(e.group!=undefined&&e.group.length>h){if(e.group[h]!=undefined){if(e.group[h].option!=undefined){if(e.group[h].option.length>0){c=e.group[h].option.length;for(var a=0;a<e.group[h].option.length;a++){var f=(e.group[h].option[a].value==undefined)?e.group[h].option[a].valueseo:e.group[h].option[a].value;$(d).append(NewOpt(f,e.group[h].option[a].title))}}}}}if(b!=undefined){b(c)}}function NewOpt(b,a){return'<option value="'+b+'">'+a+"</option>"}function MinQuery(){}function Search(){var o=new Array();var l=jQuery.trim($("#LocationSuggested").val());var j="";var c=jQuery.trim($("#Term").val());var h=new Array();h.push("ss=true");h.push("channel="+CacheObject.Channel);if(l==""&&j==""&&c==""){window.alert("Please select a location, or enter a location, zip or web ID");return}var n=false;var m="";var k="";if(l!=""){m=l}else{if(j==""&&l==""&&c!=""){n=true;h.push("keyword="+escape(trim(c)))}else{window.alert("Please select a location, or enter a location, zip or web ID.");return}}if($("#search_bar_type").attr("selectedIndex")>0){o.push($("#search_bar_type").val())}if(o.length>0){h.push("Criteria="+o.join("/"))}h.push("Language="+SiteLang);var g=h.join("&");var f="";if(SiteLang!=null){f="/"+SiteLang}var a=o.join("/");if(a.length>0){a="/"+a}var e=String.Format("{0}/{1}/{2}{3}",f,CacheObject.Channel.toLowerCase(),m.toLowerCase(),a);var i={hoursToLive:(24*7)};var b=$("#Term").val();var d=$("#LocationSuggested").val();if(b!=null&&b!=""){$.cookies.set("Term",b,i)}if(d!=null&&d!=""){$.cookies.set("LocationSuggested",d,i)}if(n){k="/Reno/Search/SmartSearch.aspx?"+g;$.getJSON(k,function(q,p){if(q!=null&&q.matchgroup!=null&&q.matchgroup.length>0&&q.matchgroup[0].match!=null&&q.matchgroup[0].match.length>0){window.setTimeout(function(){var r=q.matchgroup[0].match[0].seopath;if(q.matchgroup.length>1||q.matchgroup[0].match.length>1){r=r+"?"+g}$.cookies.del("Term");$.cookies.del("LocationSuggested");$.cookies.del("Channel");var s={hoursToLive:1};$.cookies.set("Term",$("#Term").val(),s);window.location.href=r},10)}else{alert("Your search for '"+c+"' returned zero results. Please try another term.");$.cookies.del("Term");$.cookies.del("LocationSuggested");$.cookies.del("Channel")}})}else{window.location.href=e}}function setBcolH(){$("#col-b").height($("#col-a").height())};;
