﻿function clickButton(e, buttonid) { var evt = e ? e : window.event; var bt = document.getElementById(buttonid); if (bt) { if (evt.keyCode == 13) { var ie = isIE(); if (ie) { bt.click(); setHourglass() } else { var evenement = document.createEvent("MouseEvents"); evenement.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); bt.dispatchEvent(evenement); return false } } } } function stopEnterKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var ie = isIE(); if (!ie) { if (evt.keyCode == 13) { return false } } } document.onkeypress = stopEnterKey; function isIE() { return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) } function setHourglass() { document.body.style.cursor = 'wait' } function openPopup(link, pTitle, pWidth, pHeight, pTop, pLeft) { eval("window.open('" + link + "','" + pTitle + "','height=" + pHeight + ",width=" + pWidth + ",scrollbars=no,resizable=no,status=no,left=" + pLeft + ",top=" + pTop + ",menubar=no,toolbar=no,location=no')") } function openPopupDuJour(laFile, pFolder, pImg, pTitle, pInfos, initDate, finalDate) { var currentTime = new Date(); var year = currentTime.getFullYear(); var month = currentTime.getMonth() + 1; if (month < 10) { month = "0" + month } var day = currentTime.getDate(); if (day < 10) { day = "0" + day } var hours = currentTime.getHours(); if (hours < 10) { hours = "0" + hours } var minutes = currentTime.getMinutes(); if (minutes < 10) { minutes = "0" + minutes } var actualDate = year + "" + month + "" + day + "" + hours + "" + minutes; if (initDate <= actualDate && finalDate > actualDate) { if (laFile == "no_file") { var html = '<html><head><title>' + pTitle + '</title></head><body onBlur="top.close()" leftmargin=0 marginwidth=0 topmargin=0 marginheigth=0><img src="' + pFolder + '' + pImg + '" border="0" name="' + pTitle + '"></body></html>'; var OpenWindow = window.open("", '_blank', pInfos); OpenWindow.document.open(); OpenWindow.document.write(html); OpenWindow.document.close() } else if (laFile == "file") { window.open(pImg, '_blank', pInfos) } } } function openManufacturer(pShow, nbTypeManufacturers) { for (x = 0; x <= nbTypeManufacturers; x++) { eval("document.getElementById(['" + x + "']).style.display = 'none'") } if (pShow != 'all') { document.getElementById([pShow]).style.display = "block" } else { for (x = 0; x <= nbTypeManufacturers; x++) { eval("document.getElementById(['" + x + "']).style.display = 'block'") } } } var imgWidth = 80; var imgMarginRight = 5; var affichePicture = 1;
