function getCoord(a,b){return/touch/.test(a.type)?(a.originalEvent||a).changedTouches[0]["page"+b]:a["page"+b]}function setTap(){tap=!0,setTimeout(function(){tap=!1},500)}function getUrlVars(a){for(var b=window.location.search.substring(1),c=b.split("&"),d=0;d<c.length;d++){var e=c[d].split("=");if(e[0]==a)return e[1]}return!1}function checkUrl(a){var b=window.location.pathname,c=dol_url_root+"/"+a;return b==c?!0:!1}function getUrlPath(){var a=window.location.pathname,b=a.replace(dol_url_root+"/","");return b}function splitTable(a,b,c,d,e){a.wrap("<div class='table-wrapper' />");var f=a.clone();f.removeClass("responsive"),a.closest(".table-wrapper").append(f),f.wrap("<div class='pinned' />"),a.wrap("<div class='scrollable' />");var g=a.parent();g.css("margin-left",b);var h=f.parent();h.css("width",b),c&&(a.prepend(thead(e)),f.prepend(thead(d))),setCellHeights(a,f)}function setCellHeights(a,b){var c=a.find("tr"),d=b.find("tr"),e=[],f=[];c.each(function(a){f[a]=$(this).outerHeight(!0)}),d.each(function(a){e[a]=$(this).outerHeight(!0),e[a]<f[a]&&($(this).height(f[a]),e[a]=f[a])}),c.each(function(a){f[a]<e[a]&&$(this).height(e[a])})}function thead(a){for(var b=0,c="<thead><tr>";a>b;)b++,c+='<th class="col'+b+'"></th>';return c+="</tr></thead>"}function unsplitTable(a){a.find("thead").remove(),a.closest(".table-wrapper").find(".pinned").remove(),a.unwrap(),a.unwrap()}function wrapHScroll(a){a.wrap("<div class='hScroll-wrapper' />")}function toggle_menu(){jQuery("#id-left").toggleClass("opened"),jQuery(".slidemenu-btn a div").toggleClass("icon-plus-menu").toggleClass("icon-plus-close")}function open_menu(){jQuery("#id-left").addClass("opened"),jQuery(".slidemenu-btn a div").removeClass("icon-plus-menu").addClass("icon-plus-close")}function close_menu(){jQuery("#id-left").removeClass("opened"),jQuery(".slidemenu-btn a div").addClass("icon-plus-menu").removeClass("icon-plus-close")}function isTouchDevice(){}function get_root_url(a){var b=window.location.pathname,c=b.indexOf(a),d=b.substr(0,c+1);return d}function createjsfile(a){var b=document.createElement("script");return b.setAttribute("type","text/javascript"),b.setAttribute("src",a),b}function createcssfile(a){var b=document.createElement("link");return b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.setAttribute("href",a),b}function replacecssfile(a,b,c){for(var d,e=document.getElementsByTagName("link"),f=e.length-1;f>=0;f--){var g=e[f].getAttribute("href");if(e[f]&&null!==g&&-1!=g.indexOf(a)){d="undefined"!=typeof c?get_root_url(c)+b:dol_url_root+"/"+b;var h=createcssfile(d);e[f].parentNode.replaceChild(h,e[f])}}}function sizes_calc(){var a=$(window).width(),b=$(window).height(),c=$(".login_block").outerWidth(),d=$(".slidemenu-btn").outerWidth(),e=a-d-c;$("ul.tmenu").width(e),$(".slidemenu-btn").css("height","initial");var f=$("#tmenu_tooltip").outerHeight();$("#id-container").css("padding-top",f),$(".slidemenu-btn").css("height",f),$("#id-left").css("height",b-f),$("#id-container").css("visibility","visible")}!function(a){a.fn.replaceByDiv=function(b,c){this.each(function(){var d=this.className;d+=" "+b,c&&(d+=" "+c);var e=a(this).attr("title"),f=a(this).attr("id"),g=(a(this).parent(),a("<div/>",{"class":d,id:f,title:e}));a(this).wrap(g),a(this).remove()})},a.fn.theadIns=function(b){this.each(function(){a(this).prepend(thead(b))})}}(jQuery),jQuery.fn.mouseIsOver=function(){return $(this).parent().find($(this).selector+":hover").length>0?!0:!1};var meta=document.createElement("meta");meta.name="viewport",meta.content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1",document.head.appendChild(meta),jQuery(document).ready(function(){"use strict";var a=function(a,b){var c=function(){this.afterElement=window.getComputedStyle?window.getComputedStyle(document.body,":after"):!1,this.currentBreakpoint="",this.lastBreakpoint="",this.init()};return c.prototype={init:function(){var a=this;a.afterElement&&a._resizeListener()},_resizeListener:function(){var a=this;b(window).on("resize orientationchange load",function(){a.currentBreakpoint=a.afterElement.getPropertyValue("content"),a.currentBreakpoint!==a.lastBreakpoint&&(b(window).trigger("breakpoint-change",a.currentBreakpoint),a.lastBreakpoint=a.currentBreakpoint)})}},a.mediaqueryListener=a.mediaqueryListener||new c,a}(a||{},jQuery),b="1.4.3";if($(".js-ver").html(b),"undefined"!=typeof custom_css&&custom_css){var c=dol_url_root+"/becreative/css/as_style_custom.css";document.head.appendChild(createcssfile(c))}if("undefined"!=typeof custom_js&&custom_js){var d=dol_url_root+"/becreative/js/as_code_custom.js";document.head.appendChild(createjsfile(d))}$(window).on("breakpoint-change",function(a,b){j(b),l(b),("'small'"==b||'"small"'==b)&&($("table textarea, table input").removeAttr("cols").removeAttr("size"),$(".conteneur .liste_articles").insertBefore($(".conteneur .principal")))});$("table.responsive, .fiche table:first-of-type, a.slidemenu-btn div, a.vmenu div.mainvmenu, div.mainmenuhspan a");$(window).on("resize orientationchange load",function(){sizes_calc()});var e,f;if(window.location.pathname.indexOf("cashdesk")>-1&&(e="/cashdesk/css/style.css",f="becreative/css/as_style_cashdesk.min.css",replacecssfile(e,f,"/cashdesk/")),"undefined"!=typeof webmail_active&&webmail_active&&(e="/webmail/css/webmail.css",f="becreative/css/as_style_webmail.min.css",replacecssfile(e,f)),$("#mysql_options input, #filename_template").removeAttr("size").css("width","100%"),window.location.pathname.indexOf("cashdesk/index.php")>-1&&$(".conteneur").addClass("cashdesk-login"),!$("body").hasClass("bodylogin")){if("undefined"!=typeof dol_url_root){var g=getUrlPath();switch(g){case"admin/modules.php":$(".fiche").addClass("modules");break;case"admin/company.php":$(".fiche").addClass("company");break;case"admin/tools/dolibarr_export.php":$(".fiche").addClass("backup");break;case"admin/tools/dolibarr_import.php":$(".fiche").addClass("restore");break;case"admin/system/dolibarr.php":$(".fiche").addClass("infos-dolibarr")}g.indexOf("webmail/")>-1&&($(".fiche").addClass("webmail"),$(".fiche > table:first-of-type").attr("summary",""));var h=getUrlVars("mainmenu");switch(h){case"home":checkUrl("index.php")&&$(".fiche").addClass("home-area");break;case"companies":checkUrl("societe/index.php")&&$(".fiche").addClass("third-parties-area");break;case"products":checkUrl("product/index.php")&&$(".fiche").addClass("products-area");break;case"commercial":checkUrl("comm/index.php")&&$(".fiche").addClass("customer-area");break;case"accountancy":checkUrl("compta/index.php")&&$(".fiche").addClass("accountancy-area");break;case"bank":checkUrl("compta/bank/index.php")&&$(".fiche").addClass("bank-area");break;case"project":checkUrl("projet/index.php")&&$(".fiche").addClass("project-area");break;case"ecm":checkUrl("ecm/index.php")&&$(".fiche").addClass("ecm-area");break;case"agenda":$(".fiche").addClass("agenda")}var i=getUrlVars("leftmenu");switch(i){case"prospects":checkUrl("comm/prospect/list.php")&&$(".fiche").addClass("listofprospects");break;case"customers":checkUrl("comm/list.php")&&$(".fiche").addClass("listofcustomers");break;case"contacts":checkUrl("contact/list.php")&&$(".fiche").addClass("listofcontacts");break;case"thirparties":checkUrl("societe/index.php")&&$(".fiche").addClass("listofcontacts");break;case"propals":checkUrl("comm/propal/list.php")&&$(".fiche").addClass("listofproposals");break;case"orders":(checkUrl("commande/liste.php")||checkUrl("commande/list.php"))&&$(".fiche").addClass("listoforders")}}"print"==getUrlVars("optioncss")&&$("body").addClass("print"),$("#mainmenutd_home .icon-home").removeClass("icon-home").addClass("icon-plus-home"),$("#blockvmenusearch img[src*=object_company]").replaceByDiv("icon-companies"),$("#blockvmenusearch img[src*=object_contact]").replaceByDiv("icon-contacts"),$("#blockvmenusearch img[src*=object_product]").replaceByDiv("icon-products"),$("#blockvmenusearch img[src*=object_user]").replaceByDiv("icon-members"),$("img[src*=switch_off]").replaceByDiv("tog","off"),$("img[src*=switch_on]").replaceByDiv("tog","on"),$('img[src*="/title.png"]').replaceByDiv("icon-plus-folder"),$('.all_version img[src*="/title_home.png"]').replaceByDiv("icon-plus-home"),$('.all_version img[src*="/title_companies.png"]').replaceByDiv("icon-companies"),$('.all_version img[src*="/title_products.png"]').replaceByDiv("icon-products"),$('.all_version img[src*="/title_commercial.png"]').replaceByDiv("icon-commercial"),$('.all_version img[src*="/title_accountancy.png"]').replaceByDiv("icon-accountancy"),$('.all_version img[src*="/title_bank.png"]').replaceByDiv("icon-bank"),$('.all_version img[src*="/title_project.png"]').replaceByDiv("icon-project"),$('.all_version img[src*="/title_generic.png"]').replaceByDiv("icon-ecm"),$('.all_version img[src*="/title_hrm.png"]').replaceByDiv("icon-hrm"),$('.all_version img[src*="/title_setup.png"]').replaceByDiv("icon-plus-setup"),$('img[src*="/logout.png"]').replaceByDiv("icon-plus-logout"),$('img[src*="/printer.png"]').replaceByDiv("icon-plus-printer"),$(".fiche").hasClass("agenda")||$('img[src*="/object_calendarday.png"]').replaceByDiv("icon-plus-calendar"),$('img[src*="/info.png"]').replaceByDiv("icon-plus-info"),$('img[src*="/warning.png"]').replaceByDiv("icon-plus-warning"),$('input[name*="button_search"]').attr("src",dol_url_root+"/becreative/img/blank.png"),$('<span class="icon-plus-filter"></span>').insertBefore('input[name*="button_search"]'),$('input[name*="button_removefilter"]').attr("src",dol_url_root+"/becreative/img/blank.png"),$('<span class="icon-plus-filter-cancel"></span>').insertBefore('input[name*="button_removefilter"]'),$('img[src*="grip_title.png"]').replaceByDiv("icon-plus-move"),$('img[src*="close_title.png"]').replaceByDiv("icon-plus-close"),$("select").each(function(a,b){}),$('.tabBar > table[summary="list_of_modules"]').addClass("responsive"),$("#form_unpaid > table:first-of-type").addClass("responsive"),$("form[name=search_form] > table.liste").addClass("responsive"),$('form[action*="virement"] > table').addClass("responsive"),$("div.menuchequedeposits > form > table").addClass("responsive"),$("#searchFormList > table").addClass("responsive"),$('form[action*="contact/list"] > table').addClass("responsive"),$('form[action*="compta/paiement/liste"] > table').addClass("responsive"),$(".infos-dolibarr table:not([summary])").addClass("responsive"),$("div.listofproposals > form > table").addClass("responsive"),$("div.listoforders > form > table").addClass("responsive"),$('form[action*="product/list"] > table').addClass("responsive"),$('form[action*="societe/soc"] > table').addClass("responsive"),$('div.third-parties-area form[action*="societe/soc"] > table').removeClass("responsive"),$('form[action*="comm/fiche"] > table').addClass("responsive"),$('form[action*="ndfp/ndfp"] > table').addClass("responsive"),$('form[action*="mylist/mylist"] > table').addClass("responsive"),$("#tablelines").addClass("responsive"),$("table.cal_month").addClass("hScroll"),$("#frmFacturation").addClass("hScroll"),$("#frmQte").addClass("hScroll"),$(".as-settings-font-sizes").addClass("hScroll")}var j=function(a){if("undefined"!=typeof fixed_menu&&!fixed_menu||'"small"'==a||"'small'"==a){var b,c,d,e=$(".slidemenu-btn");e.on("touchstart",function(a){b=getCoord(a,"X"),c=getCoord(a,"Y")}).on("touchend",function(a){Math.abs(getCoord(a,"X")-b)<20&&Math.abs(getCoord(a,"Y")-c)<20&&(a.preventDefault(),toggle_menu.call(this,a)),setTap()}).on("click",function(a){d||toggle_menu.call(this,a),a.preventDefault()}),e.on("mouseenter",function(){$("#id-left").hasClass("opened")||open_menu()}),$(".home").mouseenter(function(){$("#id-left").hasClass("opened")&&close_menu()}),$("#id-left").mouseleave(function(){$(".slidemenu-btn").mouseIsOver()||close_menu()})}},k=!1,l=function(a){return k||"'small'"!=a?k&&"'small'"!=a?(k=!1,$("table.responsive").each(function(a,b){unsplitTable($(b))}),!0):void 0:(k=!0,$(".tabBar > table.responsive").each(function(a,b){splitTable($(b),"8em",!0,2,4)}),$("#form_unpaid > table.responsive").each(function(a,b){splitTable($(b),"30%")}),$("form[name=search_form] > table.responsive").each(function(a,b){splitTable($(b),"20%")}),$('form[action*="virement"] > table.responsive').each(function(a,b){splitTable($(b),"20%")}),$("div.menuchequedeposits table.responsive").each(function(a,b){splitTable($(b),"20%")}),$("#searchFormList > table.responsive").each(function(a,b){splitTable($(b),"20%"),$(".pinned td.liste_titre input").width($(".pinned").width()-10)}),$('form[action*="contact/list"] table.responsive').each(function(a,b){splitTable($(b),"20%")}),$('form[action*="compta/paiement/liste"] table.responsive').each(function(a,b){splitTable($(b),"25%")}),$(".infos-dolibarr table.responsive").each(function(a,b){splitTable($(b),"30%")}),$(".company table.responsive").each(function(a,b){}),$("form[name=formsoc] table.responsive").each(function(a,b){}),$("div.listofproposals table.responsive").each(function(a,b){splitTable($(b),"20%")}),$("div.listoforders table.responsive").each(function(a,b){splitTable($(b),"20%")}),$('form[action*="product/list"] table.responsive').each(function(a,b){splitTable($(b),"20%")}),$('form[action*="societe/soc"] table.responsive').each(function(a,b){splitTable($(b),"30%")}),$('form[action*="comm/fiche"] table.responsive').each(function(a,b){splitTable($(b),"30%")}),$('form[action*="mylist/mylist"] > table.responsive').each(function(a,b){splitTable($(b),"25%")}),$('.tabBar form[action*="mylist/mylist"]:first-of-type table.responsive').each(function(a,b){unsplitTable($(b))}),$("#tablelines").each(function(a,b){splitTable($(b),"30%")}),$('form[action*="ndfp/ndfp"] table.responsive').each(function(a,b){splitTable($(b),"30%")}),$("table.cal_month.hScroll").each(function(a,b){wrapHScroll($(b))}),$("#frmFacturation.hScroll").each(function(a,b){wrapHScroll($(b))}),$("#frmQte.hScroll").each(function(a,b){wrapHScroll($(b))}),$(".as-settings-font-sizes").each(function(a,b){wrapHScroll($(b))}),!0)}});