
﻿var SfsSearch=new Object();SfsSearch.controls={};String.prototype.IdSelector=function(){return"#"+this;}
String.prototype.Append=function(toAppend){if(toAppend.constructor==String){return this+toAppend;}else{return this+toAppend.join('');}}
Array.prototype.Append=function(item){this[this.length]=item;}
Array.prototype.Each=function(func){jQuery.each(this,func);}
Array.prototype.Last=function(){return this[this.length-1];}
SfsSearch.CurrentBaseUrl=function(){return/(.+?)($|\?)/.exec(window.location)[1];}
SfsSearch.Format=function(string,obj){for(var x in obj){string=string.replace(x,obj[x]);}
return string;}
SfsSearch.ActionQueue=function(obj,propertyName,baseFunc){var queueName='_'.Append([propertyName,'QUEUE']);obj[queueName]=[];if(baseFunc){obj[queueName].Append(baseFunc);}
return function(param){if(jQuery.isFunction(param)){obj[queueName].Append(param)}else{jQuery.eachIf(obj[queueName],function(i,f){f(param);});}}}
SfsSearch.DisableEnterSubmit=function(component){if(jQuery.browser.msie){component.Functional()[0].onkeypress=function(){if(window.event.keyCode==13){return false;}}}else{component.Functional()[0].onkeypress=function(event){if(event.keyCode==13){return false;}};}}
SfsSearch.CollapseWhiteSpace=function(s){return s.replace(/(\r|\n|\t|\s+)/g,' ');}
jQuery.extend({eachIf:function(iterable,func){if(iterable){jQuery.each(iterable,func);}},mapObj:function(iterable,func,outObj){if(iterable){var o=outObj?outObj:{};jQuery.each(iterable,function(name,value){o[name]=func?func(value):value;});return o;}},mergeObj:function(params){var o=jQuery.mapObj(params);for(var i=1;i<arguments.length;i++){jQuery.mapObj(arguments[i],null,o);}
return o;},trueForAll:function(arr,predicate){var tfa=true;jQuery.each(arr,function(i,val){return tfa=val();});return tfa;}});jQuery.fn.extend({cssClass:function(){return jQuery(this).attr('class').split(/\s+?/)[0];}});SfsSearch.Empty=function(children,className,parent,SnearchName,baseUrl){var e=new SfsSearch.Search({SnearchName:SnearchName,Type:'Empty',Format:{className:className},Children:children,BaseUrl:baseUrl},parent);return e;}
SfsSearch.Section=function(titleText,className,children,parent,SnearchName){var s=new SfsSearch.Search({SnearchName:SnearchName,Type:"Section",Format:{titleText:titleText,className:className},Children:children},parent);return s;}
SfsSearch.ExpandableSection=function(titleText,className,children,parent,SnearchName){var s=SfsSearch.Section(titleText,className,children,parent,SnearchName);s.click(function(){s.contentDiv().slideToggle(200);s.Functional().toggleClass('expanded');});s.IsExpanded=function(){return jQuery(s.contentDiv().attr('id').IdSelector()+':visible').length==1;}
s.Serialize(function(arr){arr.Append(s.IsExpanded()?'1':'0');});s.RestoreState(function(cookieValues){if(cookieValues.length>0&&cookieValues.pop()=='1'){s.contentDiv().show();s.Functional().toggleClass('expanded');}else{s.contentDiv().css('display','none');}});return s;}
SfsSearch.TextInput=function(labelText,inputValue,parent,behavior,className){var ti=new SfsSearch.Search({SnearchName:"TextInput",Type:"TextField",Format:{inputValue:inputValue,labelText:labelText,className:className},Behavior:behavior});ti.Reset=function(){ti.value(inputValue);}
ti.IsActive=function(){return ti.value()&&ti.value()!=inputValue;}
ti.Active(ti.IsActive);ti.ContributeParams(function(params){params['l']=jQuery.trim(ti.value());});ti.Serialize(function(params){if(ti.IsActive()){SfsSearch.Search.SetCookie('l',ti.value());}});ti.RestoreState(function(){var queryParam=SfsSearch.Search.GetParamValue('l');var loc=queryParam?queryParam:null;if(!loc){var cookie=SfsSearch.Search.GetCookieValue('l');loc=cookie?cookie:null;}
if(loc){ti.value(loc);ti.Functional().removeClass('exampleText');}else{ti.Reset();}});ti.PostInit(function(){if(!ti.IsActive()){ti.Functional().addClass('exampleText');}});ti.click(function(){ti.value('');ti.Functional().removeClass('exampleText');SfsSearch.DisableEnterSubmit(ti);});return ti;}
SfsSearch.StateSelect=function(parent,behavior){var ss=new SfsSearch.Search({SnearchName:"StateSelect",Type:"StateSelect",Behavior:behavior},parent);ss.Reset=function(){ss.enable();ss.value('');}
ss.Active(function(){return ss.value();});return ss;}
SfsSearch.Location=function(labelText,inputValue,className,parent){var ti=SfsSearch.TextInput(labelText,inputValue,parent);var ss=SfsSearch.StateSelect(parent);ti.click(function(){ti.value('');ss.enable();});ti.keyup(function(){if(/\s*\d{5}/.test(ti.value())){ss.disable();}else{ss.enable();}});ti.ContributeParams=function(){};ti.Serialize=function(){};ti.RestoreState=function(){};var l=SfsSearch.Empty([ti,ss],className,parent);l.Active(function(){return ti.Active();});l.Serialize(function(arr){if(ti.IsActive()){SfsSearch.Search.SetCookie('l',l.Location());}});l.ContributeParams(function(params){params.l=jQuery.trim(l.Location());});l.RestoreState(function(cookieValues){var location=SfsSearch.Search.GetParamValue('l');if(location){l.Location(location);return;}
location=SfsSearch.Search.GetCookieValue('l');if(location){l.Location(location);return;}
ti.Reset();});l.ParseLocation=function(location){var cityState=location.split(/[^\w-]+/);if(cityState.length==1){return{city:cityState[0],state:null};}else{return{state:cityState.pop().toUpperCase(),city:cityState.join(' ')};}}
l.Location=function(location){if(location){var loc=l.ParseLocation(location);ti.value(loc.city);if(loc.state){ss.value(loc.state);}
ti.keyup();}else{var loc=ti.value();if(ss.Active()){loc+=', '+ss.value();}
return loc;}}
return l;}
SfsSearch.CheckBox=function(value,labelText,title,parent){var cb=new SfsSearch.Search({SnearchName:"CheckBoxComponent",Type:"CheckBox",Format:{value:value,labelText:labelText,title:SfsSearch.CollapseWhiteSpace(title)}},parent);cb.CheckBoxValue=value;cb.Reset=function(){cb.enable();cb.attr('checked',false);}
cb.Active(function(){return cb.IsChecked();});cb.ContributeParams(function(params){params[cb.Format.value]=true.toString();});cb.RestoreState(function(cookieValues){if(SfsSearch.Search.GetParamValue(value)){cb.Check();}});cb.IsChecked=function(){return this.Functional().attr('checked');}
cb.Check=SfsSearch.ActionQueue(cb,'Check',function(){cb.Functional().attr('checked',true);return cb;});cb.UnCheck=SfsSearch.ActionQueue(cb,'UnCheck',function(){jQuery(SfsSearch.Format('[value="CHECKBOX_VALUE"]',{CHECKBOX_VALUE:value})).attr('checked',false);});cb.click(function(){cb.IsChecked()?cb.Check():cb.UnCheck();SfsSearch.DisableEnterSubmit(cb);});cb.disable(function(){var label=jQuery("label",cb.Container());label.addClass(label.cssClass()+'_Disabled');});cb.enable(function(){var label=jQuery("label",cb.Container());label.removeClass(label.cssClass()+'_Disabled');});cb.DefaultChecked=function(){cb.PostInit(function(){if(!SfsSearch.Search.GetParamValue('l')&&!SfsSearch.Search.GetParamValue('vf')){cb.Check();}});cb.Reset=function(){cb.enable();cb.attr('checked',true);};return cb;}
return cb;}
SfsSearch.CheckBoxSection=function(titleText,className,expandable,children){var f=expandable?SfsSearch.ExpandableSection:SfsSearch.Section;var chldrn=[];for(var i=3;i<arguments.length;i+=3){chldrn.Append(SfsSearch.CheckBox(arguments[i],arguments[i+1],arguments[i+2]));}
var cbs=f(titleText,className,chldrn);cbs.Add=function(params){for(var i=0;i<arguments.length;i+=3){cbs.Children.Append(SfsSearch.CheckBox(arguments[i],arguments[i+1],arguments[i+2]));}
return cbs;}
return cbs;}
SfsSearch.RadioButton=function(value,labelText,title,groupName,parent){var rb=new SfsSearch.Search({SnearchName:"RadioButtonComponent",Type:"RadioButton",Format:{value:value,labelText:labelText,groupName:groupName,title:title}},parent);rb.RadioButtonValue=value;rb.Check=SfsSearch.ActionQueue(rb,'Check',function(){rb.Functional().attr('checked','checked');});rb.Active(function(){return rb.attr('checked');});rb.ContributeParams(function(params){params[rb.attr('name')]=rb.attr('value');});return rb;}
SfsSearch.RadioButtonList=function(className,groupName,children){var kids=[];for(var i=2;i<arguments.length;i+=3){var rb=SfsSearch.RadioButton(arguments[i],arguments[i+1],arguments[i+2],groupName);kids.Append(rb);}
var rbl=SfsSearch.Empty(kids,className);rbl.RadioButtons=kids;rbl.PostInit(function(){jQuery(SfsSearch.Format('[name="GROUP_NAME"]:first',{GROUP_NAME:groupName}),rbl.context).attr('checked',false);});rbl.Serialize(function(arr){var checkedRadio=jQuery('[type="radio"]:checked',rbl.Container());if(checkedRadio.length==1){arr.Append(checkedRadio.attr('id'));}});rbl.RestoreState(function(arr){if(arr&&arr.Last()){var checked=jQuery(arr.Last().IdSelector(),rbl.Container());if(checked.length==1){arr.pop();checked.attr('checked','checked');}}});return rbl;}
SfsSearch.Button=function(src,className,parent,behavior){var btn=new SfsSearch.Search({SnearchName:"ButtonComponent",Type:"Button",Format:{src:src,className:className},Behavior:behavior},parent);btn.ContributeParams=function(params){}
return btn;}
SfsSearch.Sprite=function(url,x,y,width,height,className,behavior,parent){var sprite=SfsSearch.Empty([],className,parent);sprite.PostInit(function(){sprite.Container().css({'background-position':'left','background-repeat':'no-repeat','background-image':'url("'+url+'")','width':width+'px','height':height+'px','background-position':SfsSearch.Format('XPOSpx YPOSpx',{XPOS:x.toString(),YPOS:y.toString()})});});for(var b in behavior){sprite[b](behavior[b]);}
return sprite;}
SfsSearch.SubmitButton=function(url,x,y,width,height,className,behavior,parent){var sprite=SfsSearch.Sprite(url,x,y,width,height,className,behavior,parent);sprite.click(function(){sprite.SetFocus();sprite.Submit();});jQuery(document).keyup(function(event){if(event.keyCode==13&&!sprite.Submit()){event.preventDefault();return false;}});return sprite;}
SfsSearch.LanguagesSection=function(className,expandable){return SfsSearch.CheckBoxSection("Languages",className,expandable,"arabic","Arabic","Arabic","cantonese","Cantonese","Cantonese","czech","Czech","Czech","dutch","Dutch","Dutch","french","French","French","german","German","German","greek","Greek","Greek","hindi","Hindi","Hindi","japanese","Japanese","Japanese","korean","Korean","Korean","mandarin","Mandarin","Mandarin","portuguese","Portuguese","Portuguese","romanian","Romanian","Romanian","russian","Russian","Russian","sign Language","Sign Language","Sign Language","spanish","Spanish","Spanish","tagalog","Tagalog","Tagalog","thai","Thai","Thai","vietnamese","Vietnamese","Vietnamese");}
SfsSearch.PersonalAssistanceSection=function(className,expandable){return SfsSearch.CheckBoxSection("Personal Assistance Offered",className,expandable,"assistance-activities-of-daily-living","Activities of Daily Living (bathing, grooming, dressing, eating, etc.)","Activities of Daily Living (bathing, grooming, dressing, eating, etc.)","assistance-catheter","Catheter management","A means to control incontinence; Managing a catheter may entail insertion, dressing changes, flushing, removal, etc.","housekeeping-laundry","Housekeeping/laundry","May include vacuuming, dusting, dish washing, bed making, etc.","colostomy-or-urostomy","Colostomy or Urostomy","A procedure that involves incisions in the colon or urinary system, respectively, to allow for drainage when the colon or urinary system is blocked or healing from injury or surgery. This assistance may include changing the collection bag, irrigation, and skin care around the incision.","toileting","Toileting","Toileting","mobility","Mobility Assistance","Mobility Assistance","foot-care","Foot Care","Foot Care","medication-management","Medication management","May entail following a formalized procedure with a written set of rules, management of timing and dosage, filling prescriptions, reminders to take medication, keeping medications locked up, etc.");}
SfsSearch.SpecializedCareSection=function(className,expandable){return SfsSearch.CheckBoxSection("Specialized Care",className,expandable,"alzheimers","Memory Care/Dementia","Brain disorder that gradually causes memory loss and hinders a person’s ability to communicate reason, make judgments, and carry out daily activities","arthritis","Arthritis","Degenerative joint disease that results in decreased ability and pain associated with movement","developmental-disabilities","Developmental disabilities","Developmental disabilities","diabetes-diet","Diabetes, Diet Controlled","Disease characterized by high blood sugar; Its health risks include heart and kidney disease, blindness, and nerve damage. It can be treated many ways, including consumption of a proper diet.","diabetes-oral-med","Diabetes, Oral Medication","Disease characterized by high blood sugar; Its health risks include heart and kidney disease, blindness, and nerve damage. It can be treated many ways, including use of oral medication.");}
SfsSearch.AlzheimersCareSection=function(className,expandable){return SfsSearch.CheckBoxSection("Alzheimer's Care Setting","SubSection",true,"alzheimers","Mixed","Mixed","alzheimers-dedicated","Dedicated Care Unit","Dedicated Care Unit");}
jQuery.extend(jQuery.mapObj(SNAP_Templates,function(template){return function(parent,params){parent.append(template,params);}}));SfsSearch.ErrorCriterion=function(criterion,response){this.criterion=criterion;this.response=response;}
SfsSearch.ComponentCollection=function(arr){this.components=arr;var me=this;jQuery.each(arr,function(i,val){me[i]=val;});this.click=function(func){return me._forEach('click',func);}
this.enable=function(){return me._forEach('enable');}
this.disable=function(){return me._forEach('disable');}
this.value=function(val){return me._forEach('value',val);}
this.attr=function(name,value){return me._forEach('attr',name,value);}
this.css=function(name,value){return me._forEach('css',name,value);}
this.length=function(){return me.components.length;}
this.each=function(func){jQuery.each(me.components,func);}
this.item=function(index){return me.components[index];}
this._forEach=function(funcName,arg1,arg2){var arr=[];jQuery.each(me.components,function(name,comp){arr.Append(comp[funcName](arg1,arg2));});return new SfsSearch.ComponentCollection(arr);}}
var a=["enable","disable","value","attr"];SfsSearch.Search=function(o,parent){if(!o.Type){o.Type='Empty';}
if(!o.SnearchName){o.SnearchName='';}
for(var x in o){this[x]=o[x];}
this.disabled=false;this.Initialized=false;this.EventsToBind={};this.hasFocus=false;this.context=parent;var me=this;this.typeTracker={};this.CreateId=function(cOrF){if(me.IsRoot()){return me.SnearchName.Append([SfsSearch.Search.WordSep,me.Type,cOrF]);}else{if(!me.Parent.typeTracker[me.Type+cOrF]){me.Parent.typeTracker[me.Type+cOrF]=0;}
var index=me.Parent.typeTracker[me.Type+cOrF]++;return me.Parent.containerId.Append([SfsSearch.Search.WordSep,me.Type,index,cOrF]);}};this.GetPlaceHolder=function(parentHtml){var placeHolder=jQuery("[id$='placeHolder']:first",parentHtml);var currentId=placeHolder.attr('id');var newId=SfsSearch.Search.placeHolderRegex.test(currentId)?currentId:me.containerId+'_placeHolder';placeHolder.attr('id',newId);me.placeHolderId=newId;};this.PlaceHolder=function(){return jQuery(me.placeHolderId.IdSelector(),parent?parent:me.context);};me.FunctionalPart=null;this.Functional=function(){if(!me.FunctionalPart){me.FunctionalPart=jQuery(me.functional.IdSelector(),me.context);}
return me.FunctionalPart;};this.Container=function(){return jQuery(me.containerId.IdSelector(),me.context);};this.SearchElements=function(typeName,toExclude,elements){if(!elements){elements=[];}
if((typeName==SfsSearch.Search.WildCard||me.Type==typeName)&&me!=toExclude){elements.Append(me);}
jQuery.eachIf(me.Children,function(i,child){child.SearchElements(typeName,toExclude,elements);});return new SfsSearch.ComponentCollection(elements);}
this.CheckBoxes=function(toExclude){return me.SearchElements("CheckBox",toExclude);}
this.TextInputs=function(toExclude){return me.SearchElements("TextField",toExclude);}
this.Buttons=function(toExclude){return me.SearchElements("Button",toExclude);}
this.Sections=function(toExclude){return me.SearchElements("Section",toExclude);}
this.RadioButtons=function(toExclude){return me.SearchElements("RadioButton",toExclude);}
this.All=function(toExclude){return me.SearchElements("*",toExclude);}
this.html=function(){return me.Container().html();};this.enable=SfsSearch.ActionQueue(this,"enable",function(){me.disabled=false;me.Functional().removeAttr('disabled');});this.disable=SfsSearch.ActionQueue(this,"disable",function(){me.disabled=true;me.Functional().attr('disabled',true);});this.value=function(val){return me.Functional().val(val);};this.attr=function(name,value){return me.Functional().attr(name,value);}
this.contentDiv=function(){return me.Children[0].PlaceHolder();};this.css=function(name,value){return me.Container().css(name,value);}
this.Root=null;this.GetRoot=function(){if(me.Root){return me.Root;}
var p=me;while(p.Parent){p=p.Parent;}
me.Root=p;return p;};this.IsRoot=function(){return me.GetRoot()==me;}
this.GetBaseUrlTokens=function(){var matches=null;var m=SfsSearch.Search.TokenRegex.exec(me.BaseUrl);while(m!=null){if(!matches){matches=new Object()};matches[m[1]]=m[2];m=SfsSearch.Search.TokenRegex.exec(me.BaseUrl);}
return matches;}
this.Reset=function(){jQuery.eachIf(me.Children,function(name,child){child.Reset();});}
this.Submit=function(){if(me.GetRoot().hasFocus){try{var params=me.GetRoot().Recurse('ContributeParams',me.GetRoot().DefaultParams,function(child){return child.Active();});}catch(e){return false;}
var url=me.BaseUrl;var tokens=me.GetBaseUrlTokens();jQuery.eachIf(tokens,function(wholeMatch,matchName){url=url.replace(wholeMatch,params[matchName]);delete params[matchName];});var location=url;var params=jQuery.param(params);if(params){location+='?'+params}
window.location=location;return true;}
return false;};this.Recurse=function(funcName,param,predicate){me[funcName](param);jQuery.eachIf(me.Children,function(i,child){if(!predicate||predicate(child)){child.Recurse(funcName,param,predicate);}});return param;}
this.Serialize=SfsSearch.ActionQueue(this,"Serialize");this.RestoreState=SfsSearch.ActionQueue(this,"RestoreState");this.PostInit=SfsSearch.ActionQueue(this,"PostInit");this.ContributeParams=SfsSearch.ActionQueue(this,"ContributeParams");this.activeCriteria=[];this.Active=function(func){if(func){me.activeCriteria.Append(func);}else{var response=me.Error();if(response){response(me);throw new Error();}else{return!me.disabled&&me.ContributeParams&&jQuery.trueForAll(me.activeCriteria);}}}
this.errorCriteria=[];this.Error=function(criterion){if(criterion){me.errorCriteria.Append(criterion);}else{for(var i=0;i<me.errorCriteria.length;i++){if(me.errorCriteria[i].criterion(me)){return me.errorCriteria[i].response;}}
return false;}}
this.AddErrorCriteria=function(criteria){jQuery.eachIf(arguments,function(i,criterion){me.Error(criterion);});return me;}
this.AddBehavior=function(behaviorObj){jQuery.eachIf(behaviorObj,function(name,val){me[name](val);});return me;}
this.SetCookie=function(){var arr=me.Recurse("Serialize",[]);if(arr.length>0){var date=new Date();date.setTime(date.getTime()+604800000);document.cookie=SfsSearch.Format(SfsSearch.Search.CookieTemplate,{SEARCH_NAME:me.SnearchName,COOKIE_VALUES:arr.join(SfsSearch.Search.CookieSep),EXPIRATION:date.toGMTString()});}}
this.GetCookie=function(){var match=new RegExp(SfsSearch.Format(SfsSearch.Search.CookieRegexTemplate,{SEARCH_NAME:me.SnearchName})).exec(document.cookie);if(match){var arr=match[1].split(SfsSearch.Search.CookieSep);arr.reverse();return arr;}else{return[];}}
this.SetFocus=function(){var root=me.GetRoot();if(!root.hasFocus){root.hasFocus=true;jQuery.each(SfsSearch.controls,function(name,value){if(value!=root){value.hasFocus=false};});}}
this.Init=function(parentHtml){if(!parent){me.context=parentHtml};me.Format=me.Format==null?{}:me.Format;me.functional=me.Format.functional=me.CreateId("F");me.containerId=me.Format.containerId=me.CreateId("C");me.GetPlaceHolder(parentHtml);jQuery[me.Type](me.PlaceHolder(),me.Format);var children={};jQuery.eachIf(me.Children,function(name,value){if(value){children[name]=value;value.SnearchName=me.SnearchName;value.BaseUrl=me.BaseUrl;value.Parent=me;if(!value.Submit){children[name]=new SfsSearch.Search(value,me.Container());}else{children[name].Init(me.Container());}
children[name].Parent=me;}});me.Children=children;me.Initialized=true;me.BindEvents(me.Behavior);me.PostInit();if(me.IsRoot()){jQuery(window).unload(function(){me.SetCookie();});}
me.click(function(){me.SetFocus();});};if(parent){this.Init(parent);}}
SfsSearch.Search.WildCard='*';SfsSearch.Search.CookieTemplate='SEARCH_NAME=COOKIE_VALUES; expires=EXPIRATION; path=/;';SfsSearch.Search.CookieRegexTemplate='SEARCH_NAME=(.+?)(;|$)';SfsSearch.Search.CookieSep='|';SfsSearch.Search.WordSep='_';SfsSearch.Search.placeHolderRegex=/[a-zA-Z0-9]+_([a-zA-Z0-9]+_?)+/;SfsSearch.Search.TokenRegex=/(\$\{([a-zA-Z]+)\})/g;SfsSearch.Search.GetParamValue=function(paramName){var re=new RegExp("[\\?&]?PARAM_NAME(=|/)([^&#]*?)(/|&|$)".replace(/PARAM_NAME/g,paramName));var matches=re.exec(window.location);if(matches&&matches[2]){return jQuery.trim(decodeURIComponent(matches[2])).replace(/\+/g,' ');}}
SfsSearch.Search.SetCookie=function(key,value){var date=new Date();date.setTime(date.getTime()+604800000);document.cookie=SfsSearch.Format(SfsSearch.Search.CookieTemplate,{SEARCH_NAME:key,COOKIE_VALUES:value,EXPIRATION:date.toGMTString()});}
SfsSearch.Search.GetCookieValue=function(key){var match=RegExp(SfsSearch.Format(SfsSearch.Search.CookieRegexTemplate,{SEARCH_NAME:key})).exec(document.cookie);if(match&&match[1]){return match[1];}}
SfsSearch.Search.Events=["blur","change","click","focus","keydown","keypress","keyup","mousedown","mouseup"];SfsSearch.Search.Events.Each(function(i,val){SfsSearch.Search.prototype[val]=function(func){if(this.Initialized){var element=this.Functional().length==1?this.Functional():this.Container();element[val](func);}else{this.EventsToBind[val]=func;}}});SfsSearch.Search.prototype.BindEvents=function(otherEvents){var me=this;jQuery.each(jQuery.mergeObj(this.EventsToBind,otherEvents),function(name,value){me[name](function(){value(me);});});}
jQuery.fn.extend({SfsSearch:function(name,baseUrl,className,defaultParams,rootComponent){if(this.length>1){return;}
jQuery(this).append('<div id="placeHolder"></div>');name=name.replace(/\s*/g,'');var fakeParent=jQuery('<div><div id="placeHolder" /></div>');SfsSearch.controls[name]=SfsSearch.Empty([rootComponent],className?className:name,fakeParent,name,baseUrl);jQuery(this).find('#placeHolder').replaceWith(fakeParent.find(SfsSearch.controls[name].PlaceHolder().attr('id').IdSelector()));if(defaultParams){SfsSearch.controls[name].DefaultParams=defaultParams;}
SfsSearch.controls[name].Recurse("RestoreState",SfsSearch.controls[name].GetCookie());return SfsSearch.controls[name];},VerticalSearch:function(targetUrl,searchName,title,checkBoxSections,hideSearchPreferences){jQuery(this).SfsSearch(searchName,targetUrl,'SNAP_VerticalSearch',{},SfsSearch.Section(title,"Root",[SfsSearch.Location("Enter a City or ZIP","e.g. Seattle or 98101","location"),SfsSearch.SubmitButton("/Portals/0/UI/search.gif",0,0,95,24,'submit'),SfsSearch.Sprite("/Portals/0/UI/start-over.gif",0,0,95,24,'startOver',{click:function(me){me.GetRoot().Reset();}}),SfsSearch.Section("","Criteria",checkBoxSections),hideSearchPreferences?null:SfsSearch.ExpandableSection('Search Preferences','SubSection',[SfsSearch.CheckBox('vf','Prioritize listings that report availability','When this box is checked, listings that report availability are shown first in the search results followed by all other listings').DefaultChecked()]),SfsSearch.Empty([],"rounded")]));}});