Event.observe(window,'load',bindElements); Gquicksearch=""; function none(){ } function googlemap() { try{ if (GBrowserIsCompatible() && longit >0 && latit > 0) { var map = new GMap2(document.getElementById("map_canvas")); var mapTypeControl = new GMapTypeControl(); var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10)); var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10)); map.addControl(mapTypeControl, topRight); GEvent.addListener(map, "dblclick", function() { map.removeControl(mapTypeControl); map.addControl(new GMapTypeControl(), bottomRight); }); map.addControl(new GSmallMapControl()); map.setCenter(new GLatLng(latit,longit), 15); var point = new GLatLng(latit,longit); map.addOverlay(new GMarker(point)); } } catch(e){} } function click_me(element) { try {//pour ie document.getElementById(element).click(); }catch(e) {//pour ff var evt = document.createEvent("MouseEvents"); // créer un évennement souris evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); // intiailser l'évennement déja crée par un click var cb = document.getElementById(element); // pointe sur l'élement cb.dispatchEvent(evt); // envoyer l'évennement vers l'élement } } function switchById(sId) { if($(sId).style.display=='block') { $(sId).style.display='none' } else { $(sId).style.display='block' } } function bindElements(){ if($('header')){setHeader();} antiSpam(); googlemap(); //menuLeft initMenu(); // Obligatoirement après setHeader() - IE6 // comportement('onglet'); // check_ouverture(); if($('quickSearch1')){ new Ajax.Autocompleter("quickSearch1","quickSuggestions","/ajax/quicksearch/rubriques",{paramName:"type", minChars:'3'}); new Ajax.Autocompleter("quickSearch2","quickSuggestions","/ajax/quicksearch/noms",{paramName:"type", minChars:'5'}); new Ajax.Autocompleter("quickSearch3","quickSuggestions","/ajax/quicksearch/localites",{paramName:"type", minChars:'3'}); } if($('fichederoul_resto')){ new Ajax.Autocompleter("localite_resto","quickSuggestions","/ajax/quicksearch/localites",{paramName:"type"}); new Ajax.Autocompleter("cp_resto","quickSuggestions","/ajax/quicksearch/postaux",{paramName:"type"}); new Ajax.Autocompleter("arrondissement_resto","quickSuggestions","/ajax/quicksearch/arrondissements",{paramName:"type"}); new Ajax.Autocompleter("cuisine_resto","quickSuggestions","/ajax/quicksearch/cuisines",{paramName:"type"}); } if($('fichederoul_hotel')){ new Ajax.Autocompleter("localite_hotel","quickSuggestions","/ajax/quicksearch/localites",{paramName:"type"}); new Ajax.Autocompleter("cp_hotel","quickSuggestions","/ajax/quicksearch/postaux",{paramName:"type"}); new Ajax.Autocompleter("arrondissement_hotel","quickSuggestions","/ajax/quicksearch/arrondissements",{paramName:"type"}); } if($('fichederoul_rubrique')){ new Ajax.Autocompleter("rubrique_rubrique","quickSuggestions","/ajax/quicksearch/rubriques",{paramName:"type", minChars:'3'}); new Ajax.Autocompleter("localite_rubrique","quickSuggestions","/ajax/quicksearch/localites",{paramName:"type"}); new Ajax.Autocompleter("cp_rubrique","quickSuggestions","/ajax/quicksearch/postaux",{paramName:"type"}); new Ajax.Autocompleter("arrondissement_rubrique","quickSuggestions","/ajax/quicksearch/arrondissements",{paramName:"type"}); } if($('fichederoul_salle')){ new Ajax.Autocompleter("localite_salle","quickSuggestions","/ajax/quicksearch/localites",{paramName:"type"}); new Ajax.Autocompleter("cp_salle","quickSuggestions","/ajax/quicksearch/postaux",{paramName:"type"}); new Ajax.Autocompleter("arrondissement_salle","quickSuggestions","/ajax/quicksearch/arrondissements",{paramName:"type"}); } if($('moment_all')){ if ($('moment_all') ) Event.observe($('moment_all') ,'click',unselect_all_days); if ($('moment_matin')) Event.observe($('moment_matin') ,'click',select_all_days); if ($('moment_midi') ) Event.observe($('moment_midi') ,'click',select_all_days); if ($('moment_amidi')) Event.observe($('moment_amidi') ,'click',select_all_days); if ($('moment_soir') ) Event.observe($('moment_soir') ,'click',select_all_days); if ($('moment_nuit') ) Event.observe($('moment_nuit') ,'click',select_all_days); } } function send_bookmark(){ click_me('send_bookmark'); } function select_all_days(){ adays = $$('.day'); bCanpass = true; for (var i = 0; adays.length > i; i++) { if(adays[i].checked == true){ bCanpass = false; } } if (bCanpass) { for( var i = 0; adays.length > i; i++ ) { adays[i].checked = true; } } } function unselect_all_days(){ adays = $$('.day'); bCanpass = true; for (var i = 0; adays.length > i; i++) { if(adays[i].checked == false){ bCanpass = false; } } if (bCanpass) { for (var i = 0; adays.length > i; i++) { adays[i].checked = false; } } } function changeQsType(sType){ var currentValue=""; // currentValue = (""==$('quickSearch1').value)?currentValue:$('quickSearch1').value; // currentValue = (""==$('quickSearch2').value)?currentValue:$('quickSearch2').value; // currentValue = (""==$('quickSearch3').value)?currentValue:$('quickSearch3').value; if("Rubriques"==sType){ $('quickSearch1').style.display='block'; // $('quickSearch1').value=currentValue; $('quickSearch2').style.display='none'; $('quickSearch3').style.display='none'; $('qsRubriques').checked=true; $('quickSearch2').value=''; $('quickSearch3').value=''; } if("Noms"==sType){ $('quickSearch1').style.display='none'; $('quickSearch2').style.display='block'; // $('quickSearch2').value=currentValue; $('quickSearch3').style.display='none'; $('qsNoms').checked=true; $('quickSearch1').value=''; $('quickSearch3').value=''; } if("Localites"==sType){ $('quickSearch1').style.display='none'; $('quickSearch2').style.display='none'; $('quickSearch3').style.display='block'; $('qsLocalites').checked=true; $('quickSearch1').value=''; $('quickSearch2').value=''; // $('quickSearch3').value=currentValue; } } function favoris(sName,sUrl) { if ( navigator.appName != 'Microsoft Internet Explorer' ) { window.sidebar.addPanel(sName,sUrl,""); } else { window.external.AddFavorite(sUrl,sName); } } gEtab_ajax_id = 0; function ajax_render_form_etab(elem,etab_id){ gEtab_ajax_id = etab_id myAjx = new Ajax.Updater(elem,'/mypetitfute/edit_etablissement/'+etab_id,{method:'post', onComplete:function(){ //alert(elem.responseText); /* myA = document.createElement("A"); Element.addClassName(myA,'lightwindow'); myA.href = '#modal_edit_etab_'+gEtab_ajax_id; myA.setAttribute('id','activate_'+gEtab_ajax_id); myA.title='Etablissement options'; myA.setAttribute('params',"lightwindow_width=940,lightwindow_height=700, lightwindow_type='inline'"); document.body.appendChild(myA); myLightWindow = new lightwindow(); click_me(myA.id);*/ //myLightWindow.activateWindow({lightwindow_type:'inline', href: '#modal_edit_etab_'+gEtab_ajax_id, title:'Etablissement options'}); }}); }