[thelist] Lotus Domino & Javascript funnies

sharon.j.stevens at mainroads.qld.gov.au sharon.j.stevens at mainroads.qld.gov.au
Wed Oct 29 23:43:20 CST 2003





Oh fonts of all knowledge!!!!!!!!!!!!!!!

I'm working on an intranet site for a govt dept (soon to go live to the
internet) and i'm having trouble with a treemenu script running within some
of the pages.

This is what is happening when you click on one of the + signs to expand
the submenu the + sign disappears.

Platform: Lotus-Domino (Release 4.6.5 (Intl) - 16 June 1999 on Windows
NT/Intel)

The page is calling two linked js files.

this is the code from the js file controlling the menu

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

var tOldObj

function menuExpander(tObj) {
      if(document.all && !document.getElementById){
            return;
      } else {
            if (tOldObj){
                  var tDiv=MM_findObj(tOldObj+'Content');
                  var tImg=MM_findObj(tOldObj+'Img');
                  var tLink=MM_findObj(tOldObj+'Link');
                  if (tDiv!=null){
                              tDiv.className = 'hidden';
                              tImg.src = 'collapsed.gif'
                              tLink.className = ''
                  }
            if (tOldObj == tObj){
                  tOldObj = null
                  return;
            }
            }
            var tDiv=MM_findObj(tObj+'Content');
            var tImg=MM_findObj(tObj+'Img')
            var tLink=MM_findObj(tObj+'Link');

            if (tDiv!=null){
                        tDiv.className = 'visible';
                        tImg.src = 'expanded.gif'
                        tLink.className = ''
            }
            tOldObj = tObj
      }
}

function makeExpandable(){
      if(document.all && !document.getElementById){
            return;
      } else {
            var strURL = document.location.href;
            var arrPath = strURL.split('/');
            var strDIR = arrPath[0]+'//'+arrPath[2];
            var tImgs=makeExpandable.arguments
            for(i=0;i<tImgs.length;i++){
                  var imageName = tImgs[i]
                  if (document.images[imageName].src == strDIR + 'unexpandable.gif'){
                        document.images[imageName].src = strDIR + 'collapsed.gif'
                  }
            }
      }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

cheers
Schaz



************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads,
Queensland Transport or National Transport Secretariat, or
endorsed organisations utilising the same infrastructure.
If you have received this electronic mail message in error,
please immediately notify the sender and delete the message
from your computer.
************************************************************



More information about the thelist mailing list