$(document).ready(function(){ //Autocomplete sur le champs NAF $("#formR-naf").autocomplete("./pages/nafajax.php", { minChars:3, width: 400, highlight: false, scroll: true, formatResult: function(data, value) { return value.split(" , ")[0]; } }); //Chargement du menu Accordion $(function() { $("#Menu").accordion({autoHeight: false, collapsible: true, active: 0}); }); //Auto Scroll $(window).scroll(function() { var offset = $(document).scrollTop(); $("#floatMenu").css('margin-top',offset); }); //Boite de dialog surveillance $('.dialogsurv').live('click', function(){ var title = $(this).attr('title'); var href = $(this).attr('href')+'&dialog=1'; var dialogOpts = { bgiframe: true, title: title, width: 500, height: 300, modal: true, open: function(event, ui) { $(this).html('Chargement...'); $(this).load(href); }, buttons: { 'Ok': function() { var href = $(location).attr('href'); var data = $("#frmSurv").serialize(); $("#frmSurv").replaceWith('
Mise sous surveillance en cours...
'); $.post('./pages/ajax_surveillance.php', data, function(data, textStatus) { $('#frmSurv').html(data); if(textStatus == 'success'){ $(location).attr('href', href); } }); }, Annuler: function() { $(this).dialog('close'); } }, close: function() { $('#dialogsurv').remove(); } }; $('
').dialog(dialogOpts); return false; }); });