//Global var xhr_object = null; function create_xhr_var(){ xhr_object = null; if(window.XMLHttpRequest) // Firefox xhr_object = new XMLHttpRequest(); else if(window.ActiveXObject) // Internet Explorer xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); else { // XMLHttpRequest non supporté par le navigateur alert('Votre navigateur ne supporte pas cette fonctionalité. Installez la dernière version d\'Internet explorer ou de Firefox; Faute de quoi de nombreuses fonctionalités du site ne pourront être activées.'); return; } } function replaceAll(str, search, repl) { while (str.indexOf(search) != -1) str = str.replace(search, repl); return str; } function replaceAccents(str) { var norm = new Array('À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï', 'Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß', 'à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ', 'ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ý','þ','ÿ',' / ','/','---- ',' ----','- ',' ','\''); var spec = new Array('A','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I', 'D','N','O','O','O','0','O','O','U','U','U','U','Y','b','s', 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','d','n', 'o','o','o','o','o','o','u','u','u','u','y','y','b','y','-','-','','','','-','-'); for (var i = 0; i < spec.length; i++) str = replaceAll(str, norm[i], spec[i]); return str; } //cours_s_l.php function submit_filter_search_form(url) { document.form_filterSearch.action=url+"/annuaire/cours/"+replaceAccents(document.form_filterSearch.CAT_ID.options[document.form_filterSearch.CAT_ID.options.selectedIndex].text)+"_"+replaceAccents(document.form_filterSearch.LOC_ID.options[document.form_filterSearch.LOC_ID.options.selectedIndex].text)+"/"+document.form_filterSearch.CAT_ID.options[document.form_filterSearch.CAT_ID.options.selectedIndex].value+"_"+document.form_filterSearch.LOC_ID.options[document.form_filterSearch.LOC_ID.options.selectedIndex].value; document.form_filterSearch.submit(); } //cours_s.php function submit_filter_location_form(url, cat_id, cat_name) { document.form_filterSearch.action=url+"/annuaire/cours/"+replaceAccents(cat_name)+"_"+replaceAccents(document.form_filterSearch.LOC_ID.options[document.form_filterSearch.LOC_ID.options.selectedIndex].text)+"/"+cat_id+"_"+document.form_filterSearch.LOC_ID.options[document.form_filterSearch.LOC_ID.options.selectedIndex].value; document.form_filterSearch.submit(); } //cours_l.php function submit_filter_subject_form(url, loc_id, loc_name) { document.form_filterSearch.action=url+"/annuaire/cours/"+replaceAccents(document.form_filterSearch.CAT_ID.options[document.form_filterSearch.CAT_ID.options.selectedIndex].text)+"_"+replaceAccents(loc_name)+"/"+document.form_filterSearch.CAT_ID.options[document.form_filterSearch.CAT_ID.options.selectedIndex].value+"_"+loc_id; document.form_filterSearch.submit(); } //popup_contact.php function check_contact_form() { if(document.form_contact.name.value == '' || document.form_contact.email.value == '' || document.form_contact.message.value == '') alert("Un des champs du formulaire de contact est vide!"); else document.form_contact.submit(); } //signup/index.php function signup_change_account_type() { if(document.registration_form.type.value==0) { document.getElementById('div_enterprise_data').className ='hiddenDataBloc'; document.getElementById('div_professor_data').className ='visibleDataBloc60'; } else { document.getElementById('div_enterprise_data').className ='visibleDataBloc200'; document.getElementById('div_professor_data').className ='hiddenDataBloc'; } } //signup/index.php function check_signup_form() { if(document.registration_form.cug.checked == true) if(document.registration_form.description.value.length < 2000) document.registration_form.submit(); else alert('La \'description\' est trop longue (max. 2000 caractères)!'); else alert("Vous devez accepter les conditions générales ainsi que nos offres avant de pouvoir vous inscrire!"); } //login/index.php function check_login_form() { if(document.login_form.email.value.length > 0) if(document.login_form.password.value.length > 0) document.login_form.submit(); else alert("Entrez votre mot de passe avant de cliquer sur le bouton!"); else alert("Entrez votre adresse e-mail avant de cliquer sur le bouton!"); } //login/password.php function check_password_form() { if(document.password_form.email.value.length > 0) document.password_form.submit(); else alert("Entrez votre adresse e-mail avant de cliquer sur le bouton!"); } //signup/index //account/index function changeCountry(id) { if(id == "0") { document.getElementById('city').disabled =''; } else { document.getElementById('city').disabled ='disabled'; } } function setView(url,src,id,IP) { create_xhr_var(); xhr_object.open("POST", url+"/annuaire/widget_set_view.php", true); xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr_object.onreadystatechange = function() { if(xhr_object.readyState == 4) { } } var data = "src="+src+"&id="+id+"&IP="+IP; xhr_object.send(data); }