// Supprimme le contenu du champ de saisie de type texte function resetTextField(fieldText) { fieldText.value = ""; } // ouverture d'une popup function open_popup(lien, options) { var win = window.open(lien,'',options); win.focus(); if ( !win.opener ) win.opener = self; } // fonction vide : très utile pour les liens popup sans affecter // la page courante. // exple : href="javascript:ouvrir_une_popup(); f_void();" function f_void() { return; } var clientAvailableWidth = 480; var clientAvailableHeight = 340; if (document.all || document.layers) { clientAvailableWidth = screen.availWidth; clientAvailableHeight = screen.availHeight; } function getCenterLeftPos(popWidth) { return (clientAvailableWidth - popWidth) / 2; } function getCenterTopPos(popHeight) { return (clientAvailableHeight - popHeight) / 2; } //fermeture Popup. function close_popup() { if ( winPopup && !winPopup.closed ) winPopup.close(); } // stockage du handle de popup var winPopup; // ouverture d'une popup centrée avec possibilité d'ouverture unique function popup_center(lien, nom, popWidth, popHeight, options, unique) { options += ', width='+ popWidth + ', height=' + popHeight; options += ', screenX=' + getCenterLeftPos(popWidth) + ', left=' + getCenterLeftPos(popWidth); options += ', screenY=' + getCenterTopPos(popHeight) + ', top=' + getCenterTopPos(popHeight); if (nom==='BST') { window.open(lien, 'BST', options); } else { if ( winPopup && !winPopup.closed ) winPopup.close(); winPopup = window.open(lien, nom, options); winPopup.focus(); if ( !winPopup.opener ) winPopup.opener = self; } } // ouverture d'une popup centrée avec possibilité d'ouverture unique function popup_droite(lien, nom, popWidth, popHeight, options, unique) { var ajout = getCenterLeftPos(popWidth)+ 100 ; options += ', width='+ popWidth + ', height=' + popHeight; options += ', screenX=' + ajout + ', left=' + ajout; options += ', screenY=' + getCenterTopPos(popHeight) + ', top=' + getCenterTopPos(popHeight); if ( !unique || !arrPopup[nom] || arrPopup[nom].closed ) { hdl = window.open(lien, nom, options); arrPopup[nom] = hdl; if ( !hdl.opener ) hdl.opener = self; } else { arrPopup[nom].focus(); } } // ouverture d'une popup centrée avec possibilité d'ouverture unique function popup_bottom(lien, nom, popWidth, popHeight, options, unique) { options += ', width='+ popWidth + ', height=' + popHeight; options += ', screenX=' + getCenterLeftPos(popWidth) + ', left=' + getCenterLeftPos(popWidth); options += ', screenY=' + getCenterTopPos(popHeight) + ', top= 230'; if ( !unique || !arrPopup[nom] || arrPopup[nom].closed ) { hdl = window.open(lien, nom, options); arrPopup[nom] = hdl; if ( !hdl.opener ) hdl.opener = self; } else { arrPopup[nom].focus(); } }