
// this function is used to change the tongue
// parameter :
//    country : the code of the new tongue
function changeLang(country) {
    document.parametersForm.lang.value = country;
    document.parametersForm.submit();
}

// this function is used to submit a form
function submitForm(form) {
    myForm = document.getElementsByName(form)[0].submit();
}

// this function change the background of an element to a specific className
function changeToGrayBackground(element, class_name) {
    element.className=class_name;
}

// function endsWith
String.prototype.endsWith = function(str) {
    return (this.match(str+"$")==str)
}

// function StartWith
String.prototype.startsWith = function(str) {
    return (this.match("^"+str)==str)
}

// function showHideDiv shows a hidden div, or hide a shown div
function showHideDiv(div) {
    
    // if the div is hidden
    if (div.style.display == "none") {
        div.style.display = "block";
    } else {
        div.style.display = "none";
    }
}