JSVAL_NULL,
"_blank",
static nsresult OpenDialogWithArg( nsIDOMWindow     *parent,                                   nsISearchContext *arg,                                    const char       *url ) {    nsresult rv = NS_OK;    if ( parent && arg && url ) {        // Get JS context from parent window.        nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface( parent, &rv );        if ( NS_SUCCEEDED( rv ) && sgo ) {            nsCOMPtr<nsIScriptContext> context;            sgo->GetContext( getter_AddRefs( context ) );            if ( context ) {                JSContext *jsContext = (JSContext*)context->GetNativeContext();                if ( jsContext ) {                    void *stackPtr;                    jsval *argv = JS_PushArguments( jsContext,                                                    &stackPtr,                                                    "svs%ip",                                                    url,                                                    JSVAL_NULL,                                                    "chrome,resizable=no,dependent=yes",                                                    (const nsIID*)(&nsISearchContext::GetIID()),                                                    (nsISupports*)arg );                    if ( argv ) {                        nsIDOMWindow *newWindow;                        rv = parent->OpenDialog( jsContext, argv, 4, &newWindow );                        if ( NS_SUCCEEDED( rv ) ) {                            newWindow->Release();                        } else {                        }                        JS_PopArguments( jsContext, stackPtr );                    } else {                        DEBUG_PRINTF( PR_STDOUT, "%s %d: JS_PushArguments failed\n",                                      (char*)__FILE__, (int)__LINE__ );                        rv = NS_ERROR_FAILURE;                    }                } else {                    DEBUG_PRINTF( PR_STDOUT, "%s %d: GetNativeContext failed\n",                                  (char*)__FILE__, (int)__LINE__ );                    rv = NS_ERROR_FAILURE;                }            } else {                DEBUG_PRINTF( PR_STDOUT, "%s %d: GetContext failed\n",                              (char*)__FILE__, (int)__LINE__ );                rv = NS_ERROR_FAILURE;            }        } else {            DEBUG_PRINTF( PR_STDOUT, "%s %d: QueryInterface (for nsIScriptGlobalObject) failed, rv=0x%08X\n",                          (char*)__FILE__, (int)__LINE__, (int)rv );        }    } else {        DEBUG_PRINTF( PR_STDOUT, "%s %d: OpenDialogWithArg was passed a null pointer!\n",                      __FILE__, (int)__LINE__ );        rv = NS_ERROR_NULL_POINTER;    }    return rv;}