function gup(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");b=RegExp("[\\?&]"+b+"=([^&#]*)").exec(window.location.href);return null==b?"":decode(b[1])}function decode(b){return unescape(b.replace(/\+/g," "))}
$(document).ready(function(){$('#s_submit[type="submit"]').attr("disabled","true");$('#s_cmpid[type="hidden"]').attr("value",CMPID);$('#s_target_id[type="hidden"]').attr("value",TARGET_ID);var b;$.getJSON("http://go.tollbrothers.com/ws/event/statesAndCounties.json?callback=?&id=34",function(a){var c='<option value="">-Select State-</option>';$.each(a,function(a,e){b=e.states;$.each(e.states,function(b,a){c+='<option value="'+a.abbrev+'">'+a.name+"</option>"})});$("select#s_state").html(c);if(a=gup("s_state"))$("#s_state").val(a),
$("#s_state").trigger("change")});$("select#s_state",this).change(function(){0==$(this).val().length?$('#s_submit[type="submit"]').attr("disabled","true"):$('#s_submit[type="submit"]').removeAttr("disabled");var a=$(this).get(0).selectedIndex,c=b[a-1],d='<option value="">-Select Region-</option>';0<a&&($("#region").val(c.region?c.region:""),d='<option value="">-All Regions-</option>',$.each(c.counties,function(b,a){d+='<option value="'+a+'">'+a+"</option>"}));$("select#county").html(d);(a=decode(gup("county")))&&
$("#county").val(a)})});

