tab_url_theme = new Array(); tab_url_theme['Développement Personnel - Efficacité Pro']='http://www.comundi.fr/nos-formations/1288/developpement-personnel---efficacite-pro.html'; tab_url_theme['Documentation - Archives - Veille']='http://www.comundi.fr/nos-formations/1050/documentation---archives---veille.html'; tab_url_theme['Droit - Professions juridiques']='http://www.comundi.fr/nos-formations/1025/droit---professions-juridiques.html'; tab_url_theme['Etablissements de Santé']='http://www.comundi.fr/nos-formations/1039/etablissements-de-sante.html'; tab_url_theme['Gestion - Finance - Comptabilité']='http://www.comundi.fr/nos-formations/1010/gestion---finance---comptabilite.html'; tab_url_theme['Management']='http://www.comundi.fr/nos-formations/1284/management.html'; tab_url_theme['Marchés Publics - Contrats Publics']='http://www.comundi.fr/nos-formations/1020/marches-publics---contrats-publics.html'; tab_url_theme['Marketing - Communication - Internet']='http://www.comundi.fr/nos-formations/1053/marketing---communication---internet.html'; tab_url_theme['Qualité - Industrie - Innovation']='http://www.comundi.fr/nos-formations/1146/qualite---industrie---innovation.html'; tab_url_theme['Ressources Humaines - Formation']='http://www.comundi.fr/nos-formations/1002/ressources-humaines---formation.html'; tab_url_theme['Secrétaires - Assistant(e)s']='http://www.comundi.fr/nos-formations/1112/secretaires---assistant-e-s.html'; tab_url_theme['Secteur Public']='http://www.comundi.fr/nos-formations/1194/secteur-public.html'; tab_url_theme['Sécurité - Santé au travail - Environnement']='http://www.comundi.fr/nos-formations/1171/securite---sante-au-travail---environnement.html'; tab_url_theme['Services Généraux - Immobilier - Achats']='http://www.comundi.fr/nos-formations/1030/services-generaux---immobilier---achats.html'; tab_url_theme['Social et médico-social']='http://www.comundi.fr/nos-formations/1196/social-et-medico-social.html'; tab_url_theme['Systèmes d\'Information']='http://www.comundi.fr/nos-formations/1057/systemes-d-information.html'; function init_calendar() { $("#datedeb").datepicker({firstDay: 1, showOn: "both", buttonImage: "/image/calendar.gif", buttonImageOnly: true, buttonText: "Date"}); $("#datefin").datepicker({firstDay: 1, showOn: "both", buttonImage: "/image/calendar.gif",buttonImageOnly: true, buttonText: "Date"}); } function submitRecherche(type) { if(type=='motcle') { if(document.recherche.f_query.value) { document.recherche.submit(); } else { if(document.recherche.theme.options[document.recherche.theme.selectedIndex].value!='') { // thème location.href=tab_url_theme[document.recherche.theme.options[document.recherche.theme.selectedIndex].value]; } else { alert('Merci de renseigner un mot-clé'); } } } else if(type=='periode') { if(document.recherche.datedeb.value && document.recherche.datefin.value ) { document.recherche.submit(); } else { if(document.recherche.theme.options[document.recherche.theme.selectedIndex].value!='') { // thème location.href=tab_url_theme[document.recherche.theme.options[document.recherche.theme.selectedIndex].value]; } else { alert('Merci de renseigner une période'); } } } } /* * function date_anterieur() * * Empêche l'utilisateur de rentrer une date de fin > à la date de début */ function date_anterieur() { var debut = document.getElementById('datedeb').value != '' ? document.getElementById('datedeb').value : ''; var fin = document.getElementById('datefin').value != '' ? document.getElementById('datefin').value : ''; if(debut != '' && fin != '') { var erreur = ''; tab_debut = debut.split('/'); tab_fin = fin.split('/'); if(tab_debut[2] == tab_fin[2]) // 1 : si les deux dates ont la même année : continue { if(tab_debut[1] == tab_fin[1]) // 2 : si les deux dates ont le même mois : continue { if(tab_debut[0] > tab_fin[0]) // 3 : si la jour de début est sup au jour de fin : erreur { erreur = 1; } } else if(tab_debut[1] > tab_fin[1]) // 2 : sinon le mois du début est sup au mois de fin : erreur { erreur = 1; } } else if(tab_debut[2] > tab_fin[2]) // 1 : sinon l'année du début est sup à l'année de fin : erreur { erreur = 1; } if(erreur != '') { alert('Attention : la date de fin ne peut être inférieure à la date de début'); document.getElementById('datefin').value = ''; } } } function menu( l_id, l_other ) { document.getElementById(l_id).className = "select"; document.getElementById(l_other).className = "normal"; switch (l_id) { case "motcle" : HTMLform = '
' ; break; case "date" : HTMLform = '' ; break; } document.getElementById("form").innerHTML = HTMLform ; init_calendar(); } menu('motcle','date');