var ProposalStoriesRequestRules={"#step_two textarea.text_input_with_limit":function(A){A.onkeyup=function(C){var G=getEventSrc(C);if(G){var D=getObj(G.getAttribute("output_limit"));var B=parseFloat("0"+G.getAttribute("limit"));var E=parseFloat("0"+G.value.length);var F=B-E;if(F<0){G.value=G.value.substring(0,B)}if(D){D.innerHTML=F;if(F<=0){D.style.color="#cc3333"}else{D.style.color="#555555"}}}};A=null},"#step_two select.countryDropDown":function(A){A.onchange=function(C){var B=getEventSrc(C);updateStateForCountry(B);objAccountType=null};A.onkeyup=A.onchange;A=null},"#clearFields":function(A){A.onclick=function(C){var G=getEventSrc(C);if(G){var F=G.getAttribute("fieldsToClear");if(F){var E=F.split(",");for(var D=0;D<E.length;D++){var B=getObj(E[D]);if(B){B.options[0].selected=1}}}}return false};A=null}};function addMainProposalStoriesRequestRules(){if(Behaviour){Behaviour.register(ProposalStoriesRequestRules)}}if(LoadState.addToLoadQueue){LoadState.addToLoadQueue(addMainProposalStoriesRequestRules,null,"addMainProposalStoriesRequestRules");LoadState.addToLoadQueue(updateDropDowns,null,"updateDropDowns")}function updateDropDowns(){var B=getObj("proposal_country");var A=getObj("wedding_country");if(B){updateStateForCountry(B)}if(A){updateStateForCountry(A)}}function updateStateForCountry(A){if(A){var B=getObj(A.getAttribute("state_drop_down"));if(A.value=="United States"){if(B){B.className="stateDropDownUS"}}else{if(B){B.className="stateDropDownOther";B.options[0].selected=1}}}};