Source of “pachyletV1.js”.
47 lines, 1.3 KBytes.   Last modified 6:27 pm, 1st September 2015 PDT.
1 // Emacs settings: -*- mode: Fundamental; tab-width: 4; -*- 2 3 //////////////////////////////////////////////////////////////////////////// 4 // // 5 // Pachylet: Andrew's Web Mail Interface // 6 // // 7 // Copyright (c) 2002-2006 // 8 // // 9 // See http://birrell.org/pachylet/help.php // 10 // // 11 // Javascript for popup dialogs and cookies // 12 // // 13 //////////////////////////////////////////////////////////////////////////// 14 15 function getElement(id) { 16 // Browser variant hacking to return a DOM element 17 if (document.getElementById) { 18 // Ecmascript DOM access 19 return document.getElementById(id); 20 } else if (document.all) { 21 // Old IE 22 return document.all[id]; 23 } else { 24 // Unsupported 25 return null; 26 } 27 } 28 29 var shownElement = null; 30 31 function toggle(id) { 32 // Show or hide the DOM element "id", hiding any previously shown 33 // element. Intended to be called from onclick. 34 if (shownElement) shownElement.style.visibility = 'hidden'; 35 var element = getElement(id); 36 if (!element || !element.style) { 37 shownElement = null; 38 return true; 39 } else if (element == shownElement) { 40 shownElement = null; 41 return false; 42 } else { 43 element.style.visibility = 'visible'; 44 shownElement = element; 45 return false; 46 } 47 }
End of listing