function del( Obj ) { var label = ( Obj.title ) ? Obj.title : 'Etes vous sûr de vouloir supprimer cet élément ?'; return confirm( label ); } function popup( href, name, h, l ) { var hauteur = Math.round( ( screen.availHeight - h ) / 2 ); var largeur = Math.round( ( screen.availWidth - l ) / 2 ); var popup = window.open( href, name, 'toolbar=0,location=0,directories=0,status=0, scrollbars=1,resizable=1,menubar=0,top='+hauteur+',left='+largeur+',width='+l+',height='+h); popup.focus(); return false; } function selectCountryRegion (idState, labelState ) { var uri = document.location.href.split('/'); var urlGet = ''; switch(uri[(uri.length-1)]){ case 'Investisseurs-associes': urlGet='getIAinfo.php' break; case 'Professionnels-associes': urlGet='getPAinfo.php' break; case 'Reseaux-de-BA-Locaux': default : urlGet='getBAinfo.php' break; } var jsonRequest = new Request({ url:urlGet, method: 'get', onComplete: function(content){ $('cibleFlash').innerHTML=content; } }).get({idstat:idState}); } function showDetailsBA(id){ new insidePopup({ width:460, url:'getBAdetails.php', closer:{text:'X'}, gets:{'idcomp':id}, duration:5 }); } function showDetailsIA(id){ new insidePopup({ width:460, url:'getIAdetails.php', closer:{text:'X'}, gets:{'idcomp':id}, duration:5 }); } function showDetailsPA(id){ new insidePopup({ width:460, url:'getPAdetails.php', closer:{text:'X'}, gets:{'idcomp':id}, duration:5 }); } //Mise à jour "dynamique" du montant d'un cours function fUpdateGeneralLessonPriceInit() { if( $('generallessons-list') ) { $$($('generallessons-list').getElements('select.weekselection')).addEvents({ 'change' : function(ev) { var nbWeeks = this.value; var generallessonId = this.id.replace(/^weeksselection-/,""); //alert(this.value); if ( nbWeeks && nbWeeks > 0) { new Request.HTML({ url : 'js/updategenerallessonprice.js.php', data: { generallessonid : generallessonId, nbweeks: nbWeeks}, update: $('generallessonprice-'+generallessonId), onComplete: function() { if( $('reservation-generallesson-'+generallessonId) ) { $('reservation-generallesson-'+generallessonId).checked=true; } // sk 2011-09-28 : affiche du prix à la session if( $('reservation-generallesson-pricecolumn')) { if(nbWeeks>=4){ $('reservation-generallesson-pricecolumn').innerHTML='Prix à la session'; } else{ $('reservation-generallesson-pricecolumn').innerHTML='Prix à la semaine'; } } } }).post(); } } }); } } function initMenu(){ if ($('menuhori')) new mooMenu($('menuhori')); } var arrayVer = []; function initMenuVertAndHor(){ initMenu(); if ($('menuvert')){ new rAccordion('menuvert', 'togglevert', 'elementvert', { alwaysHide: true, onActive: function(toggle){ toggle.addClass('active'); }, elToOpen: todis, display: menudisplay, onBackground: function(toggle){ toggle.removeClass('active'); } }); } } function initKeywordsHidden(){ new keywordsHidden('q','login','password'); } function sliderInit(){ if(slideBox = $('slidebox')){ new mooSlider(slideBox, slideBox.getElements('span'), {'waitDuration': 3000, 'direction': 'horizontal'}); } } function limChar(id,nMax){ var ttext = $(id).value; var cLeft = nMax-ttext.length; if (cLeft<0) cLeft = 0; if ($('nchar')) $('nchar').innerHTML = cLeft+'/'+nMax+' restants'; $(id).value=ttext.substr(0,250); } function initLimitValue(){ new limitValues ($$('.limited')); } function initCibleFlash(){ if ($('cibleFlash')) selectCountryRegion ('68', 'Ile de France' ); } function initSlideShow() { var data = [ '1.jpg', '5.jpg', '4.jpg', '6.jpg', '7.jpg', '8.jpg' ]; var myShow = new Slideshow('my_slideshow', data, { loop:true, duration:1000, hu: 'images/bandeau' }); } function initImages() { document.imageOut = new Object(); document.imageOver = new Object(); var imageArray = $$("img", "input"); imageArray.each(function(item){ var image = item.src.substr(item.src.lastIndexOf("/")+1); var id = item.id || image.replace("_n.", "").replace("_N.", ""); var hover = (image.toLowerCase().lastIndexOf("_n.") !=-1); // if (hover && document.imageOut && document.imageOver) { document.imageOut[id] = new Image(); document.imageOut[id].src = item.src; document.imageOver[id] = new Image(); document.imageOver[id].src = item.src.substr(0, item.src.lastIndexOf("/")+1)+image.replace("_n.", "_o.").replace("_N.", "_O."); } if (hover && document.imageOut && document.imageOver) { item.onmouseover = function(){ //alert("mouseover"); if (document.imageOver && document.imageOver[this.id]) setImage(this, document.imageOver[this.id].src); } item.onmouseout = function(){ if (document.imageOut && document.imageOut[this.id]) setImage(this, document.imageOut[this.id].src); } item.id = id; // function setImage(imageObject, src) { if (window.ie && !window.ie7) { if (imageObject.filters[f] && imageObject.filters[f].src.test(pngRegExp)) { imageObject.filters[f].src = src; } else { imageObject.src = src; } } else { imageObject.src = src; } } } }); } function fInit(){ initMenuVertAndHor(); initKeywordsHidden(); sliderInit(); initLimitValue(); // glossary(); initCibleFlash(); initSlideShow(); initImages(); fUpdateGeneralLessonPriceInit(); } window.addEvent('domready', fInit); /* function popupOrder( Obj ) { return popup( Obj.href, 'order', 600, 580 ); } */