var clearAllButton=$("#clear-all"),importCallLog=$('input#call_log-import[type="file"]'),subjectManager,contactManager,miniManager,ficheManager; function dynamicUpdate(a){console.log(a);var b="SPAN"==a.tagName&&"switch"==a.className,c="INPUT"==a.tagName&&"submit"==a.type,d="SPAN"==a.tagName&&("nav-mini"==a.parentNode.id||"nav-fiche"==a.parentNode.id);if(!b&&!c&&~d)return!1;b?(console.log("> switch firstname <-> lastname"),b=a.parentNode,a=b.children[2],b=b.children[4],c=a.value,a.value=b.value,b.value=c):(console.log("> dynamic update"),miniManager.fieldsToStorage(),ficheManager.fieldsToStorage(),contactManager.fieldsToStorage(),miniManager.sync(), ficheManager.sync(),miniManager.storageToFields(),ficheManager.storageToFields(),contactManager.storageToFields())}function checkRadioValue(a){for(var b=0,c=0;cb;b++)lsi.set("contacts","form"+b,{uid:b,number:a.directory[b].number,username:a.directory[b].name,firstname:"",lastname:""});dynamicUpdate()}}))})},!1);clearAllButton.addEventListener("click",function(a){localStorage.clear();reload()},!1)})})})});