var tlf_classes = [null,'.tlf_cauteur','.tlf_ccode','.tlf_cconstruction','.tlf_ccrochet','.tlf_cdate','.tlf_cdefinition','.tlf_cdomaine','.tlf_cvedette','.tlf_cexemple','.tlf_cemploi','.tlf_cmot','.tlf_cplan','.tlf_cpublication','.tlf_csource','.tlf_csynonime','.tlf_csyntagme','.tlf_ctitre']; var tlf_colors = [['#FF9090',0,'tlf.color0'],['#C0FFC0',16,'tlf.color1'],['#D0D0FF',0,'tlf.color2'],['#FFFF00',6,'tlf.color3'],['#FFB060',7,'tlf.color4'],['#00FFFF',0,'tlf.color5']]; var tlf_fonts = ['arial','verdana','helvetica','times','times new roman']; function initPortail() { initOthers(); } function initOthers() { initCookies(); initDeferredTasks(); setFocus('query'); initScroll(); } function initScroll() { var elem; elem = document.getElementById('contentbox'); if (elem != null) elem.ondblclick = showNavigationMenu; } function initCookies() { var div; var value; value = getCookie('tlf.fontsize'); setFontSize('contentbox',value); value = getCookie('tlf.fontname'); setFontName('lexicontent',value); value = getCookie('tlf.highlight'); if (value == 'true' || value == null) { for (x in tlf_colors) { value = getCookie(tlf_colors[x][2]); if (value != null) tlf_colors[x][1] = parseInt(value); } setHighlight(true); } } function setFontName(name,value) { var div; div = document.getElementById(name); if (div != null) { value = (value == null) ? 0 : eval(value); div.style.fontFamily = tlf_fonts[value]; } } function setFontSize(name,value) { var div; div = document.getElementById(name); if (div != null) { value = (value == null) ? 1.0 : eval(value); div.style.fontSize = '' + value + 'em'; } } function setHighlight(display) { var color; for (x in tlf_colors) { if (tlf_colors[x][1] > 0) { color = (display == true) ? tlf_colors[x][0] : ''; changeCSS(tlf_classes[tlf_colors[x][1]],'backgroundColor',color); } } } function changeFontName(value) { setCookie('tlf.fontname',value); setFontName('lexicontent',value); } function changeHighlight(checked) { setCookie('tlf.highlight',checked); setHighlight(checked); } function changeFontSize(add) { var div; var value; value = getCookie('tlf.fontsize'); value = (value == null) ? 1.0 : eval(value); value += add; setCookie('tlf.fontsize',value); setFontSize('contentbox',value); } function changeColor(index,select) { var newclass = select.selectedIndex; var oldclass = tlf_colors[index][1]; for (x in tlf_colors) { if (x != index && newclass > 0 && tlf_colors[x][1] == newclass) { tlf_colors[x][1] = 0; setCookie(tlf_colors[x][2],0); document.optionBoxForm[tlf_colors[x][2]].selectedIndex = 0; } } if (oldclass > 0) changeCSS(tlf_classes[oldclass],'backgroundColor',''); if (newclass > 0) changeCSS(tlf_classes[newclass],'backgroundColor',tlf_colors[index][0]); setCookie(tlf_colors[index][2],newclass); tlf_colors[index][1] = newclass; } function displayOptionBox(parent) { var div,value,checked; value = getCookie('tlf.highlight'); checked = (value == 'true' || value == null) ? true : false; document.getElementById('tlf.highlight').checked = checked; value = getCookie('tlf.fontname'); value = (value == null) ? 0 : eval(value); div = document.getElementById('tlf.fontname').options.selectedIndex=value; for (x in tlf_colors) { value = tlf_colors[x][1]; if (value > 0) document.optionBoxForm[tlf_colors[x][2]].options[value].selected = true; } div = document.getElementById('optionBox'); if (div != null) { div.style.top = (getoffsetTop(parent)+18)+"px"; div.style.left = (getoffsetLeft(parent)-40)+"px"; div.style.display = "block"; } return false; } function hideOptionBox() { var div; div = document.getElementById('optionBox'); div.style.display = "none"; return false; } function changeCSS(theClass,element,value) { var nbsheets,sheet,rules; nbsheets = document.styleSheets.length; for (var S = 0; S < nbsheets; S++) { rules = document.styleSheets[S].rules; if (rules == null) rules = document.styleSheets[S].cssRules; if (rules != null) for (var R = 0; R < rules.length; R++) if (rules[R].selectorText == theClass) rules[R].style[element] = value; } } function getoffsetLeft(element) { if (!element) return 0; return element.offsetLeft + getoffsetLeft(element.offsetParent); } function getoffsetTop(element) { if (!element) return 0; return element.offsetTop + getoffsetTop(element.offsetParent); } function setCookie(name, value) { var curCookie = name + '=' + escape(value) + '; expires=Thu, 31 Dec 2099 23:59:59 GMT; path=/'; document.cookie = curCookie; } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf(prefix); if (begin == -1) return null; var end = document.cookie.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + '=' + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : '') + '; expires=Thu, 01-Jan-70 00:00:01 GMT'; } } function showAjaxTooltip(url) { if (url == tooltip_url) showOverlib(); else { tooltip_url = url; tooltip_content = ""; loadXMLRequest(url,tooltipCallback); } return true; } function hideAjaxTooltip() { return nd(); } function tooltipCallback() { if (req && req.readyState == 4) { if (req.status == 200) { tooltip_content = req.responseText; showOverlib(); } } } function showOverlib() { overlib_pagedefaults(CLOSETEXT,'Fermer'); overlib(tooltip_content,STICKY,CAPTION,'Informations',CENTER); } function getValue(name) { var node; node = document.getElementById(name); return ((node != null) ? node.value : null); } function setValue(name,value) { var node; node = document.getElementById(name); if (node != null) node.value = value; } function setFocus(name) { var node; node = document.getElementById(name); if (node != null) node.focus(); } function loadXMLRequest(url,callback) { try { req = null; req = new XMLHttpRequest(); } catch (e) { for (var i=0;i'); x.write(''); x.write(''); d = document.getElementById("contentbox"); if (d != null) { x.write('
'); x.write(d.innerHTML); x.write('
'); } x.write(''); x.close(); a.print(); //a.close(); }