/******************************************************************************
* xKblRFonction.js
*******************************************************************************

*******************************************************************************
*                                                                             *
* Copyright 2009									                          *
*                                                                             *
******************************************************************************/
/* Gestion champ recherche */
function inputFocus(inputValue, inputId, searchTitle){
	if(inputValue == searchTitle && inputId == "fulltextField"){
		document.getElementById(inputId).value="";
	}else if(inputValue == "" && inputId == "fulltextField"){
		document.getElementById(inputId).value = searchTitle;
	}
}

function updateValeurs(isin)
{
    var form = document.forms.simu;

    if (!form)
    return;

    var val = form.valeurs.value;
    var pos = val.indexOf(isin);

    if (pos >= 0)
        val = val.substr(0, pos) + val.substr(pos+isin.length)
    else
        val += " " + isin;

    form.valeurs.value = val;

    val = ' ' + val.replace(/^\s+/, "");
    var valArr = val.split(' #');
    var count = 0;
    for (var i = 0; i < valArr.length; i++) {
        if (valArr[i].length > 1)
            count++;
    }
    if (count > 3) {
        alert("Vous ne pouvez sélectionner plus de 3 valeurs à afficher (" + val + ")")
    }

}
