javascript toolbar-menu problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JesusFreak

    javascript toolbar-menu problem

    From: us_traveller@ya hoo.com (JesusFreak)
    Newsgroups: microsoft.publi c.scripting.jsc ript
    Subject: toolbar script problem
    NNTP-Posting-Host: 192.92.126.136

    Recently, I downloaded the following beautiful script
    "http://javascript.inte rnet.com/navigation/toolbar-menu.html". It
    works like a charm. I made my webpage in frames, where the nav-frame
    shows the menubar, so whenever I click a link in the menubar, it opens
    in the frame below. But the problem is the toolbar does not refresch
    itself and the expandable menus don't work anymore. Now I can refresh
    the nav-frame, but I just used frames so the site shouldn't reload
    every time the script. If someone has an idea, I would be very
    grateful.


    // begin of file: nwrmenu_var.js
    var NoOffFirstLineM enus=6; // Number of first level items
    var LowBgColor='whi te'; // Background color when mouse is not over
    var LowSubBgColor=' white'; // Background color when mouse is not
    over on subs
    var HighBgColor='#D 71A01'; // Background color when mouse is over
    var HighSubBgColor= '#D71A01'; // Background color when mouse is
    over on subs
    var FontLowColor='b lack'; // Font color when mouse is not over
    var FontSubLowColor ='black'; // Font color subs when mouse is not
    over
    var FontHighColor=' #FFFFC6'; // Font color when mouse is over
    var FontSubHighColo r='#FFFFC6'; // Font color subs when mouse is
    over
    var BorderColor='bl ack'; // Border color
    var BorderSubColor= 'black'; // Border color for subs
    var BorderWidth=1; // Border width
    var BorderBtwnElmnt s=1; // Border between elements 1 or 0
    var FontFamily="ver dana,arial,time s" // Font family menu items
    var FontSize=9; // Font size menu items
    var FontBold=1; // Bold menu items 1 or 0
    var FontItalic=0; // Italic menu items 1 or 0
    var MenuTextCentere d='left'; // Item text position 'left', 'center'
    or 'right'
    var MenuCentered='l eft'; // Menu horizontal position 'left',
    'center' or 'right'
    var MenuVerticalCen tered='top'; // Menu vertical position 'top',
    'middle','botto m' or static
    var ChildOverlap=.2 ; // horizontal overlap child/ parent
    var ChildVerticalOv erlap=.2; // vertical overlap child/ parent
    var StartTop=1; // Menu offset x coordinate
    var StartLeft=1; // Menu offset y coordinate
    var VerCorrect=0; // Multiple frames y correction
    var HorCorrect=0; // Multiple frames x correction
    var LeftPaddng=3; // Left padding
    var TopPaddng=2; // Top padding
    var FirstLineHorizo ntal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR
    VERTICAL
    var MenuFramesVerti cal=1; // Frames in cols or rows 1 or 0
    var DissapearDelay= 1000; // delay before menu folds in
    var TakeOverBgColor =1; // Menu frame takes over background color
    subitem frame
    var FirstLineFrame= 'navig'; // Frame where first level appears
    var SecLineFrame='s pace'; // Frame where sub levels appear
    var DocTargetFrame= 'space'; // Frame where target documents appear
    var TargetLoc=''; // span id for relative positioning
    var HideTop=0; // Hide first level when loading new document 1 or
    0
    var MenuWrap=1; // enables/ disables menu wrap 1 or 0
    var RightToLeft=0; // enables/ disables right to left unfold 1 or
    0
    var UnfoldsOnClick= 0; // Level 1 unfolds onclick/ onmouseover
    var WebMasterCheck= 0; // menu tree checking on or off 1 or 0
    var ShowArrow=1; // Uses arrow gifs when 1
    var KeepHilite=1; // Keep selected path highlighted
    var Arrws=['tri.gif',5,10, 'tridown.gif',1 0,5,'trileft.gi f',5,10]; //
    Arrow source, width and height

    function BeforeStart(){r eturn}
    function AfterBuild(){re turn}
    function BeforeFirstOpen (){return}
    function AfterCloseAll() {return}


    // Menu tree
    // MenuX=new Array(Text to show, Link, background image (optional),
    number of sub elements, height, width);
    // For rollover images set "Text to show" to:
    "rollover:Image 1.jpg:Image2.jp g"

    Menu1=new Array("Home","i ndex.html","",0 ,20,120);

    Menu2=new Array("What is NWR?","","",4);
    Menu2_1=new Array("Question s","http://javascript.inte rnet.com/tutorials/","",0,20,1 20);
    Menu2_2=new Array("Home","h ttp://javascript.inte rnet.com","",0) ;
    Menu2_3=new Array("internet ","http://www.internet.co m","",0);
    Menu2_4=new Array("Master
    List","http://javascript.inte rnet.com/master-list/","",2);
    Menu2_4_1=new Array("New","ht tp://javascript.inte rnet.com/new/","",0,20,1 20);
    Menu2_4_2=new Array("New","ht tp://javascript.inte rnet.com/new/","",0);

    Menu3=new Array("Members" ,"","",5);
    Menu3_1=new Array("Find a
    Group","http://javascript.inte rnet.com","",8, 20,120);
    Menu3_1_1=new Array("Scotland ","http://javascript.inte rnet.com","",0, 20,110);
    Menu3_1_2=new Array("Northeas t","http://javascript.inte rnet.com","",0) ;
    Menu3_1_3=new Array("Northwes t","http://javascript.inte rnet.com","",0) ;
    Menu3_1_4=new Array("East","h ttp://javascript.inte rnet.com","",0) ;
    Menu3_1_5=new Array("Midlands ","http://javascript.inte rnet.com","",0) ;
    Menu3_1_6=new Array("Southwes t","http://javascript.inte rnet.com","",0) ;
    Menu3_1_7=new Array("Central" ,"http://javascript.inte rnet.com","",0) ;
    Menu3_1_8=new Array("Southeas t","http://javascript.inte rnet.com","",0) ;
    Menu3_2=new Array("Overseas ","http://javascript.inte rnet.com","",0) ;
    Menu3_3=new Array("Interest
    Groups","http://javascript.inte rnet.com","",0) ;
    Menu3_4=new Array("Members\ '
    Area","http://javascript.inte rnet.com","",0) ;
    Menu3_5=new Array("Media"," ","",3);
    Menu3_5_1=new Array("Magazine ","http://javascript.inte rnet.com","",0, 20,120);
    Menu3_5_2=new Array("Newslett er","http://javascript.inte rnet.com","",0) ;
    Menu3_5_3=new Array("Annual
    Report","http://javascript.inte rnet.com","",0) ;

    Menu4=new Array("Events", "","",3);
    Menu4_1=new Array("Timetabl e","http://javascript.inte rnet.com","",0, 20,140);
    Menu4_2=new Array("Conferen ces","http://javascript.inte rnet.com","",3) ;
    Menu4_2_1=new Array("York","h ttp://javascript.inte rnet.com","",0, 20,110);
    Menu4_2_2=new Array("Guildfor d","http://javascript.inte rnet.com","",0) ;
    Menu4_2_3=new Array("Nottingh am","http://javascript.inte rnet.com","",0) ;
    Menu4_3=new Array("Treasure
    Trail","http://javascript.inte rnet.com","",0) ;

    Menu5=new Array("Resource s","","",5);
    Menu5_1=new Array("Forms"," http://javascript.inte rnet.com","",0, 20,140);
    Menu5_2=new Array("Programm e
    Research","http ://javascript.inte rnet.com","",0, 30,140);
    Menu5_3=new Array("Research
    Bank","http://javascript.inte rnet.com","",0, 20,140);
    Menu5_4=new Array("Members\ '
    Area","http://javascript.inte rnet.com","",5) ;
    Menu5_4_1=new Array("Chat","h ttp://javascript.inte rnet.com","",0, 20,120);
    Menu5_4_2=new Array("Links"," http://javascript.inte rnet.com","",0) ;
    Menu5_4_3=new Array("Web Research",
    "http://javascript.inte rnet.com","",0) ;
    Menu5_4_4=new Array("Group
    Sites","http://javascript.inte rnet.com","",0) ;
    Menu5_4_5=new Array("NWR
    Webspace","http ://javascript.inte rnet.com","",0) ;
    Menu5_5=new Array("NWR logos","logos.h tm","",0);

    Menu6=new Array("Contact Us","","",3);
    Menu6_1=new Array("Guestboo k","http://www.theguestboo k.com","",0,20, 120);
    Menu6_2=new Array("Forums", "http://forums.webdevel oper.com/forumdisplay.ph p?s=&forumid=3" ,"",0);
    Menu6_3=new Array("Webmaste r","http://javascript.inte rnet.com","",0) ;

    // end of file: nwrmenu_var.js

    // begin of file: menu_com.js

    var AgntUsr=navigat or.userAgent.to LowerCase();
    var DomYes=document .getElementById ?1:0;
    var NavYes=AgntUsr. indexOf('mozill a')!=-1&&AgntUsr.inde xOf('compatible ')==-1?1:0;
    var ExpYes=AgntUsr. indexOf('msie') !=-1?1:0;
    var Opr=AgntUsr.ind exOf('opera')!=-1?1:0;
    var DomNav=DomYes&& NavYes?1:0;
    var DomExp=DomYes&& ExpYes?1:0;
    var Nav4=NavYes&&!D omYes&&document .layers?1:0;
    var Exp4=ExpYes&&!D omYes&&document .all?1:0;
    var PosStrt=(NavYes ||ExpYes)&&!Opr ?1:0;

    var FrstLoc,ScLoc,D cLoc;
    var ScWinWdth,ScWin Hght,FrstWinWdt h,FrstWinHght;
    var ScLdAgainWin;
    var FirstColPos,Sec ColPos,DocColPo s;
    var RcrsLvl=0;
    var FrstCreat=1,Loa dd=0,Creatd=0,I niFlg,AcrssFrms =1;
    var FrstCntnr=null, CurrntOvr=null, CloseTmr=null;
    var CntrTxt,TxtClos e,ImgStr;
    var Ztop=100;
    var ShwFlg=0;
    var M_StrtTp=StartT op,M_StrtLft=St artLeft;
    var StaticPos=0;
    var LftXtra=DomNav? LeftPaddng:0;
    var TpXtra=DomNav?T opPaddng:0;
    var M_Hide=Nav4?'hi de':'hidden';
    var M_Show=Nav4?'sh ow':'visible';
    var Par=parent.fram es[0]&&FirstLineFram e!=SecLineFrame ?parent:window;
    var Doc=Par.documen t;
    var Bod=Doc.body;
    var Trigger=NavYes? Par:Bod;

    MenuTextCentere d=MenuTextCente red==1||MenuTex tCentered=='cen ter'?'center':M enuTextCentered ==0||MenuTextCe ntered!='right' ?'left':'right' ;
    WbMstrAlrts=["Item not defined: ","Item needs height: ","Item needs
    width: "];

    if(Trigger.onlo ad)Dummy=Trigge r.onload;
    if(DomNav&&!Opr )Trigger.addEve ntListener('loa d',Go,false);
    else Trigger.onload= Go;

    function Dummy(){return}

    function CnclSlct(){retu rn false}

    function RePos(){
    FrstWinWdth=Exp Yes?FrstLoc.doc ument.body.clie ntWidth:FrstLoc .innerWidth;
    FrstWinHght=Exp Yes?FrstLoc.doc ument.body.clie ntHeight:FrstLo c.innerHeight;
    ScWinWdth=ExpYe s?ScLoc.documen t.body.clientWi dth:ScLoc.inner Width;
    ScWinHght=ExpYe s?ScLoc.documen t.body.clientHe ight:ScLoc.inne rHeight;
    if(MenuCentered =='justify'&&Fi rstLineHorizont al){
    FrstCntnr.style .width=FrstWinW dth;
    ClcJus();
    var P=FrstCntnr.Frs tMbr,W=Menu1[5],i;
    for(i=0;i<NoOff FirstLineMenus; i++){P.style.wi dth=W;P=P.PrvMb r}}
    StaticPos=-1;
    if(TargetLoc)Cl cTrgt();
    if(MenuCentered )ClcLft();
    if(MenuVertical Centered)ClcTp( );
    PosMenu(FrstCnt nr,StartTop,Sta rtLeft)}

    function UnLoaded(){
    if(CloseTmr)cle arTimeout(Close Tmr);
    Loadd=0; Creatd=0;
    if(HideTop){
    var FCStyle=Nav4?Fr stCntnr:FrstCnt nr.style;
    FCStyle.visibil ity=M_Hide}}

    function ReDoWhole(){
    if(ScWinWdth!=S cLoc.innerWidth ||ScWinHght!=Sc Loc.innerHeight ||FrstWinWdth!= FrstLoc.innerWi dth||FrstWinHgh t!=FrstLoc.inne rHeight)Doc.loc ation.reload()}

    function Check(WMnu,NoOf ){
    var i,array,ArrayLo c;
    ArrayLoc=parent .frames[0]?parent.frames[FirstLineFrame]:self;
    for(i=0;i<NoOf; i++){
    array=WMnu+eval (i+1);
    if(!ArrayLoc[array]){WbMstrAlrt(0, array); return false}
    if(i==0){ if(!ArrayLoc[array][4]){WbMstrAlrt(1, array); return false}
    if(!ArrayLoc[array][5]){WbMstrAlrt(2, array); return false}}
    if(ArrayLoc[array][3])if(!Check(arra y+'_',ArrayLoc[array][3]))
    return false}
    return true}

    function WbMstrAlrt(No,X tra){
    return confirm(WbMstrA lrts[No]+Xtra+' ')}

    function Go(){
    Dummy();
    if(Loadd||!PosS trt)return;
    BeforeStart();
    Creatd=0; Loadd=1;
    status='Buildin g menu';
    if(FrstCreat){
    if(FirstLineFra me =="" || !parent.frames[FirstLineFrame]){
    FirstLineFrame= SecLineFrame;
    if(FirstLineFra me =="" || !parent.frames[FirstLineFrame]){
    FirstLineFrame= SecLineFrame=Do cTargetFrame;
    if(FirstLineFra me =="" ||
    !parent.frames[FirstLineFrame])FirstLineFrame =SecLineFrame=D ocTargetFrame=' '}}
    if(SecLineFrame =="" || !parent.frames[SecLineFrame]){
    SecLineFrame=Do cTargetFrame;
    if(SecLineFrame =="" ||
    !parent.frames[SecLineFrame])SecLineFrame=D ocTargetFrame=F irstLineFrame}
    if(DocTargetFra me =="" ||
    !parent.frames[DocTargetFrame])DocTargetFrame =SecLineFrame;
    if(WebMasterChe ck){ if(!Check('Menu ',NoOffFirstLin eMenus)){status ='build
    aborted';return }}
    FrstLoc=FirstLi neFrame!=""?par ent.frames[FirstLineFrame]:window;
    ScLoc=SecLineFr ame!=""?parent. frames[SecLineFrame]:window;
    DcLoc=DocTarget Frame!=""?paren t.frames[DocTargetFrame]:window;
    if (FrstLoc==ScLoc ) AcrssFrms=0;
    if (AcrssFrms)Firs tLineHorizontal =MenuFramesVert ical?0:1;
    FrstWinWdth=Exp Yes?FrstLoc.doc ument.body.clie ntWidth:FrstLoc .innerWidth;
    FrstWinHght=Exp Yes?FrstLoc.doc ument.body.clie ntHeight:FrstLo c.innerHeight;
    ScWinWdth=ExpYe s?ScLoc.documen t.body.clientWi dth:ScLoc.inner Width;
    ScWinHght=ExpYe s?ScLoc.documen t.body.clientHe ight:ScLoc.inne rHeight;
    if(Nav4){ CntrTxt=MenuTex tCentered!='lef t'?"<div
    align='"+MenuTe xtCentered+"'>" :"";
    TxtClose="</font>"+MenuText Centered!='left '?"</div>":""}}
    FirstColPos=Nav 4?FrstLoc.docum ent:FrstLoc.doc ument.body;
    SecColPos=Nav4? ScLoc.document: ScLoc.document. body;
    DocColPos=Nav4? DcLoc.document: ScLoc.document. body;
    if (TakeOverBgColo r)FirstColPos.b gColor=AcrssFrm s?SecColPos.bgC olor:DocColPos. bgColor;
    if(MenuCentered =='justify'&&Fi rstLineHorizont al)ClcJus();
    if(FrstCreat){
    FrstCntnr=Creat eMenuStructure( 'Menu',NoOffFir stLineMenus);
    FrstCreat=Acrss Frms?0:1}
    else CreateMenuStruc tureAgain('Menu ',NoOffFirstLin eMenus);
    if(TargetLoc)Cl cTrgt();
    if(MenuCentered )ClcLft();
    if(MenuVertical Centered)ClcTp( );
    PosMenu(FrstCnt nr,StartTop,Sta rtLeft);
    IniFlg=1;
    Initiate();
    Creatd=1;
    ScLdAgainWin=Ex pYes?ScLoc.docu ment.body:ScLoc ;
    ScLdAgainWin.on unload=UnLoaded ;
    Trigger.onresiz e=Nav4?ReDoWhol e:RePos;
    AfterBuild();
    if(MenuVertical Centered=='stat ic'&&!AcrssFrms )setInterval('K eepPos()',250);
    status='Menu ready for use'}

    function KeepPos(){
    var TS=ExpYes?FrstL oc.document.bod y.scrollTop:Frs tLoc.pageYOffse t;
    if(TS!=StaticPo s){
    var FCStyle=Nav4?Fr stCntnr:FrstCnt nr.style;
    FCStyle.top=Frs tCntnr.OrgTop=S tartTop+TS;Stat icPos=TS}}

    function ClcJus(){
    var a=BorderBtwnElm nts?1:2,b=Borde rBtwnElmnts?Bor derWidth:0;
    var Size=Math.round (((FrstWinWdth-a*BorderWidth)/NoOffFirstLineM enus)-b),i,j;
    for(i=1;i<NoOff FirstLineMenus+ 1;i++){j=eval(' Menu'+i);j[5]=Size}
    StartLeft=0}

    function ClcTrgt(){
    var TLoc=Nav4?FrstL oc.document.lay ers[TargetLoc]:DomYes?FrstLoc .document.getEl ementById(Targe tLoc):FrstLoc.d ocument.all[TargetLoc];
    StartTop=M_Strt Tp;
    StartLeft=M_Str tLft;
    if(DomYes){
    while(TLoc){Sta rtTop+=TLoc.off setTop;StartLef t+=TLoc.offsetL eft;TLoc=TLoc.o ffsetParent}}
    else{ StartTop+=Nav4? TLoc.pageY:TLoc .offsetTop;Star tLeft+=Nav4?TLo c.pageX:TLoc.of fsetLeft}}

    function ClcLft(){
    if(MenuCentered !='left'&&MenuC entered!='justi fy'){
    var Size=FrstWinWdt h-(!Nav4?parseInt (FrstCntnr.styl e.width):FrstCn tnr.clip.width) ;
    StartLeft=M_Str tLft;
    StartLeft+=Menu Centered=='righ t'?Size:Size/2}}

    function ClcTp(){
    if(MenuVertical Centered!='top' &&MenuVerticalC entered!='stati c'){
    var Size=FrstWinHgh t-(!Nav4?parseInt (FrstCntnr.styl e.height):FrstC ntnr.clip.heigh t);
    StartTop=M_Strt Tp;
    StartTop+=MenuV erticalCentered =='bottom'?Size :Size/2}}

    function PosMenu(CntnrPn tr,Tp,Lt){
    var Topi,Lefti,Hori ;
    var Cntnr=CntnrPntr ;
    var Mmbr=Cntnr.Frst Mbr;
    var CntnrStyle=!Nav 4?Cntnr.style:C ntnr;
    var MmbrStyle=!Nav4 ?Mmbr.style:Mmb r;
    var PadL=Mmbr.value .indexOf('<')==-1?LftXtra:0;
    var PadT=Mmbr.value .indexOf('<')==-1?TpXtra:0;
    var MmbrWt=!Nav4?pa rseInt(MmbrStyl e.width)+PadL:M mbrStyle.clip.w idth;
    var MmbrHt=!Nav4?pa rseInt(MmbrStyl e.height)+PadT: MmbrStyle.clip. height;
    var CntnrWt=!Nav4?p arseInt(CntnrSt yle.width):Cntn rStyle.clip.wid th;
    var CntnrHt=!Nav4?p arseInt(CntnrSt yle.height):Cnt nrStyle.clip.he ight;
    var SubTp,SubLt;
    RcrsLvl++;
    if (RcrsLvl==1 && AcrssFrms)!Menu FramesVertical? Tp=FrstWinHght-CntnrHt+(Nav4?4 :0):Lt=RightToL eft?0:FrstWinWd th-CntnrWt+(Nav4?4 :0);
    if (RcrsLvl==2 && AcrssFrms)!Menu FramesVertical? Tp=0:Lt=RightTo Left?ScWinWdth-CntnrWt:0;
    if (RcrsLvl==2 && AcrssFrms){Tp+= VerCorrect;Lt+= HorCorrect}
    CntnrStyle.top= RcrsLvl==1?Tp:0 ;
    Cntnr.OrgTop=Tp ;
    CntnrStyle.left =RcrsLvl==1?Lt: 0;
    Cntnr.OrgLeft=L t;
    if (RcrsLvl==1 && FirstLineHorizo ntal){
    Hori=1;Lefti=Cn tnrWt-MmbrWt-2*BorderWidth;T opi=0}
    else{ Hori=Lefti=0;To pi=CntnrHt-MmbrHt-2*BorderWidth}
    while(Mmbr!=nul l){
    MmbrStyle.left= Lefti+BorderWid th;
    MmbrStyle.top=T opi+BorderWidth ;
    if(Nav4)Mmbr.Cm dLyr.moveTo(Lef ti+BorderWidth, Topi+BorderWidt h);
    if(Mmbr.ChildCn tnr){
    if(RightToLeft) ChldCntnrWdth=N av4?Mmbr.ChildC ntnr.clip.width :parseInt(Mmbr. ChildCntnr.styl e.width);
    if(Hori){ SubTp=Topi+Mmbr Ht+2*BorderWidt h;
    SubLt=RightToLe ft?Lefti+MmbrWt-ChldCntnrWdth:L efti}
    else{ SubLt=RightToLe ft?Lefti-ChldCntnrWdth+C hildOverlap*Mmb rWt+BorderWidth :Lefti+(1-ChildOverlap)*M mbrWt+BorderWid th;
    SubTp=RcrsLvl== 1&&AcrssFrms?To pi:Topi+ChildVe rticalOverlap*M mbrHt}
    PosMenu(Mmbr.Ch ildCntnr,SubTp, SubLt)}
    Mmbr=Mmbr.PrvMb r;
    if(Mmbr){ MmbrStyle=!Nav4 ?Mmbr.style:Mmb r;
    PadL=Mmbr.value .indexOf('<')==-1?LftXtra:0;
    PadT=Mmbr.value .indexOf('<')==-1?TpXtra:0;
    MmbrWt=!Nav4?pa rseInt(MmbrStyl e.width)+PadL:M mbrStyle.clip.w idth;
    MmbrHt=!Nav4?pa rseInt(MmbrStyl e.height)+PadT: MmbrStyle.clip. height;
    Hori?Lefti-=BorderBtwnElmn ts?(MmbrWt+Bord erWidth):(MmbrW t):Topi-=BorderBtwnElmn ts?(MmbrHt+Bord erWidth):(MmbrH t)}}
    RcrsLvl--}

    function Initiate(){
    if(IniFlg){ Init(FrstCntnr) ;IniFlg=0;
    if(ShwFlg)After CloseAll();ShwF lg=0}}

    function Init(CntnrPntr) {
    var Mmbr=CntnrPntr. FrstMbr;
    var MCStyle=Nav4?Cn tnrPntr:CntnrPn tr.style;
    RcrsLvl++;
    MCStyle.visibil ity=RcrsLvl==1? M_Show:M_Hide;
    while(Mmbr!=nul l){
    if(Mmbr.Hilite) {Mmbr.Hilite=0; if(KeepHilite)L owItem(Mmbr)}
    if(Mmbr.ChildCn tnr) Init(Mmbr.Child Cntnr);
    Mmbr=Mmbr.PrvMb r}
    RcrsLvl--}

    function ClearAllChilds( Pntr){
    var CPCCStyle;
    while (Pntr){
    if(Pntr.Hilite) {
    Pntr.Hilite=0;
    if(KeepHilite)L owItem(Pntr);
    if(Pntr.ChildCn tnr){
    CPCCStyle=Nav4? Pntr.ChildCntnr :Pntr.ChildCntn r.style;
    CPCCStyle.visib ility=M_Hide;
    ClearAllChilds( Pntr.ChildCntnr .FrstMbr)}
    break}
    Pntr=Pntr.PrvMb r}}

    function GoTo(){
    if(this.LinkTxt ){
    status='';
    var HP=Nav4?this.Lo wLyr:this;
    LowItem(HP);
    this.LinkTxt.in dexOf('javascri pt:')!=-1?eval(this.Lin kTxt):DcLoc.loc ation.href=this .LinkTxt}
    }

    function HiliteItem(P){
    if(Nav4){
    if(P.ro)P.docum ent.images[P.rid].src=P.ri2;
    else{ if(P.HiBck)P.bg Color=P.HiBck;
    if(P.value.inde xOf('<img')==-1){
    P.document.writ e(P.Ovalue);
    P.document.clos e()}}}
    else{ if(P.ro){ var Lc=P.Level==1?F rstLoc:ScLoc;
    Lc.document.ima ges[P.rid].src=P.ri2}
    else{ if(P.HiBck)P.st yle.backgroundC olor=P.HiBck;
    if(P.HiFntClr)P .style.color=P. HiFntClr}}
    P.Hilite=1}

    function LowItem(P){
    if(P.ro){ if(Nav4)P.docum ent.images[P.rid].src=P.ri1;
    else{ var Lc=P.Level==1?F rstLoc:ScLoc;
    Lc.document.ima ges[P.rid].src=P.ri1}}
    else{ if(Nav4){ if(P.LoBck)P.bg Color=P.LoBck;
    if(P.value.inde xOf('<img')==-1){
    P.document.writ e(P.value);
    P.document.clos e()}}
    else{ if(P.LoBck)P.st yle.backgroundC olor=P.LoBck;
    if(P.LwFntClr)P .style.color=P. LwFntClr}}}

    function OpenMenu(){
    if(!Loadd||!Cre atd) return;
    var TpScrlld=ExpYes ?ScLoc.document .body.scrollTop :ScLoc.pageYOff set;
    var LScrlld=ExpYes? ScLoc.document. body.scrollLeft :ScLoc.pageXOff set;
    var CCnt=Nav4?this. LowLyr.ChildCnt nr:this.ChildCn tnr;
    var ThisHt=Nav4?thi s.clip.height:p arseInt(this.st yle.height);
    var ThisWt=Nav4?thi s.clip.width:pa rseInt(this.sty le.width);
    var ThisLft=AcrssFr ms&&this.Level= =1&&!FirstLineH orizontal?0:Nav 4?this.Containe r.left:parseInt (this.Container .style.left);
    var ThisTp=AcrssFrm s&&this.Level== 1&&FirstLineHor izontal?0:Nav4? this.Container. top:parseInt(th is.Container.st yle.top);
    var HP=Nav4?this.Lo wLyr:this;
    CurrntOvr=this;
    IniFlg=0;
    ClearAllChilds( this.Container. FrstMbr);
    HiliteItem(HP);
    if(CCnt!=null){
    if(!ShwFlg){Shw Flg=1; BeforeFirstOpen ()}
    var CCW=Nav4?this.L owLyr.ChildCntn r.clip.width:pa rseInt(this.Chi ldCntnr.style.w idth);
    var CCH=Nav4?this.L owLyr.ChildCntn r.clip.height:p arseInt(this.Ch ildCntnr.style. height);
    var ChCntTL=Nav4?th is.LowLyr.Child Cntnr:this.Chil dCntnr.style;
    var SubLt=AcrssFrms &&this.Level==1 ?CCnt.OrgLeft+T hisLft+LScrlld: CCnt.OrgLeft+Th isLft;
    var SubTp=AcrssFrms &&this.Level==1 ?CCnt.OrgTop+Th isTp+TpScrlld:C Cnt.OrgTop+This Tp;
    if(MenuWrap){
    if(RightToLeft) {
    if(SubLt<LScrll d)SubLt=this.Le vel==1?LScrlld: SubLt+(CCW+(1-2*ChildOverlap) *ThisWt);
    if(SubLt+CCW>Sc WinWdth+LScrlld )SubLt=ScWinWdt h+LScrlld-CCW}
    else{ if(SubLt+CCW>Sc WinWdth+LScrlld )SubLt=this.Lev el==1?ScWinWdth +LScrlld-CCW:SubLt-(CCW+(1-2*ChildOverlap) *ThisWt);
    if(SubLt<LScrll d)SubLt=LScrlld }
    if(SubTp+CCH>Tp Scrlld+ScWinHgh t)SubTp=this.Le vel==1?SubTp=Tp Scrlld+ScWinHgh t-CCH:SubTp-CCH+(1-2*ChildVertical Overlap)*ThisHt ;
    if(SubTp<TpScrl ld)SubTp=TpScrl ld}
    ChCntTL.top=Sub Tp;ChCntTL.left =SubLt;ChCntTL. visibility=M_Sh ow}
    status=this.Lin kTxt}

    function OpenMenuClick() {
    if(!Loadd||!Cre atd) return;
    var HP=Nav4?this.Lo wLyr:this;
    CurrntOvr=this;
    IniFlg=0;
    ClearAllChilds( this.Container. FrstMbr);
    HiliteItem(HP);
    status=this.Lin kTxt}

    function CloseMenu(){
    if(!Loadd||!Cre atd) return;
    if(!KeepHilite) {
    var HP=Nav4?this.Lo wLyr:this;
    LowItem(HP)}
    status='';
    if(this==Currnt Ovr){
    IniFlg=1;
    if(CloseTmr)cle arTimeout(Close Tmr);
    CloseTmr=setTim eout('Initiate( CurrntOvr)',Dis sapearDelay)}}

    function CntnrSetUp(Wdth ,Hght,NoOff){
    var x=RcrsLvl==1?Bo rderColor:Borde rSubColor;
    this.FrstMbr=nu ll;
    this.OrgLeft=th is.OrgTop=0;
    if(x)this.bgCol or=x;
    if(Nav4){ this.visibility ='hide';
    this.resizeTo(W dth,Hght)}
    else{ if(x)this.style .backgroundColo r=x;
    this.style.widt h=Wdth;
    this.style.heig ht=Hght;
    this.style.font Family=FontFami ly;
    this.style.font Weight=FontBold ?'bold':'normal ';
    this.style.font Style=FontItali c?'italic':'nor mal';
    this.style.font Size=FontSize+' pt';
    this.style.zInd ex=RcrsLvl+Ztop }}

    function MbrSetUp(MmbrCn tnr,PrMmbr,What Menu,Wdth,Hght) {
    var Location=RcrsLv l==1?FrstLoc:Sc Loc;
    var MemVal=eval(Wha tMenu+'[0]');
    var t,T,L,W,H,S;
    var a,b,c,d;
    this.PrvMbr=PrM mbr;
    this.Level=Rcrs Lvl;
    this.LinkTxt=ev al(WhatMenu+'[1]');
    this.Container= MmbrCntnr;
    this.ChildCntnr =null;
    this.Hilite=0;
    this.style.over flow='hidden';
    this.style.curs or=ExpYes&&(thi s.LinkTxt||(Rcr sLvl==1&&Unfold sOnClick))?'han d':'default';
    this.ro=0;
    if(MemVal.index Of('rollover')! =-1){
    this.ro=1;
    this.ri1=MemVal .substring(MemV al.indexOf(':') +1,MemVal.lastI ndexOf(':'));
    this.ri2=MemVal .substring(MemV al.lastIndexOf( ':')+1,MemVal.l ength);
    this.rid=WhatMe nu+'i';MemVal=" <img src='"+this.ri1 +"'
    name='"+this.ri d+"'>"}
    this.value=MemV al;
    if(RcrsLvl==1){
    a=LowBgColor;
    b=HighBgColor;
    c=FontLowColor;
    d=FontHighColor }
    else{ a=LowSubBgColor ;
    b=HighSubBgColo r;
    c=FontSubLowCol or;
    d=FontSubHighCo lor}
    this.LoBck=a;
    this.LwFntClr=c ;
    this.HiBck=b;
    this.HiFntClr=d ;
    this.style.colo r=this.LwFntClr ;
    if(this.LoBck)t his.style.backg roundColor=this .LoBck;
    this.style.text Align=MenuTextC entered;
    if(eval(WhatMen u+'[2]'))this.style.b ackgroundImage= "url(\'"+eval(W hatMenu+'[2]')+"\')";
    if(MemVal.index Of('<')==-1){
    this.style.widt h=Wdth-LftXtra;
    this.style.heig ht=Hght-TpXtra;
    this.style.padd ingLeft=LeftPad dng;
    this.style.padd ingTop=TopPaddn g}
    else{ this.style.widt h=Wdth;
    this.style.heig ht=Hght}
    if(MemVal.index Of('<')==-1&&DomYes){
    t=Location.docu ment.createText Node(MemVal);
    this.appendChil d(t)}
    else this.innerHTML= MemVal;
    if(eval(WhatMen u+'[3]')&&ShowArrow) {
    a=RcrsLvl==1&&F irstLineHorizon tal?3:RightToLe ft?6:0;
    S=Arrws[a];
    W=Arrws[a+1];
    H=Arrws[a+2];
    T=RcrsLvl==1&&F irstLineHorizon tal?Hght-H-2:(Hght-H)/2;
    L=RightToLeft?2 :Wdth-W-2;
    if(DomYes){
    t=Location.docu ment.createElem ent('img');
    this.appendChil d(t);
    t.style.positio n='absolute';
    t.src=S;
    t.style.width=W ;
    t.style.height= H;
    t.style.top=T;
    t.style.left=L}
    else{ MemVal+="<div style='position :absolute; top:"+T+"; left:"+L+";
    width:"+W+"; height:"+H+";vi sibility:inheri t'><img
    src='"+S+"'></div>";
    this.innerHTML= MemVal}}
    if(ExpYes){this .onselectstart= CnclSlct;
    this.onmouseove r=RcrsLvl==1&&U nfoldsOnClick?O penMenuClick:Op enMenu;
    this.onmouseout =CloseMenu;
    this.onclick=Rc rsLvl==1&&Unfol dsOnClick&&eval (WhatMenu+'[3]')?OpenMenu:GoT o }
    else{ RcrsLvl==1&&Unf oldsOnClick?thi s.addEventListe ner('mouseover' ,OpenMenuClick, false):this.add EventListener(' mouseover',Open Menu,false);
    this.addEventLi stener('mouseou t',CloseMenu,fa lse);
    RcrsLvl==1&&Unf oldsOnClick&&ev al(WhatMenu+'[3]')?this.addEven tListener('clic k',OpenMenu,fal se):this.addEve ntListener('cli ck',GoTo,false) }}

    function NavMbrSetUp(Mmb rCntnr,PrMmbr,W hatMenu,Wdth,Hg ht){
    var a,b,c,d;
    if(RcrsLvl==1){
    a=LowBgColor;
    b=HighBgColor;
    c=FontLowColor;
    d=FontHighColor }
    else { a=LowSubBgColor ;
    b=HighSubBgColo r;
    c=FontSubLowCol or;
    d=FontSubHighCo lor }
    this.value=eval (WhatMenu+'[0]');
    this.ro=0;
    if(this.value.i ndexOf('rollove r')!=-1){
    this.ro=1;
    this.ri1=this.v alue.substring( this.value.inde xOf(':')+1,this .value.lastInde xOf(':'));
    this.ri2=this.v alue.substring( this.value.last IndexOf(':')+1, this.value.leng th);
    this.rid=WhatMe nu+'i';this.val ue="<img src='"+this.ri1 +"'
    name='"+this.ri d+"'>"}
    if(LeftPaddng&& this.value.inde xOf('<')==-1&&MenuTextCent ered=='left')th is.value='&nbsp \;'+this.value;
    if(FontBold)thi s.value=this.va lue.bold();
    if(FontItalic)t his.value=this. value.italics() ;
    this.Ovalue=thi s.value;
    this.value=this .value.fontcolo r(c);
    this.Ovalue=thi s.Ovalue.fontco lor(d);
    this.value=Cntr Txt+"<font face='"+FontFam ily+"'
    point-size='"+FontSiz e+"'>"+this.val ue+TxtClose;
    this.Ovalue=Cnt rTxt+"<font face='"+FontFam ily+"'
    point-size='"+FontSiz e+"'>"+this.Ova lue+TxtClose;
    this.LoBck=a;
    this.HiBck=b;
    this.ChildCntnr =null;
    this.PrvMbr=PrM mbr;
    this.Hilite=0;
    this.visibility ='inherit';
    if(this.LoBck)t his.bgColor=thi s.LoBck;
    this.resizeTo(W dth,Hght);
    if(!AcrssFrms&& eval(WhatMenu+'[2]'))this.backgro und.src=eval(Wh atMenu+'[2]');
    this.document.w rite(this.value );
    this.document.c lose();
    this.CmdLyr=new Layer(Wdth,Mmbr Cntnr);
    this.CmdLyr.Lev el=RcrsLvl;
    this.CmdLyr.Lin kTxt=eval(WhatM enu+'[1]');
    this.CmdLyr.vis ibility='inheri t';
    this.CmdLyr.onm ouseover=RcrsLv l==1&&UnfoldsOn Click?OpenMenuC lick:OpenMenu;
    this.CmdLyr.onm ouseout=CloseMe nu;
    this.CmdLyr.cap tureEvents(Even t.MOUSEUP);
    this.CmdLyr.onm ouseup=RcrsLvl= =1&&UnfoldsOnCl ick&&eval(WhatM enu+'[3]')?OpenMenu:GoT o;
    this.CmdLyr.Low Lyr=this;
    this.CmdLyr.res izeTo(Wdth,Hght );
    this.CmdLyr.Con tainer=MmbrCntn r;
    if(eval(WhatMen u+'[3]')&&ShowArrow) {
    a=RcrsLvl==1&&F irstLineHorizon tal?3:RightToLe ft?6:0;
    this.CmdLyr.Img Lyr=new Layer(Arrws[a+1],this.CmdLyr);
    this.CmdLyr.Img Lyr.visibility= 'inherit';
    this.CmdLyr.Img Lyr.top=RcrsLvl ==1&&FirstLineH orizontal?Hght-Arrws[a+2]-2:(Hght-Arrws[a+2])/2;
    this.CmdLyr.Img Lyr.left=RightT oLeft?2:Wdth-Arrws[a+1]-2;
    this.CmdLyr.Img Lyr.width=Arrws[a+1];
    this.CmdLyr.Img Lyr.height=Arrw s[a+2];
    ImgStr="<img src='"+Arrws[a]+"' width='"+Arrws[a+1]+"'
    height='"+Arrws[a+2]+"'>";
    this.CmdLyr.Img Lyr.document.wr ite(ImgStr);
    this.CmdLyr.Img Lyr.document.cl ose()}}

    function CreateMenuStruc ture(MName,Numb erOf){
    RcrsLvl++;
    var i,NoOffSubs,Mbr ,Wdth=0,Hght=0;
    var PrvMmbr=null;
    var WMnu=MName+'1';
    var MenuWidth=eval( WMnu+'[5]');
    var MenuHeight=eval (WMnu+'[4]');
    var Location=RcrsLv l==1?FrstLoc:Sc Loc;
    if (RcrsLvl==1&&Fi rstLineHorizont al){
    for(i=1;i<Numbe rOf+1;i++){
    WMnu=MName+eval (i);
    Wdth=eval(WMnu+ '[5]')?Wdth+eval(WM nu+'[5]'):Wdth+MenuWid th}
    Wdth=BorderBtwn Elmnts?Wdth+(Nu mberOf+1)*Borde rWidth:Wdth+2*B orderWidth;Hght =MenuHeight+2*B orderWidth}
    else{ for(i=1;i<Numbe rOf+1;i++){
    WMnu=MName+eval (i);
    Hght=eval(WMnu+ '[4]')?Hght+eval(WM nu+'[4]'):Hght+MenuHei ght}
    Hght=BorderBtwn Elmnts?Hght+(Nu mberOf+1)*Borde rWidth:Hght+2*B orderWidth;Wdth =MenuWidth+2*Bo rderWidth}
    if(DomYes){
    var MmbrCntnr=Locat ion.document.cr eateElement("di v");
    MmbrCntnr.style .position='abso lute';
    MmbrCntnr.style .visibility='hi dden';
    Location.docume nt.body.appendC hild(MmbrCntnr) }
    else{ if(Nav4) var MmbrCntnr=new Layer(Wdth,Loca tion)
    else{ WMnu+='c';
    Location.docume nt.body.insertA djacentHTML("Af terBegin","<div
    id='"+WMnu+"' style='visibili ty:hidden; position:absolu te;'><\/div>");
    var MmbrCntnr=Locat ion.document.al l[WMnu]}}
    MmbrCntnr.SetUp =CntnrSetUp;
    MmbrCntnr.SetUp (Wdth,Hght,Numb erOf);
    if(Exp4){ MmbrCntnr.Inner String='';
    for(i=1;i<Numbe rOf+1;i++){
    WMnu=MName+eval (i);
    MmbrCntnr.Inner String+="<div id='"+WMnu+"'
    style='position :absolute;'><\/div>"}
    MmbrCntnr.inner HTML=MmbrCntnr. InnerString}
    for(i=1;i<Numbe rOf+1;i++){
    WMnu=MName+eval (i);
    NoOffSubs=eval( WMnu+'[3]');
    Wdth=RcrsLvl==1 &&FirstLineHori zontal?eval(WMn u+'[5]')?eval(WMnu+'[5]'):MenuWidth:Me nuWidth;
    Hght=RcrsLvl==1 &&FirstLineHori zontal?MenuHeig ht:eval(WMnu+'[4]')?eval(WMnu+'[4]'):MenuHeight;
    if(DomYes){
    Mbr=Location.do cument.createEl ement("div");
    Mbr.style.posit ion='absolute';
    Mbr.style.visib ility='inherit' ;
    MmbrCntnr.appen dChild(Mbr)}
    else Mbr=Nav4?new Layer(Wdth,Mmbr Cntnr):Location .document.all[WMnu];
    Mbr.SetUp=Nav4? NavMbrSetUp:Mbr SetUp;
    Mbr.SetUp(MmbrC ntnr,PrvMmbr,WM nu,Wdth,Hght);
    if(NoOffSubs) Mbr.ChildCntnr= CreateMenuStruc ture(WMnu+'_',N oOffSubs);
    PrvMmbr=Mbr}
    MmbrCntnr.FrstM br=Mbr;
    RcrsLvl--;
    return(MmbrCntn r)}

    function CreateMenuStruc tureAgain(MName ,NumberOf){
    var i,WMnu,NoOffSub s,PrvMmbr,Mbr=F rstCntnr.FrstMb r;
    RcrsLvl++;
    for(i=NumberOf; i>0;i--){
    WMnu=MName+eval (i);
    NoOffSubs=eval( WMnu+'[3]');
    PrvMmbr=Mbr;
    if(NoOffSubs)Mb r.ChildCntnr=Cr eateMenuStructu re(WMnu+'_',NoO ffSubs);
    Mbr=Mbr.PrvMbr}
    RcrsLvl--}

    // end of file: menu_com.js
  • Richard Cornford

    #2
    Re: javascript toolbar-menu problem

    JesusFreak <d4296d71.04022 40831.4d437c21@ posting.google. com> wrote:
    <snip>[color=blue]
    > Recently, I downloaded the following beautiful script
    > "http://javascript.inte rnet.com/navigation/toolbar-menu.html".
    > It works like a charm.[/color]

    You mean you chant some sort of incantation and hope? Charms don't work,
    but neither does your code. I particularly liked the comment on the
    referenced page that reads "Works in all browsers", a claim that would
    never pass the lips of anyone who understands browser scripting.
    [color=blue]
    > I made my webpage in frames, where the nav-frame
    > shows the menubar, so whenever I click a link in the menubar, it
    > opens in the frame below. But the problem is the toolbar does not
    > refresch itself and the expandable menus don't work anymore. Now I
    > can refresh the nav-frame, but I just used frames so the site
    > shouldn't reload every time the script. If someone has an idea,
    > I would be very grateful.[/color]

    So you have an example of this script on your site somewhere and it
    doesn't work as advertised in that context but instead of posting a URL
    to where it can be seen in context you have posted a mass of badly
    formatted and inappropriately line wrapped code and a link to a site
    where it is ostensibly working (at least in as for as this script could
    be expected to work).

    <snip>[color=blue]
    > var AgntUsr=navigat or.userAgent.to LowerCase();
    > var DomYes=document .getElementById ?1:0;
    > var NavYes=AgntUsr. indexOf('mozill a')!=-1&&
    > AgntUsr.indexOf ('compatible')= =-1?1:0;
    > var ExpYes=AgntUsr. indexOf('msie') !=-1?1:0;
    > var Opr=AgntUsr.ind exOf('opera')!=-1?1:0;
    > var DomNav=DomYes&& NavYes?1:0;
    > var DomExp=DomYes&& ExpYes?1:0;
    > var Nav4=NavYes&&!D omYes&&document .layers?1:0;
    > var Exp4=ExpYes&&!D omYes&&document .all?1:0;[/color]

    Browser detecting is such an unreliable strategy by any means (and this
    script is trying both userAgent string and object inference detecting)
    that any script that uses it can be instantly dismissed for that reason
    alone.

    <snip>[color=blue]
    > function NavMbrSetUp(Mmb rCntnr,PrMmbr,W hatMenu,Wdth,Hg ht){[/color]
    <snip>[color=blue]
    > if(!AcrssFrms&& eval(WhatMenu+'[2]'))
    > this.background .src=eval(WhatM enu+'[2]');[/color]
    <snip>[color=blue]
    > if(eval(WhatMen u+'[3]')&&ShowArrow) {[/color]
    <snip>[color=blue]
    > function CreateMenuStruc ture(MName,Numb erOf){[/color]
    <snip>[color=blue]
    > for(i=1;i<Numbe rOf+1;i++){
    > WMnu=MName+eval (i);
    > Wdth=eval(WMnu+ '[5]')?Wdth+eval(WM nu+'[5]'):Wdth+MenuWid th}[/color]
    <snip>

    Nobody but a complete amateur would write code like this. The eval abuse
    is totally pointless, particularly the - WMnu=MName+eval (i); - line.

    There is no point in anyone trying to figure out why this script is not
    working for you, or attempting to fix it. That would require a complete
    re-write from scratch. When you start looking for a replacement remember
    to stay well away form wherever you fond it. A source of this quality is
    best avoided.

    Richard.


    Comment

    • kaeli

      #3
      Re: javascript toolbar-menu problem

      In article <d4296d71.04022 40831.4d437c21@ posting.google. com>,
      us_traveller@ya hoo.com enlightened us with...[color=blue]
      >
      > Recently, I downloaded the following beautiful script
      > "http://javascript.inte rnet.com/navigation/toolbar-menu.html".[/color]

      This is a corrupted version of HVMenu with no credit that I could see to
      the original author. Shame on them.
      Use the real thing.



      READ the DOCUMENTATION that comes with. :)

      I use it in a framed site. So I can tell you it works. I've tested it
      with NN4+, IE5+, Mozilla, and Opera (I had to modify a line for Opera to
      work).
      Don't post a shitload of code and ask me why it doesn't work for you,
      okay? :p


      --
      --
      ~kaeli~
      Who is General Failure and why is he reading my hard disk?



      Comment

      • kaeli

        #4
        Re: javascript toolbar-menu problem

        In article <d4296d71.04022 40831.4d437c21@ posting.google. com>,
        us_traveller@ya hoo.com enlightened us with...[color=blue]
        >
        > Recently, I downloaded the following beautiful script
        > "http://javascript.inte rnet.com/navigation/toolbar-menu.html[/color]


        Note: a complaint has been filed with this site to remove this code, as
        it was plagiarised.

        Original:


        --
        --
        ~kaeli~
        Dancing cheek-to-cheek is really a form of floor play.



        Comment

        • JesusFreak

          #5
          Re: javascript toolbar-menu problem

          Oh, now I get it. It wasn't just my poor knowledge of javascript that
          not made me see what was going on. Thank you sincerely for the effort
          of helping me out. I'll try to understand the original menu which
          kaeli so friendly posted for me.

          JesusFreak

          "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c1g50i$ej f$1$8302bc10@ne ws.demon.co.uk> ...[color=blue]
          > JesusFreak <d4296d71.04022 40831.4d437c21@ posting.google. com> wrote:
          > <snip>[color=green]
          > > Recently, I downloaded the following beautiful script
          > > "http://javascript.inte rnet.com/navigation/toolbar-menu.html".
          > > It works like a charm.[/color]
          >
          > You mean you chant some sort of incantation and hope? Charms don't work,
          > but neither does your code. I particularly liked the comment on the
          > referenced page that reads "Works in all browsers", a claim that would
          > never pass the lips of anyone who understands browser scripting.
          >[color=green]
          > > I made my webpage in frames, where the nav-frame
          > > shows the menubar, so whenever I click a link in the menubar, it
          > > opens in the frame below. But the problem is the toolbar does not
          > > refresch itself and the expandable menus don't work anymore. Now I
          > > can refresh the nav-frame, but I just used frames so the site
          > > shouldn't reload every time the script. If someone has an idea,
          > > I would be very grateful.[/color]
          >
          > So you have an example of this script on your site somewhere and it
          > doesn't work as advertised in that context but instead of posting a URL
          > to where it can be seen in context you have posted a mass of badly
          > formatted and inappropriately line wrapped code and a link to a site
          > where it is ostensibly working (at least in as for as this script could
          > be expected to work).
          >
          > <snip>[color=green]
          > > var AgntUsr=navigat or.userAgent.to LowerCase();
          > > var DomYes=document .getElementById ?1:0;
          > > var NavYes=AgntUsr. indexOf('mozill a')!=-1&&
          > > AgntUsr.indexOf ('compatible')= =-1?1:0;
          > > var ExpYes=AgntUsr. indexOf('msie') !=-1?1:0;
          > > var Opr=AgntUsr.ind exOf('opera')!=-1?1:0;
          > > var DomNav=DomYes&& NavYes?1:0;
          > > var DomExp=DomYes&& ExpYes?1:0;
          > > var Nav4=NavYes&&!D omYes&&document .layers?1:0;
          > > var Exp4=ExpYes&&!D omYes&&document .all?1:0;[/color]
          >
          > Browser detecting is such an unreliable strategy by any means (and this
          > script is trying both userAgent string and object inference detecting)
          > that any script that uses it can be instantly dismissed for that reason
          > alone.
          >
          > <snip>[color=green]
          > > function NavMbrSetUp(Mmb rCntnr,PrMmbr,W hatMenu,Wdth,Hg ht){[/color]
          > <snip>[color=green]
          > > if(!AcrssFrms&& eval(WhatMenu+'[2]'))
          > > this.background .src=eval(WhatM enu+'[2]');[/color]
          > <snip>[color=green]
          > > if(eval(WhatMen u+'[3]')&&ShowArrow) {[/color]
          > <snip>[color=green]
          > > function CreateMenuStruc ture(MName,Numb erOf){[/color]
          > <snip>[color=green]
          > > for(i=1;i<Numbe rOf+1;i++){
          > > WMnu=MName+eval (i);
          > > Wdth=eval(WMnu+ '[5]')?Wdth+eval(WM nu+'[5]'):Wdth+MenuWid th}[/color]
          > <snip>
          >
          > Nobody but a complete amateur would write code like this. The eval abuse
          > is totally pointless, particularly the - WMnu=MName+eval (i); - line.
          >
          > There is no point in anyone trying to figure out why this script is not
          > working for you, or attempting to fix it. That would require a complete
          > re-write from scratch. When you start looking for a replacement remember
          > to stay well away form wherever you fond it. A source of this quality is
          > best avoided.
          >
          > Richard.[/color]

          Comment

          Working...