function landingModuleHandler(){this.myId;this.userData;this.myView;this.container;this.isSubView=true;this.propertyTypeList=[];this.myView=new landingModule(this.callbackHandlerFn,this);this.init()}landingModuleHandler.prototype.loadView=function(c,a,b){this.myId=c;this.viewContainer=a;this.subViewContainer=b;this.myView.initialize(this.viewContainer,this.subViewContainer,this.isSubView,this);reapfield.G_API.getAllStateList();if(this.propertyTypeList.length){document.getElementById(this.myView.propertyTypeDivList).innerHTML=this.myView.createDropDownList(this.propertyTypeList,"id","name",this.myView.propertyTypeDivId,"Property Type")}else{if(reapfield.G_API.propertyTypeList.length&&reapfield.G_API.propertySubTypeList.length){this.initPropertyTypeValues()}}};landingModuleHandler.prototype.loadDetailData=function(a){reapfield.G_API.getUserProfileData(a)};landingModuleHandler.prototype.getPropertyTypeListDataListener=function(b){var a=[];if(reapfield.G_ViewMgr.LayoutMgr.activeLayout!="landing"){return}if(reapfield.G_API.propertyTypeList.length<=0){reapfield.G_API.propertyTypeList=b.data}};landingModuleHandler.prototype.propertySubTypesListArrivedListener=function(a){if(reapfield.G_ViewMgr.LayoutMgr.activeLayout!="landing"){return}this.myView.showSubTypes(a.data)};landingModuleHandler.prototype.allPropertySubTypesListArrivedListener=function(a){if(reapfield.G_ViewMgr.LayoutMgr.activeLayout!="landing"){return}this.getAllPropertySubType(a)};landingModuleHandler.prototype.getAllPropertySubType=function(a){if(reapfield.G_API.propertySubTypeList.length<=0){reapfield.G_API.propertySubTypeList=a.data}this.initPropertyTypeValues()};landingModuleHandler.prototype.initPropertyTypeValues=function(){var c=reapfield.G_API.propertyTypeList,g=reapfield.G_API.propertySubTypeList,e=[];for(var b=0;b<c.length;b++){var d=c[b].propertytype_propertytypeid,a="-- All "+c[b].propertytype_propertytype+" --";e.push({id:d,name:a,isSubType:false});for(var f=0;f<g.length;f++){if(g[f].propertytypeid==d){e.push({id:g[f].propertysubtypeid,name:g[f].propertysubtype,isSubType:true})}}}this.propertyTypeList=e;document.getElementById(this.myView.propertyTypeDivList).innerHTML=this.myView.createDropDownList(e,"id","name",this.myView.propertyTypeDivId,"Property Type")};landingModuleHandler.prototype.backGroundImageListener=function(a){document.getElementById("reapFieldLandingContent").style.background="transparent url("+a.data.URL+") no-repeat scroll 0 0"};landingModuleHandler.prototype.allStatesListListener=function(a){var b=document.getElementById(this.myView.stateTypeDivList);if(b){b.innerHTML=this.myView.createDropDownForStateList(a.data,"state_stateid","state_statename","stateTypeDivId","State");this.myView.eventHandler(document.getElementById("stateTypeDivId"),"change",this.callbackFn,this.owner)}};landingModuleHandler.prototype.contactSuburbsListListener=function(a){var b=document.getElementById(this.myView.suburbTypeDivList);if(b){b.innerHTML=this.myView.createDropDownForStateList(a.data,"suburb_suburbid","suburb_suburbtype","suburbTypeDivId","Area")}};landingModuleHandler.prototype.init=function(){reapfield.G_EventMgr.registerEvent("allPropertyTypesListArrived",this,"getPropertyTypeListDataListener");reapfield.G_EventMgr.registerEvent("propertySubTypesListArrived",this,"propertySubTypesListArrivedListener");reapfield.G_EventMgr.registerEvent("getPropertySubTypeListDataEvents",this,"allPropertySubTypesListArrivedListener");reapfield.G_EventMgr.registerEvent("backGroundImage",this,"backGroundImageListener");reapfield.G_EventMgr.registerEvent("allStatesListArrived",this,"allStatesListListener");reapfield.G_EventMgr.registerEvent("allSuburbListForpropertyArrived",this,"contactSuburbsListListener")};landingModuleHandler.prototype.profileDataListener=function(a){this.myView.displayMainViewData(a.data);this.myView.displaySubViewData(a.data)};landingModuleHandler.prototype.callbackHandlerFn=function(d,c,a){if(d=="landingPageSearchSubmit"){var b={moduleId:"43",detailId:c};reapfield.G_EventMgr.fireEvent("loadModuleEvent",b)}else{if(d=="loadNewProjectPage"){var b={moduleId:"5",detailId:c};reapfield.G_EventMgr.fireEvent("loadModuleEvent",b)}}};function landingModule(b,a){this.owner=a;this.callbackFn=b}landingModule.prototype.initialize=function(d,b,c,a){this.viewParentObj=d||document.body;this.subViewParentObj=b||document.body;this.isSubView=c;this.agentNameId="agentName";this.agentTypeId="agentType";this.agentDescriptionId="agentDescription";this.agentTestimonialId="agentTestimonialDescritpion";this.agentContactId="agentContactDetail";this.agentSpecialityId="agentSpeciality";this.agentOfficeId="agentOfficeDesc";this.quickSearchDivId="quickSearchDivId";this.quickSearchPriceFrom="quickSearchPriceFrom";this.quickSearchPriceto="quickSearchPriceto";this.quickSearchkeyword="quickSearchkeyword";this.stateTypeDivList="stateTypeDivList";this.suburbTypeDivList="suburbTypeDivList";this.propertyTypeDivList="propertyTypeDivList";this.propertyTypeDivId="propertytypeid";this.searchtypeOptionBuy="searchtypeOptionBuy";this.searchtypeOptionRent="searchtypeOptionRent";this.propertySubTypeDivId="propertySubTypeContainer";this.propertySubTypeListId="propertysubtypeid";this.createMainView();if(this.isSubView){this.createSubMainView()}};landingModule.prototype.showView=function(c,e,b,d,a){};landingModule.prototype.createMainView=function(){var d='<div class="linkItem"><div class="reapFieldLandingContent" id="reapFieldLandingContent" ><div id="quickSearch" style="width:290px;margin-left:auto;margin-right:auto;">';d+='<form name="'+this.quickSearchDivId+'" id="'+this.quickSearchDivId+'">					<table cellspacing=0 cellpadding=0 style="width:270px">					<tr><td class="cornerImageSize"><div class="quickLeftSearchTop"></div></td><td style="background-color:#333333;width:240px;"></td><td class="cornerImageSize"><div class="quickRightSearchTop"></div></td></tr>					<tr><td colspan="3" style="background-color:#333333;color:#ffffff;">					<div class="quickSearchTitle reapFieldInnerFooter" style="margin-top:6px;">You are looking to...</div>					<div class="reapFieldInnerFooter" style="margin-top:6px;">							<input type="radio" id="'+this.searchtypeOptionBuy+'" name="searchtypeOption"  value="1" /><span class="searchTypeLabel">Buy</span>							<input type="radio" id="'+this.searchtypeOptionRent+'" name="searchtypeOption"  value="2" /><span class="searchTypeLabel">Rent</span>					</div>					<div class="reapFieldInnerFooter reapFieldLanding">					<span id="'+this.propertyTypeDivList+'" class="propertyTypeSearchFieldLength"><select class="propertyTypeSearchFieldLength" name="propertyTypeDivId" id="propertyTypeDivId"><option value="">Property Type</option></select></span>					</div>					<div class="reapFieldInnerFooter reapFieldLanding">					<span id="'+this.stateTypeDivList+'" ><select class="propertyTypeSearchStateFieldLength" name="stateTypeDivId" id="stateTypeDivId"><option value="">State</option></select></span>					<span id="'+this.suburbTypeDivList+'" ><select class="propertyTypeSearchStateFieldLength" name="suburbTypeDivId" id="suburbTypeDivId"><option value="">Area</option></select></span>					</div>					<div class="reapFieldInnerFooter reapFieldLanding"><input type="text" id="'+this.quickSearchkeyword+'" name="'+this.quickSearchkeyword+'"  value="Location Keyword" class="quickSearchwaterMarkFieldLength"/></div>					<div id="'+this.propertySubTypeDivId+'"></div>					<div class="reapFieldInnerFooter reapFieldLandingLarge"><span><input type="text" id="'+this.quickSearchPriceFrom+'" class="quickSearchwaterMarkFieldsw" value="Price From"></span><span>						<input type="text" id="'+this.quickSearchPriceto+'" class="quickSearchwaterMarkFieldsw" value="Price To"></span></div>					<div class="reapFieldInnerFooter reapFieldLanding"><input type="submit" name="keyword" value="Search" class="reapFieldCommonBtn SearchBtn"  /></div>					</td></tr>					<tr><td class="cornerImageSize"><div class="quickLeftSearchBottom"></div></td><td style="background-color:#333333;width:240px;"></td><td class="cornerImageSize"><div class="quickRightSearchBottom"></div></td></tr>					</table>				</div></form></div>';this.viewParentObj.innerHTML=d;var c=document.getElementById(this.quickSearchPriceFrom);var b=c.value;this.watermarkEventHandler(c,b);var a=document.getElementById(this.quickSearchPriceto);var b=a.value;this.watermarkEventHandler(a,b);var a=document.getElementById(this.quickSearchkeyword);var b=a.value;this.watermarkEventHandler(a,b);this.eventHandler(document.getElementById(this.quickSearchDivId),"submit",this.callbackFn,this.owner);this.eventHandler(document.getElementById("reapFieldLandingContent"),"click",this.callbackFn,this.owner);reapfield.G_API.getBackgroundImage()};landingModule.prototype.createSubMainView=function(){var a='<div class="reapFieldLandingFooter"  style="margin-left:30px;"><span class="reapHeadingSpan">Heading</span>						<ul style="padding-left:17px;margin:0px;"><li>link1</li><li>link2</li><li>link3</li></ul></div>                    <div class="reapFieldLandingFooter"><span class="reapHeadingSpan">Heading</span>						<ul style="padding-left:17px;margin:0px;"><li>link1</li><li>link2</li><li>link3</li></ul></div>                    <div class="reapFieldLandingFooter"><span class="reapHeadingSpan">Heading</span>						<ul style="padding-left:17px;margin:0px;"><li>link1</li><li>link2</li><li>link3</li></ul></div>                    <div class="reapFieldLandingFooter"><span class="reapHeadingSpan">Heading</span>						<ul style="padding-left:17px;margin:0px;"><li>link1</li><li>link2</li><li>link3</li></ul></div>';this.subViewParentObj.innerHTML=a};landingModule.prototype.displayMainViewData=function(e){var a=document.getElementById(this.agentNameId);var c=document.getElementById(this.agentTypeId);var d=document.getElementById(this.agentDescriptionId);var b=document.getElementById(this.agentTestimonialId);d.innerHTML=(e.user_aboutme||"");b.innerHTML=(e.user_testimonials||"");a.innerHTML=(e.user_fname||"")+" "+(e.user_lname||"")};landingModule.prototype.displaySubViewData=function(c){var b=document.getElementById(this.agentContactId);var d=document.getElementById(this.agentSpecialityId);var a=document.getElementById(this.agentOfficeId);b.innerHTML=(c.user_unitnumber||"")+" "+(c.user_blocknumber||"")+" "+(c.user_street||"")+" "+(c.user_statename||"");d.innerHTML=(c.user_suburbtype||"");a.innerHTML=(c.user_statename||"")};landingModule.prototype.showSubTypes=function(a){var b=document.getElementById(this.propertySubTypeDivId);b.innerHTML=this.createDropDownList(a,"propertysubtype_propertysubtypeid","propertysubtype_propertysubtype",this.propertySubTypeListId,"Property Subtype");b.className="reapFieldInnerFooter reapFieldLanding"};landingModule.prototype.hideSubTypes=function(a){var b=document.getElementById(this.propertySubTypeDivId);b.innerHTML="";b.className=""};landingModule.prototype.watermarkEventHandler=function(d,b){var e=this;function a(h){var f=b;var g=d;g.style.color="#222";g.value=(d.value==f)?"":d.value}function c(f){e.blurAssignText(d,b)}reapfield.AttachEvent(d,"focus",a,false);reapfield.AttachEvent(d,"blur",c,false)};landingModule.prototype.blurAssignText=function(c,b){var a=b;if(c.value==""){c.value=a;c.style.color="#999"}else{if(c.value==a){c.style.color="#999"}else{c.style.color="#222"}}};landingModule.prototype.eventHandler=function(e,b,g,a,c){var f=this;function d(o){if(!o){o=window.event}if(e.id=="stateTypeDivId"){var q=document.getElementById("stateTypeDivId");if(q.selectedIndex>0){reapfield.G_API.getAllCallByPropertySuburbList(q.value)}}else{if(e.id=="reapFieldLandingContent"){if(o.target.id!="reapFieldLandingContent"){return false}else{g("loadNewProjectPage",j,a)}}else{if(e.id==f.quickSearchDivId){var r=0,h=0;if(document.getElementById(f.searchtypeOptionBuy).checked){r=document.getElementById(f.searchtypeOptionBuy).value}else{if(document.getElementById(f.searchtypeOptionRent).checked){r=document.getElementById(f.searchtypeOptionRent).value}}var p=document.getElementById(f.quickSearchkeyword),l=document.getElementById(f.quickSearchPriceFrom).value,k=document.getElementById(f.quickSearchPriceto).value,m=p.value,j=new Object();if(parseInt(r)>0){j.searchOption=r}if(parseInt(l)>0){j.searchPriceFrom=parseFloat(l)}if(parseInt(k)>0){j.searchPriceTo=parseFloat(k)}if(m.toLowerCase()!="Location Keyword".toLowerCase()){j.locationKeyword=m}var n=document.getElementById(f.propertyTypeDivId);if(n.selectedIndex>0){var i=f.getPropertyType(n.selectedIndex);if(i=="type"){j.propertyType=n.value}else{if(i=="subtype"){j.propertySubType=n.value}}}var q=document.getElementById("stateTypeDivId");if(q.selectedIndex>0){j.stateId=q.value}var s=document.getElementById("suburbTypeDivId");if(s){if(s.selectedIndex>0){j.statesuburbId=s.value}}g("landingPageSearchSubmit",j,a);if(o.preventDefault){o.preventDefault()}o.returnValue=false;return false}}}}if(e){reapfield.AttachEvent(e,b,d,false)}};landingModule.prototype.getPropertyType=function(a){var b="type";if(this.owner.propertyTypeList[a-1].isSubType){b="subtype"}return b};landingModule.prototype.createDropDownForStateList=function(g,d,b,c,f){var a='<select name="'+c+'" id="'+c+'" class="propertyTypeSearchStateFieldLength">						<option value="" >'+f+"</option>";for(var e=0;e<g.length;e++){var h=g[e];a+='<option  value="'+h[d]+'">'+(h[b]||"")+"</option>"}a+="</select> ";return a};landingModule.prototype.createDropDownList=function(g,d,b,c,f){var a='<select name="'+c+'" id="'+c+'" class="propertyTypeSearchFieldLength"><option value="" selected>'+f+"</option>";for(var e=0;e<g.length;e++){var h=g[e];a+='<option  value="'+h[d]+'">'+(h[b]||"")+"</option>"}a+="</select> ";return a};