﻿
//Mise en place du liseret rouge automatique sur le titre


$(document).ready(function() {



});



//Permet de gerer l'affichage des boite de dialogue de login pour le haut de page et les boites de login
function afficheMdpLogin(nomDiv) {
    $('#' + nomDiv + ' input[type=text]').hide();
    $('#' + nomDiv + ' input[type=password]').show();
    $('#' + nomDiv + ' input[type=password]').focus();
}

function masqueMdpLogin(nomDiv, valeur) {
    if (valeur.length < 1) {
        
        $('#' + nomDiv + ' input[type=password]').hide();
        $('#' + nomDiv + ' input[type=text]').show();
       // $('#' + nomDiv + ' input[type=text]').focus();
    }

}



//-------------------------------------------------------


function changeFormQuiSommesNous(divmodif) {

    $('#' + "info" + QuiSommesNousCurrentTabs).hide();
    $('#' + "bt" + QuiSommesNousCurrentTabs).removeClass('QuiSommesNousPublicationsliSelected');


    $('#' + "info" + divmodif).show();
    $('#' + "bt" + divmodif).addClass('QuiSommesNousPublicationsliSelected');

    QuiSommesNousCurrentTabs = divmodif;

}



function rechLaLettreA() {

    //alert('terme recherche:' + $('#inpHeadKeywords').val());
    if ($('#inpHeadKeywords').val() != 'Rechercher ...') {
        window.location = ('/search/search.aspx?keywords=' + $('#inpHeadKeywords').val());
    }
    return false;

}

function rechLaLettreAKeyPress(e) {


    var key;

    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = e.which;     //firefox

    if (key == 13)
        return rechLaLettreA();
    else
        return true;
}

function scrollTo(name) {
    window.scroll(0, findPos(document.getElementById(name)) - 35);
}

function findPos(obj) {
    var curtop = 0;
    if (obj.offsetParent) {
        do {
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
        return [curtop];
    }
}



function blocPrecedent(div, current, max) {
    if (currentBloc[current] == 1) {
        return;
    }

    var nomDivMasque = '#' + div + '_' + currentBloc[current];
    currentBloc[current] = currentBloc[current] - 1;
    var nomDivAffchiche = '#' + div + '_' + currentBloc[current];

    //alert('Nom du div A Masque :' + nomDivMasque);
    //alert('Nom du div a afficher :' + nomDivAffchiche);

    $(nomDivMasque).fadeOut('slow', function () {
        $(nomDivAffchiche).fadeIn('slow', function () {
            // Animation complete
        });
    });
    $('#' + current).text(currentBloc[current]);
}

function blocSuivant(div, current, max) {
    if (currentBloc[current] == max) {
        return;
    }

    var nomDivMasque = '#' + div + '_' + currentBloc[current];
    currentBloc[current] = currentBloc[current] + 1;
    var nomDivAffchiche = '#' + div + '_' + currentBloc[current];

    //alert('Nom du div A Masque :' + nomDivMasque);
    //alert('Nom du div a afficher :' + nomDivAffchiche);

    $(nomDivMasque).fadeOut('slow', function () {
        $(nomDivAffchiche).fadeIn('slow', function () {
            // Animation complete
        });

    });
    $('#' + current).text(currentBloc[current]);
}


