var popupBlockerChecker = { check: function(popup_window){ var _scope = this; if (popup_window) { if(/chrome/.test(navigator.userAgent.toLowerCase())){ setTimeout(function () { _scope._is_popup_blocked(_scope, popup_window); },200); }else{ popup_window.onload = function () { _scope._is_popup_blocked(_scope, popup_window); }; } }else{ _scope._displayError(); } }, _is_popup_blocked: function(scope, popup_window){ if ((popup_window.innerHeight > 0)==false){ scope._displayError(); } }, _displayError: function(){ alert("Popup Blocker is enabled! Please add this site to your exception list."); } }; function printContenu(contenu) { var opts = 'scrollbars=yes,resizable=yes,menubar=no,status=yes'; var w = 950; var h = 500; var pw = window.open('print.php?contenu='+contenu,'pwin','width='+w+',height='+h+',top=5,left=5,'+opts); } function fiche(type,id,w,h) { var opts = 'scrollbars=yes,resizable=yes,menubar=no,status=yes'; var w = typeof w != 'undefined' ? w : 500; var h = typeof h != 'undefined' ? h : 500; var pw = window.open('fiche.php?type='+type+'&id='+id,'pwin','width='+w+',height='+h+',top=5,left=5,'+opts); } function popup(url) { var opts = 'scrollbars=yes,resizable=yes,menubar=no,status=yes'; var w = typeof w != 'undefined' ? w : 1050; var h = typeof h != 'undefined' ? h : 600; var pw = window.open(url,'','width='+w+',height='+h+',top=5,left=5,'+opts); if(null == pw){ return false; } return true; } function chartage(contenu) { a = 1; $(contenu).each(function(){ a++; i=2; $(this).find("li").each(function(){ //if($(this).is(":visible")){ if(i%2==0) { $(this).addClass(""); } else { $(this).addClass("odd"); } $(this).append('
'); i++; //} }); }); } function aff_alert(chaine,url) { if(url==1) { apprise(chaine, {'verify':false}, function(r) { if(r) { window.location.href=''; } else { } }); } else { apprise(chaine); } } function is_int(val) { reg = new RegExp("[^(0-9)]", "g"); if (val.value != "") { if (reg.test(val.value)){ document.getElementById(val.id).value = val.value.replace(reg, ''); } } } function clean(string) { return string.replace(/[^0-9]/g, ""); } function verif_virgule(value){ var pos = value.indexOf("."); var result; if (pos !== -1) { var part1 = clean(value.substr(0, pos)); var part2 = clean(value.substr(pos + 1)); part2 = part2.length > 4 ? part2.substring(0,part2.length-1) : part2; result = part1 + "." + clean(part2); } else { result = clean(value); } return result; } function editer_global(page,type,sstype,id) { $.ajax({ cache: false, type: "POST", url: "pages/include/editer.php", data: "type="+type+"&sstype="+sstype+"&page="+page+"&id="+id, success: function(resultat){ window.open(resultat); } }); } function sauvegarder_global(table,champ1,val1,champ2,val2) { $.ajax({ cache: false, type: "POST", url: "pages/include/sauvegarder.php", data: "table="+table+"&champ1="+champ1+"&val1="+val1+"&champ2="+champ2+"&val2="+val2, success: function(resultat){ //window.open(resultat); } }); } function change_etat(table,prefixe,label_id,champ,id) { $.ajax({ cache: false, type: "POST", url: "pages/include/change_etat.php", data: "table="+table+"&prefixe="+prefixe+"&label_id="+label_id+"&champ="+champ+"&id="+id, success: function(resultat){ } }); } function scrollBarTop(div_table){ var nom_div_table = div_table.replace("#",""); nom_div_table = nom_div_table.replace(".",""); var nom_div_scroll = "scrollbartop_"+nom_div_table; $(div_table).before("
").addClass("table-responsive"); $("#"+nom_div_scroll+" > div").width($(div_table+" > table:first-child").width()); $("#"+nom_div_scroll).scroll(function(){ $(div_table).scrollLeft($("#"+nom_div_scroll).scrollLeft()); }); $(div_table).scroll(function(){ $("#"+nom_div_scroll).scrollLeft($(div_table).scrollLeft()); }); } function goToTop(el){ if($("#FL_NumeroAnonymat").length>0){ $("#FL_NumeroAnonymat").val('').focus(); } el = el || ""; $('html, body').animate({ scrollTop:$((el!="" ? el : "body")).offset().top }, 'slow'); }