function popup(url, width, height)
{
    var params = "";
    if (width != 0 && height != 0) {
        params = "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes";
    } else {
        params = "";
    }
    window.open(url, 'popup', params);
}

function getSWF(movieName)
{
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return document.getElementById(movieName);
    } else {
        return document[movieName];
    }
}

var assistantInit = false;
function navhSearch(p_form)
{
    var rc = true;
    if (assistantInit)
    {
        var restrict = p_form.restrict.value;
        if (restrict == "" || restrict == "[agenceparticuliers]" || restrict == "[agenceprofessionnels]") {
            if (configNotSupported) {
                showMinimalConfig();
            } else if (!playerInstallFailed() && !isEliotHS() && !isEliotHostHS()) {
                if (playerNotInstalled) {
                    // le player flash n'est pas installé...on lance la procédure d'installation en précisant les
                    // paramètres de recherche (nom du formulaire, saisie, index du domaine de restriction sélectionné)
                    startPlayerInstall(p_form.name, p_form.words.value, p_form.restrict.selectedIndex);
                    rc = false; // Le lancement de la recherche est retardé s'il concerne également htdig
                } else {
                    if (restrict == "") {
                        restrict = "tout";
                    } else {
                        restrict = restrict.substring(1, restrict.length - 1);
                        rc = false;
                    }

                    var query = "saisie=" + escape(p_form.words.value) + "&restrict=" + escape(restrict) + "&param=" + escape("request_from(external)")

                    // acquisition mutex
                    if (getSWF("eliotManager")) {
                        getSWF("eliotManager").SetVariable("commandLine", "getMutex");
                    }

                    // Ouverture/ Mise sous focus d'Eliot
                    if (eliotIsOpened) {
                        if (getSWF("eliotManager")) {
                            getSWF("eliotManager").SetVariable("commandLine", "callEliot:" + query);
                        }
                    } else {
                        setEliotStatus(true); // exigé
                        showAssistant(query);
                    }
                }
            }
        }
    }
    return rc;
}

/**
 * Method; onWordsGetFocus
 * @description focus sur champ de saisie
 */
	function onWordsGetFocus(obj)
	{
		obj.value='';
		if ( getSWF("eliotManager") && !playerNotInstalled )
			getSWF("eliotManager").SetVariable("commandLine", "resolveEliotStatus");
	}
	
/**
 * Method; onRestrictChanged
 * @description evenement onChange de la combobox restrict
 */	
	function onRestrictChanged()
	{
		if ( getSWF("eliotManager") && !playerNotInstalled )
			getSWF("eliotManager").SetVariable("commandLine", "resolveEliotStatus");
	}

