/* Author: Antoine, Ekko Communication (antoine@ekko-communication.com) */ $('ul.icons li').click(function() { if ( $('#recherche').val() != "" ) { $("#searchForm").submit(); } }); // Tabs $("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); $("#featured").hover( function() { $("#featured").tabs("rotate",0,true); }, function() { $("#featured").tabs("rotate",5000,true); } ); // DatePicker if ($(".datepicker").length) { $(function() { $( ".datepicker" ).datepicker({ showOn: "button", buttonImage: "website/view/theme/default/css/images/calendar.png", buttonImageOnly: true, showAnim: "blind", changeMonth: true, changeYear: true, minDate: "-30Y", maxDate: "+2Y", yearRange: '-30:+1' }); }); } $("#loading").ajaxStart(function(){ $(this).show(); }); $("#loading").ajaxStop(function(){ $(this).hide(); }); // Slideshow var tabContainers = $('div#block-quotidien div.centerblockbig-content > div'); tabContainers.hide().filter(':first').show(); $('div.centerblockbig ul.tab a').click(function () { tabContainers.hide(); tabContainers.filter(this.hash).show(); $('div.centerblockbig ul.tab a').removeClass('selected'); $(this).addClass('selected'); return false; }).filter(':first').click(); // Menu droplinemenu.buildmenu("menu-left"); jQuery("#breadCrumb").jBreadCrumb(); // Corner $("#corner").hover(function() { //On hover... $("#corner img , .msg_block").stop() .animate({ //Animate and expand the image and the msg_block (Width + height) width: '240px', height: '240px' }, 500); } , function() { $("#corner img").stop() //On hover out, go back to original size 50x52 .animate({ width: '81px', height: '80px' }, 220); $(".msg_block").stop() //On hover out, go back to original size 50x50 .animate({ width: '80px', height: '80px' }, 200); //Note this one retracts a bit faster (to prevent glitching in IE) }); // Back to Top $('.pagination.top').click(function() { $( 'html, body' ).animate( { scrollTop: 0 }, 500 ); return false; }); // Back $('.pagination.back').click(function() { window.history.back(); return false; }); // Passage champ suivant formulaire /* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: Cyanide_7 | */ var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input, e) { var len = input.maxLength; var e = 'event'; var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } if ($("#wall").length) { $('#wall').facebookWall({ id:'lesmissionslocalesdubearn', access_token:'116279368428311|h2aGZA8HZsG1PpeGM8b2PzzAUHs', limit : 2 }); } function goToByScroll(id){ $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow'); } $(document).ready(function() { $(".link-email").click(function() { var ml = $(this).attr("rel"); $("#missionlocale option[value="+ml+"]").attr("selected", true); goToByScroll("formulaire"); }); });