﻿
function effacer(target) {
    if (target.value == target.defaultValue) { target.value = ""; }
}

function remplacer(target) {
    if (target.value == "") { target.value = target.defaultValue; }
}

function verif_recherche() {
    if (trim(document.frmRecherche.search.value) != "")
        return true;
    else
        alert("Recherche invalide");
    return false;
}

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
