JAVASCRIPT   43

onload.js

Guest on 23rd August 2021 05:00:20 PM

  1. // Defaults, to be overridden.
  2. var clf_web_names=null;
  3. var clf_web_addrs=null;
  4. var i=0;
  5. var letter=null;
  6.  
  7. imp_count = 0;
  8.  
  9. images = Array(1);
  10. link_info = Array( 'No News' );
  11. link_href = Array( './' );
  12.  
  13. //  This is the BEST THING I've found from Dreamweaver.
  14. function MM_findObj(n, d) { //v4.01
  15.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  16.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  17.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  18.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  19.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  20. }
  21.  
  22. function MM_setTextOfLayer(objName,x,newText) { //v4.01
  23.   if ((obj=MM_findObj(objName))!=null) with (obj)
  24.     if (document.layers) {document.write(unescape(newText)); document.close();}
  25.     else innerHTML = unescape(newText);
  26. }
  27.  
  28. // This is something again from ALA.  A "Suckerfish dropdown" hack.
  29. audience = new Object();
  30. audience.name = "audience";
  31. audience.transparent = true;
  32.  
  33. pullDowns = new Object();
  34. pullDowns.name = "pullDowns";
  35. pullDowns.transparent = false;
  36.  
  37. flyouts = Array( audience,pullDowns );
  38.  
  39. // This startlist was initially the IErepair function, less the param.  I've abstracted it to work with multiple menus on a page.  I know...  WHY???  Because that's what the client WANTS.  UGH.  These things should never be used.
  40.  
  41. function setSubULs( obj, root ) {
  42.         if (obj==null || obj.childNodes==null) return;  // IE needs these
  43.         if (!root && obj.nodeName=='UL') {
  44.                 if (ns){
  45.                         if (browserVersion>=5) {
  46.                                 target = obj.style;
  47.                         }
  48.                 }
  49.                 else {
  50.                         target = obj.style;
  51.                         }
  52. //              MyImage = new OpacityObject(target,'images/back');  // opacity for the flyouts.
  53. //              MyImage.setBackground();
  54.         }
  55.         for (var i=0;i<obj.childNodes.length; i++) {
  56.                 setSubULs( obj.childNodes[i], false );
  57.         }
  58. }
  59.  
  60.  
  61. function LoadBanner() {
  62.         // Dynamic Banner logic:
  63.         var bg_choice = pickRandom( banner.length );
  64.         bannerObj = MM_findObj( 'header' );
  65.         bannerObj.className = 'banner_'+bg_choice;
  66. }
  67.  
  68. startFunctions = Array();  // Not needed: LoadBanner,
  69.  
  70. startList = function() {
  71.         for ( id in flyouts ) {
  72.                 props = flyouts[id];
  73.                 layerObject = MM_findObj( props.name );
  74.                 IErepair( layerObject );
  75. //              if (props.transparent) setSubULs( layerObject, true );
  76.         }/**/
  77.        
  78.         for ( i in startFunctions ) startFunctions[i]();
  79. }
  80.  
  81.  
  82. window.onload=startList;

Raw Paste


Login or Register to edit or fork this paste. It's free.