var aoEngineCodes = { handleSuccess:function(o) { this.processResult(o); }, handleFailure:function(o) { emptySelect( document.getElementById( 'engine_code_filter' ) ); }, processResult:function(o) { response = o.responseText.parseJSON(); createSelect( document.getElementById( 'engine_code_filter' ), response[0], response[1] ); }, startRequest:function( params, selected ) { loading = new Array( 'Loading...' ); createSelect( document.getElementById( 'engine_code_filter' ), loading, '' ); YAHOO.util.Connect.asyncRequest('POST', '/ajax/ajax.php', aoEngineCodesCallback, "action=getEngineCodes¶ms=" + params.toJSONString() + '&selected=' + selected ); } }; var aoEngineCodesCallback = { success:aoEngineCodes.handleSuccess, failure:aoEngineCodes.handleFailure, scope: aoEngineCodes };