/*** Simple jQuery Slideshow Script Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :) ***/ function slideSwitch() { var $active = $(".slideshow IMG.active"); if ( $active.length == 0 ) $active = $(".slideshow IMG:last"); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $(".slideshow IMG:first"); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass("last-active"); $next.css({opacity: 0.0}) .addClass("active") .animate({opacity: 1.0}, 1000, function() { $active.removeClass("active last-active"); }); } $(function() { setInterval( "slideSwitch()", 5000 ); }); // deuxieme function slideSwitch2() { var $active = $(".slideshow_2 IMG.active"); if ( $active.length == 0 ) $active = $(".slideshow_2 IMG:last"); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $(".slideshow_2 IMG:first"); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass("last-active"); $next.css({opacity: 0.0}) .addClass("active") .animate({opacity: 1.0}, 1000, function() { $active.removeClass("active last-active"); }); } $(function() { setInterval( "slideSwitch2()", 3000 ); }); // troisieme function slideSwitch3() { var $active = $(".slideshow_3 IMG.active"); if ( $active.length == 0 ) $active = $(".slideshow_3 IMG:last"); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $(".slideshow_3 IMG:first"); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass("last-active"); $next.css({opacity: 0.0}) .addClass("active") .animate({opacity: 1.0}, 1000, function() { $active.removeClass("active last-active"); }); } $(function() { setInterval( "slideSwitch3()", 4000 ); }); // quatrieme function slideSwitch4() { var $active = $(".slideshow_4 IMG.active"); if ( $active.length == 0 ) $active = $(".slideshow_4 IMG:last"); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $(".slideshow_4 IMG:first"); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass("last-active"); $next.css({opacity: 0.0}) .addClass("active") .animate({opacity: 1.0}, 1000, function() { $active.removeClass("active last-active"); }); } $(function() { setInterval( "slideSwitch4()", 6000 ); }); function backgd() { if(document.getElementById('sur_bloc')) { document.getElementById('sur_bloc').style.backgroundColor='transparent'; } } function load() { if(document.getElementById('googlemap')) { if( GBrowserIsCompatible() ) { var map = new GMap2(document.getElementById('googlemap')); map.setCenter(new GLatLng(45.76, 4.198844), 9); map.addControl(new GLargeMapControl()); map.addControl(new GScaleControl()); var geoXml; geoXml = new GGeoXml('http://www.adel42.com/data/kml/za-kml-ZA.kml?date=20120207070706'); map.addOverlay(geoXml); geoXml2 = new GGeoXml('http://www.adel42.com/data/kml/za-kml-42.kml?date=20120207070706'); map.addOverlay(geoXml2); geoXml3 = new GGeoXml('http://www.adel42.com/data/kml/za-kml-42-contours.kml?date=20120207070706'); map.addOverlay(geoXml3); GEvent.addListener(map,'infowindowprepareopen', function(iwtabs) { iwtabs[0].contentElem.innerHTML = iwtabs[0].contentElem.innerHTML.replace('_blank', '_self'); }); } } } function setOpacity( id_bloc, valeur ) { var bloc = document.getElementById( id_bloc ); bloc.style['filter'] = 'alpha(opacity=' + valeur+')'; bloc.style['-moz-opacity'] = valeur/100; bloc.style['-khtml-opacity'] = valeur/100; bloc.style['opacity'] = valeur/100; } function change_opacite_bloc( id_bloc, courant, cible ) { setOpacity( id_bloc, courant ); if( courant != cible ) { prochain = courant + 10 * Math.abs( cible - courant ) / ( cible - courant ); window.setTimeout( 'change_opacite_bloc( "' + id_bloc + '", ' + prochain + ', ' + cible + ' )', 100); } if( courant == 0 ) document.getElementById( id_bloc ).style.display = 'none'; } function masque_bloc( id_zone, id_bloc ) { var bloc = document.getElementById( id_bloc ); change_opacite_bloc( id_bloc, 100, 0 ); } function montre_bloc( id_zone, id_bloc ) { // on cache tous les blocs var i = 1; while( document.getElementById( 'bloc_' + id_zone + '_' + i ) ) { if( i!= id_bloc && document.getElementById( 'bloc_' + id_zone + '_' + i ).style.display == 'block' ) masque_bloc( id_zone, 'bloc_' + id_zone + '_' + i ); i = i + 1; } var bloc = document.getElementById( 'bloc_' + id_zone + '_' + id_bloc ); change_opacite_bloc( 'bloc_' + id_zone + '_' + id_bloc, 0, 100 ); bloc.style.display = 'block'; id_bloc = parseInt( id_bloc ) + 1; eval( 'bloc_courant_' + id_zone + ' = id_bloc' ); } var bloc_process; function deroule_bloc( id_zone ) { eval( 'var bloc_courant = bloc_courant_' + id_zone ); eval( 'var bloc_deroule = bloc_deroule_' + id_zone ); if( !document.getElementById( 'bloc_' + id_zone + '_' + bloc_courant ) ) bloc_courant = 1; var bloc_suivant = parseInt( bloc_courant ) + 1; if( !document.getElementById( 'bloc_' + id_zone + '_' + bloc_suivant ) ) bloc_suivant = 1; // et on affiche le bloc courant montre_bloc( id_zone, bloc_courant ); if( !document.getElementById( 'bloc_' + id_zone + '_' + bloc_courant ) ) bloc_courant = 1; if( bloc_deroule && ( bloc_suivant != bloc_courant) ) { bloc_process = window.setTimeout( 'deroule_bloc( ' + id_zone + ')', 4000 ); } eval( 'bloc_process_' + id_zone + ' = bloc_process' ); } function bloc_pause( id_zone ) { eval( 'bloc_deroule_' + id_zone + ' = false' ); eval( 'window.clearTimeout( bloc_process_' + id_zone + ' ) ' ); // window.clearTimeout( bloc_process ); } function bloc_play( id_zone ) { eval( 'bloc_deroule_' + id_zone + ' = true' ); eval( 'deroule_bloc( ' + id_zone + ')' ); }