(function(){var A=new YAHOO.util.YUILoader({base:"",require:["animation","datasource","get","event","dom","history"],loadOptional:false,combine:true,filter:"MIN",allowRollup:true,onSuccess:function(){}});A.insert()})();var Pages=[];var Panels={toggleStep3:function(){$("step-3-container").show();$("step-2-container").hide();$("step-1-container").hide();$("bubble").hide()},toggleStep2:function(){$("step-3-container").hide();$("step-2-container").show();$("step-1-container").hide();$("step-2-state-asso").show();$("step-2-state-mls").show();$("step-2-state-no").hide();$("bubble").show();if($("return-state")){$("bread-crumbs").removeChild($("return-state"))}},toggleStep1:function(){$("step-3-container").hide();$("step-2-container").hide();$("step-1-container").show();$("bubble").hide();if($("return-home")){$("bread-crumbs").removeChild($("return-home"))}},HistoryCheck:function(C){var B=C.substr(5,1);switch(B){case"1":Pricing.Init();break;case"2":Pricing.GetStateInfo(C.substr(7));break;case"3":var A=C.split("-");Pricing.GetPricing(A[2],A[3]);break}}};var Pricing={Init:function(){var handleSuccess=function(o){Panels.toggleStep1();$("states").update();var nodesToAdd=[];var states=eval(o.responseText);var localEventCache=[];var mouseEventObservers=[];if(states.length>0){var columnCount=0;var nodeToAdd;var childNode;states.each(function(state){if(columnCount==0){nodeToAdd=new Element("div",{"class":"state-column"})}childNode=new Element("div",{id:"State_"+state.Abbreviation,"class":"result-item"}).update(state.StateName);localEventCache.push({node:childNode.id,handler:"click",fireEvent:Pricing.HandleStateChange.bind(state,state.Abbreviation)});localEventCache.push({node:childNode.id,handler:"mouseover",fireEvent:Pricing.mouseOver.bindAsEventListener(Pricing,"State_"+state.Abbreviation)});localEventCache.push({node:childNode.id,handler:"mouseout",fireEvent:Pricing.mouseOut.bindAsEventListener(Pricing,"State_"+state.Abbreviation)});nodeToAdd.appendChild(childNode);if(columnCount<9){columnCount++}else{columnCount=0}nodesToAdd.push(nodeToAdd)})}nodesToAdd.each(function(node){$("states").appendChild(node)});localEventCache.each(function(evt){$(evt.node).observe(evt.handler,evt.fireEvent)});mouseEventObservers=mouseEventObservers.concat(localEventCache)};var handleFailure=function(){};var callback={success:handleSuccess,failure:handleFailure,argument:["foo","bar"]};YAHOO.util.Connect.asyncRequest("POST","/Webservices/dsSearchAgentPricing.asmx/GetStates",callback)},InitializeHistory:function(){var A=YAHOO.util.History.getBookmarkedState("stepveiw");var C=A||"step-1";YAHOO.util.History.register("stepveiw",C,function(D){Panels.HistoryCheck(D)});YAHOO.util.History.onReady(function(){var D;D=YAHOO.util.History.getCurrentState("stepveiw");Panels.HistoryCheck(D)});try{YAHOO.util.History.initialize("yui-history-field","yui-history-iframe")}catch(B){}},GetPricing:function(associationID,searchSetupID){var handleSuccess=function(o){Panels.toggleStep3();var returnObj=eval(o.responseText);var Associations=returnObj[1].Associations;var Price=returnObj[0].Price;var assoNodesToAdd=[];$("mlsname").update();$("step-3-state-img").update();$("setup-price").update();$("idx-price").update();$("mls-price").update();$("stateAssociations3s").update();$("mlsname").update(Price.Name);$("step-3-state-img").appendChild(new Element("img",{src:Price.state,width:"100px"}));$("setup-price").update("$"+Price.SetupPrice+" - one time fee");$("idx-price").update("$"+Price.MonthlyPrice+"/month <br/>$"+Price.YearlyPrice+"/year*");if(Price.AgentFees==""&&Price.BrokerFees==""){$("border-2").hide();$("setup-MLS-fees-main").hide()}else{$("border-2").show();$("setup-MLS-fees-main").show();$("mls-price").update(Price.AgentFees+"<br />"+Price.BrokerFees)}if(Associations.length>0){var nodeToAdd;Associations.each(function(association){nodeToAdd=new Element("div",{id:"Asso_"+association.ID,"class":"result-list"}).update(association.Name);assoNodesToAdd.push(nodeToAdd)});assoNodesToAdd.each(function(node){$("stateAssociations3s").appendChild(node)})}};var handleFailure=function(){};var callback={success:handleSuccess,failure:handleFailure,argument:["foo","bar"]};var query="AssociationId="+associationID+"&SearchSetupId="+searchSetupID;YAHOO.util.Connect.asyncRequest("POST","/Webservices/dsSearchAgentPricing.asmx/GetPricing",callback,query)},GetStateInfo:function(stateAbbreviation){var assoNodesToAdd=[];var ssNodesToAdd=[];var localEventCache=[];var mouseEventObservers=[];Panels.toggleStep2();$("stateAssociations").update();$("stateImage").update();$("stateSearchsetups").update();var handleSuccess=function(o){var stateInfo=eval(o.responseText);var Associations=stateInfo[0].Associations;var SearchSetups=stateInfo[1].SearchSetups;if(Associations.length>0){var nodeToAdd;Associations.each(function(association){nodeToAdd=new Element("div",{id:"Asso_"+association.ID,"class":"result-item"}).update(association.Name);localEventCache.push({node:nodeToAdd.id,handler:"click",fireEvent:Pricing.HandleMLSChange.bind(association,association.ID,association.SearchSetupID,association.State)});localEventCache.push({node:nodeToAdd.id,handler:"mouseover",fireEvent:Pricing.mouseOver.bindAsEventListener(Pricing,"Asso_"+association.ID)});localEventCache.push({node:nodeToAdd.id,handler:"mouseout",fireEvent:Pricing.mouseOut.bindAsEventListener(Pricing,"Asso_"+association.ID)});assoNodesToAdd.push(nodeToAdd)});assoNodesToAdd.each(function(node){$("stateAssociations").appendChild(node)})}else{$("step-2-state-asso").hide();$("step-2-state-mls").hide();$("step-2-state-no").show()}if(SearchSetups.length>0){var nodeToAdd;SearchSetups.each(function(searchSetup){nodeToAdd=new Element("div",{id:"SS_"+searchSetup.SearchSetupID,"class":"result-item"}).update(searchSetup.Name);localEventCache.push({node:nodeToAdd.id,handler:"click",fireEvent:Pricing.HandleMLSChange.bind(searchSetup,searchSetup.AssociationID,searchSetup.SearchSetupID,searchSetup.State)});localEventCache.push({node:nodeToAdd.id,handler:"mouseover",fireEvent:Pricing.mouseOver.bindAsEventListener(Pricing,"SS_"+searchSetup.SearchSetupID)});localEventCache.push({node:nodeToAdd.id,handler:"mouseout",fireEvent:Pricing.mouseOut.bindAsEventListener(Pricing,"SS_"+searchSetup.SearchSetupID)});ssNodesToAdd.push(nodeToAdd)});ssNodesToAdd.each(function(node){$("stateSearchsetups").appendChild(node)})}$("stateImage").appendChild(new Element("img",{src:stateInfo[2].StateImage,width:"150px"}));$("bread-state");localEventCache.each(function(evt){$(evt.node).observe(evt.handler,evt.fireEvent)});mouseEventObservers=mouseEventObservers.concat(localEventCache)};var handleFailure=function(){};var callback={success:handleSuccess,failure:handleFailure,argument:["foo","bar"]};var query="State="+stateAbbreviation;YAHOO.util.Connect.asyncRequest("POST","/Webservices/dsSearchAgentPricing.asmx/GetStateInfo",callback,query)},HandleStateChange:function(D,A){var C,B;C="step-"+2+"-"+D;B=YAHOO.util.History.getCurrentState("stepveiw");if(C!=B){YAHOO.util.History.navigate("stepveiw",C);$("bread-crumbs").update();$("bread-crumbs").appendChild(new Element("div",{id:"return-home","class":"result-list",onClick:"YAHOO.util.History.navigate('stepveiw', 'step-1');"}).update("< < Back"))}},HandleMLSChange:function(B,A,E){var F,D;F="step-"+3+"-"+B+"-"+A;D=YAHOO.util.History.getCurrentState("stepveiw");if(F!=D){var C=[];YAHOO.util.History.navigate("stepveiw",F);if($("return-home")){$("bread-crumbs").removeChild($("return-home"))}$("bread-crumbs").appendChild(new Element("div",{id:"return-state","class":"result-list",onClick:"Pricing.HandleStateChange('"+E+"')"}).update("< < Back"))}},mouseOver:function(A){var B=A;B.addClassName("result-item-over")},mouseOut:function(A){var B=element;B.removeClassName("result-item-over")},};