[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/ -> menu_animation.js (source)

   1  /***** Engine for menus *****/
   2  /*
   3  *    (c) Ger Versluis 2000 version 5.411 - MAX! 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
   4  *    HV Menu found on Dynamic Drive ONLY may be used on both commercial and non commerical sites    *
   5  *    For info write to [email protected]                                    *
   6  *       This script featured on Dynamic Drive DHTML code library: http://www.dynamicdrive.com
   7  */
   8  
   9      var AgntUsr=navigator.userAgent.toLowerCase();
  10      var DomYes=document.getElementById?1:0;
  11      var NavYes=AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1?1:0;
  12      var ExpYes=AgntUsr.indexOf('msie')!=-1?1:0;
  13      var Opr=AgntUsr.indexOf('opera')!=-1?1:0;
  14      var Opr6orless=window.opera && navigator.userAgent.search(/opera.[1-6]/i)!=-1 //DynamicDrive.com added code
  15      var DomNav=DomYes&&NavYes?1:0;
  16       var DomExp=DomYes&&ExpYes?1:0;
  17      var Nav4=NavYes&&!DomYes&&document.layers?1:0;
  18      var Exp4=ExpYes&&!DomYes&&document.all?1:0;
  19      var PosStrt=(NavYes||ExpYes)&&!Opr6orless?1:0;
  20  
  21      var FrstLoc,ScLoc,DcLoc;
  22      var ScWinWdth,ScWinHght,FrstWinWdth,FrstWinHght;
  23      var ScLdAgainWin;
  24      var FirstColPos,SecColPos,DocColPos;
  25      var RcrsLvl=0;
  26      var FrstCreat=1,Loadd=0,Creatd=0,IniFlg,AcrssFrms=1;
  27      var FrstCntnr=null,CurrntOvr=null,CloseTmr=null;
  28      var CntrTxt,TxtClose,ImgStr;
  29      var Ztop=100;
  30      var ShwFlg=0;
  31      var M_StrtTp=StartTop,M_StrtLft=StartLeft;
  32      var StaticPos=0;
  33      var LftXtra=DomNav?LeftPaddng:0;
  34      var TpXtra=DomNav?TopPaddng:0;
  35      var M_Hide=Nav4?'hide':'hidden';
  36      var M_Show=Nav4?'show':'visible';
  37      var Par=parent.frames[0]&&FirstLineFrame!=SecLineFrame?parent:window;
  38      var Doc=Par.document;
  39      var Bod=Doc.body;
  40      var Trigger=NavYes?Par:Bod;
  41  
  42      MenuTextCentered=MenuTextCentered==1||MenuTextCentered=='center'?'center':MenuTextCentered==0||MenuTextCentered!='right'?'left':'right';
  43  
  44  
  45  
  46      WbMstrAlrts=["Item not defined: ","Item needs height: ","Item needs width: "];
  47  
  48      if(Trigger.onload)Dummy=Trigger.onload;
  49      if(DomNav&&!Opr)Trigger.addEventListener('load',Go,false);
  50      else Trigger.onload=Go;
  51  
  52  function Dummy(){return}
  53  
  54  function CnclSlct(){return false}
  55  
  56  function RePos(){
  57      FrstWinWdth=ExpYes?FrstLoc.document.body.clientWidth:FrstLoc.innerWidth;
  58      FrstWinHght=ExpYes?FrstLoc.document.body.clientHeight:FrstLoc.innerHeight;
  59      ScWinWdth=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
  60      ScWinHght=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
  61      if(MenuCentered=='justify'&&FirstLineHorizontal){
  62          FrstCntnr.style.width=FrstWinWdth;
  63          ClcJus();
  64          var P=FrstCntnr.FrstMbr,W=Menu1[5],i;
  65          for(i=0;i<NoOffFirstLineMenus;i++){P.style.width=W;P=P.PrvMbr}}
  66      StaticPos=-1;
  67      if(TargetLoc)ClcTrgt();
  68      if(MenuCentered)ClcLft();
  69      if(MenuVerticalCentered)ClcTp();
  70      PosMenu(FrstCntnr,StartTop,StartLeft)}
  71  
  72  function UnLoaded(){
  73      if(CloseTmr)clearTimeout(CloseTmr);
  74      Loadd=0; Creatd=0;
  75      if(HideTop){
  76          var FCStyle=Nav4?FrstCntnr:FrstCntnr.style;
  77          FCStyle.visibility=M_Hide}}
  78  
  79  function ReDoWhole(){
  80      if(ScWinWdth!=ScLoc.innerWidth||ScWinHght!=ScLoc.innerHeight||FrstWinWdth!=FrstLoc.innerWidth||FrstWinHght!=FrstLoc.innerHeight)Doc.location.reload()}
  81  
  82  function Check(WMnu,NoOf){
  83      var i,array,ArrayLoc;
  84      ArrayLoc=parent.frames[0]?parent.frames[FirstLineFrame]:self;
  85      for(i=0;i<NoOf;i++){
  86          array=WMnu+eval(i+1);
  87          if(!ArrayLoc[array]){WbMstrAlrt(0,array); return false}
  88          if(i==0){    if(!ArrayLoc[array][4]){WbMstrAlrt(1,array); return false}
  89              if(!ArrayLoc[array][5]){WbMstrAlrt(2,array); return false}}
  90          if(ArrayLoc[array][3])if(!Check(array+'_',ArrayLoc[array][3])) return false}
  91      return true}
  92  
  93  function WbMstrAlrt(No,Xtra){
  94      return confirm(WbMstrAlrts[No]+Xtra+'   ')}
  95  
  96  function Go(){
  97      Dummy();
  98      if(Loadd||!PosStrt)return;
  99      BeforeStart();
 100      Creatd=0; Loadd=1;
 101      status='Building menu';
 102      if(FrstCreat){
 103          if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){
 104              FirstLineFrame=SecLineFrame;
 105              if(FirstLineFrame =="" || !parent.frames[FirstLineFrame]){
 106                  FirstLineFrame=SecLineFrame=DocTargetFrame;
 107                  if(FirstLineFrame =="" || !parent.frames[FirstLineFrame])FirstLineFrame=SecLineFrame=DocTargetFrame=''}}
 108          if(SecLineFrame =="" || !parent.frames[SecLineFrame]){
 109              SecLineFrame=DocTargetFrame;
 110              if(SecLineFrame =="" || !parent.frames[SecLineFrame])SecLineFrame=DocTargetFrame=FirstLineFrame}
 111          if(DocTargetFrame =="" || !parent.frames[DocTargetFrame])DocTargetFrame=SecLineFrame;
 112          if(WebMasterCheck){    if(!Check('Menu',NoOffFirstLineMenus)){status='build aborted';return}}
 113          FrstLoc=FirstLineFrame!=""?parent.frames[FirstLineFrame]:window;
 114          ScLoc=SecLineFrame!=""?parent.frames[SecLineFrame]:window;
 115          DcLoc=DocTargetFrame!=""?parent.frames[DocTargetFrame]:window;
 116          if (FrstLoc==ScLoc) AcrssFrms=0;
 117          if (AcrssFrms)FirstLineHorizontal=MenuFramesVertical?0:1;
 118          FrstWinWdth=ExpYes?FrstLoc.document.body.clientWidth:FrstLoc.innerWidth;
 119          FrstWinHght=ExpYes?FrstLoc.document.body.clientHeight:FrstLoc.innerHeight;
 120          ScWinWdth=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
 121          ScWinHght=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
 122          if(Nav4){    CntrTxt=MenuTextCentered!='left'?"<div align='"+MenuTextCentered+"'>":"";
 123              TxtClose="</font>"+MenuTextCentered!='left'?"</div>":""}}
 124      FirstColPos=Nav4?FrstLoc.document:FrstLoc.document.body;
 125      SecColPos=Nav4?ScLoc.document:ScLoc.document.body;
 126      DocColPos=Nav4?DcLoc.document:ScLoc.document.body;
 127      if (TakeOverBgColor)FirstColPos.bgColor=AcrssFrms?SecColPos.bgColor:DocColPos.bgColor;
 128      if(MenuCentered=='justify'&&FirstLineHorizontal)ClcJus();
 129      if(FrstCreat){
 130          FrstCntnr=CreateMenuStructure('Menu',NoOffFirstLineMenus);
 131          FrstCreat=AcrssFrms?0:1}
 132      else CreateMenuStructureAgain('Menu',NoOffFirstLineMenus);
 133      if(TargetLoc)ClcTrgt();
 134      if(MenuCentered)ClcLft();
 135      if(MenuVerticalCentered)ClcTp();
 136      PosMenu(FrstCntnr,StartTop,StartLeft);
 137      IniFlg=1;
 138      Initiate();
 139      Creatd=1;
 140      ScLdAgainWin=ExpYes?ScLoc.document.body:ScLoc;
 141      ScLdAgainWin.onunload=UnLoaded;
 142      Trigger.onresize=Nav4?ReDoWhole:RePos;
 143      AfterBuild();
 144      if(MenuVerticalCentered=='static'&&!AcrssFrms)setInterval('KeepPos()',250);
 145      status='Menu ready for use'}
 146  
 147  function KeepPos(){
 148      var TS=ExpYes?FrstLoc.document.body.scrollTop:FrstLoc.pageYOffset;
 149      if(TS!=StaticPos){
 150          var FCStyle=Nav4?FrstCntnr:FrstCntnr.style;
 151          FCStyle.top=FrstCntnr.OrgTop=StartTop+TS;StaticPos=TS}}
 152  
 153  function ClcJus(){
 154      var a=BorderBtwnElmnts?1:2,b=BorderBtwnElmnts?BorderWidth:0;
 155      var Size=Math.round(((FrstWinWdth-a*BorderWidth)/NoOffFirstLineMenus)-b),i,j;
 156      for(i=1;i<NoOffFirstLineMenus+1;i++){j=eval('Menu'+i);j[5]=Size}
 157      StartLeft=0}
 158  
 159  function ClcTrgt(){
 160      var TLoc=Nav4?FrstLoc.document.layers[TargetLoc]:DomYes?FrstLoc.document.getElementById(TargetLoc):FrstLoc.document.all[TargetLoc];
 161      StartTop=M_StrtTp;
 162      StartLeft=M_StrtLft;
 163      if(DomYes){
 164          while(TLoc){StartTop+=TLoc.offsetTop;StartLeft+=TLoc.offsetLeft;TLoc=TLoc.offsetParent}}
 165      else{    StartTop+=Nav4?TLoc.pageY:TLoc.offsetTop;StartLeft+=Nav4?TLoc.pageX:TLoc.offsetLeft}}
 166  
 167  function ClcLft(){
 168      if(MenuCentered!='left'&&MenuCentered!='justify'){
 169          var Size=FrstWinWdth-(!Nav4?parseInt(FrstCntnr.style.width):FrstCntnr.clip.width);
 170          StartLeft=M_StrtLft;
 171          StartLeft+=MenuCentered=='right'?Size:Size/2}}
 172  
 173  function ClcTp(){
 174      if(MenuVerticalCentered!='top'&&MenuVerticalCentered!='static'){
 175          var Size=FrstWinHght-(!Nav4?parseInt(FrstCntnr.style.height):FrstCntnr.clip.height);
 176          StartTop=M_StrtTp;
 177          StartTop+=MenuVerticalCentered=='bottom'?Size:Size/2}}
 178  
 179  function PosMenu(CntnrPntr,Tp,Lt){
 180      var Topi,Lefti,Hori;
 181      var Cntnr=CntnrPntr;
 182      var Mmbr=Cntnr.FrstMbr;
 183      var CntnrStyle=!Nav4?Cntnr.style:Cntnr;
 184      var MmbrStyle=!Nav4?Mmbr.style:Mmbr;
 185      var PadL=Mmbr.value.indexOf('<')==-1?LftXtra:0;
 186      var PadT=Mmbr.value.indexOf('<')==-1?TpXtra:0;
 187      var MmbrWt=!Nav4?parseInt(MmbrStyle.width)+PadL:MmbrStyle.clip.width;
 188      var MmbrHt=!Nav4?parseInt(MmbrStyle.height)+PadT:MmbrStyle.clip.height;
 189      var CntnrWt=!Nav4?parseInt(CntnrStyle.width):CntnrStyle.clip.width;
 190      var CntnrHt=!Nav4?parseInt(CntnrStyle.height):CntnrStyle.clip.height;
 191      var SubTp,SubLt;
 192      RcrsLvl++;
 193      if (RcrsLvl==1 && AcrssFrms)!MenuFramesVertical?Tp=FrstWinHght-CntnrHt+(Nav4?4:0):Lt=RightToLeft?0:FrstWinWdth-CntnrWt+(Nav4?4:0);
 194      if (RcrsLvl==2 && AcrssFrms)!MenuFramesVertical?Tp=0:Lt=RightToLeft?ScWinWdth-CntnrWt:0;
 195      if (RcrsLvl==2 && AcrssFrms){Tp+=VerCorrect;Lt+=HorCorrect}
 196      CntnrStyle.top=RcrsLvl==1?Tp:0;
 197      Cntnr.OrgTop=Tp;
 198      CntnrStyle.left=RcrsLvl==1?Lt:0;
 199      Cntnr.OrgLeft=Lt;
 200      if (RcrsLvl==1 && FirstLineHorizontal){
 201          Hori=1;Lefti=CntnrWt-MmbrWt-2*BorderWidth;Topi=0}
 202      else{    Hori=Lefti=0;Topi=CntnrHt-MmbrHt-2*BorderWidth}
 203      while(Mmbr!=null){
 204          MmbrStyle.left=Lefti+BorderWidth;
 205          MmbrStyle.top=Topi+BorderWidth;
 206          if(Nav4)Mmbr.CmdLyr.moveTo(Lefti+BorderWidth,Topi+BorderWidth);
 207          if(Mmbr.ChildCntnr){
 208              if(RightToLeft)ChldCntnrWdth=Nav4?Mmbr.ChildCntnr.clip.width:parseInt(Mmbr.ChildCntnr.style.width);
 209              if(Hori){    SubTp=Topi+MmbrHt+2*BorderWidth;
 210                  SubLt=RightToLeft?Lefti+MmbrWt-ChldCntnrWdth:Lefti}
 211              else{    SubLt=RightToLeft?Lefti-ChldCntnrWdth+ChildOverlap*MmbrWt+BorderWidth:Lefti+(1-ChildOverlap)*MmbrWt+BorderWidth;
 212                  SubTp=RcrsLvl==1&&AcrssFrms?Topi:Topi+ChildVerticalOverlap*MmbrHt}
 213              PosMenu(Mmbr.ChildCntnr,SubTp,SubLt)}
 214          Mmbr=Mmbr.PrvMbr;
 215          if(Mmbr){    MmbrStyle=!Nav4?Mmbr.style:Mmbr;
 216              PadL=Mmbr.value.indexOf('<')==-1?LftXtra:0;
 217              PadT=Mmbr.value.indexOf('<')==-1?TpXtra:0;
 218              MmbrWt=!Nav4?parseInt(MmbrStyle.width)+PadL:MmbrStyle.clip.width;
 219              MmbrHt=!Nav4?parseInt(MmbrStyle.height)+PadT:MmbrStyle.clip.height;
 220              Hori?Lefti-=BorderBtwnElmnts?(MmbrWt+BorderWidth):(MmbrWt):Topi-=BorderBtwnElmnts?(MmbrHt+BorderWidth):(MmbrHt)}}
 221      RcrsLvl--}
 222  
 223  function Initiate(){
 224      if(IniFlg){    Init(FrstCntnr);IniFlg=0;
 225          if(ShwFlg)AfterCloseAll();ShwFlg=0}}
 226  
 227  function Init(CntnrPntr){
 228      var Mmbr=CntnrPntr.FrstMbr;
 229      var MCStyle=Nav4?CntnrPntr:CntnrPntr.style;
 230      RcrsLvl++;
 231      MCStyle.visibility=RcrsLvl==1?M_Show:M_Hide;
 232      while(Mmbr!=null){
 233          if(Mmbr.Hilite){Mmbr.Hilite=0;if(KeepHilite)LowItem(Mmbr)}
 234          if(Mmbr.ChildCntnr) Init(Mmbr.ChildCntnr);
 235          Mmbr=Mmbr.PrvMbr}
 236      RcrsLvl--}
 237  
 238  function ClearAllChilds(Pntr){
 239      var CPCCStyle;
 240      while (Pntr){
 241          if(Pntr.Hilite){
 242              Pntr.Hilite=0;
 243              if(KeepHilite)LowItem(Pntr);
 244              if(Pntr.ChildCntnr){
 245                  CPCCStyle=Nav4?Pntr.ChildCntnr:Pntr.ChildCntnr.style;
 246                  CPCCStyle.visibility=M_Hide;
 247                  ClearAllChilds(Pntr.ChildCntnr.FrstMbr)}
 248              break}
 249          Pntr=Pntr.PrvMbr}}
 250  
 251  function GoTo(){
 252      if(this.LinkTxt){
 253          status='';
 254          var HP=Nav4?this.LowLyr:this;
 255          LowItem(HP);
 256          this.LinkTxt.indexOf('javascript:')!=-1?eval(this.LinkTxt):DcLoc.location.href=this.LinkTxt}}
 257  
 258  function HiliteItem(P){
 259      if(Nav4){
 260          if(P.ro)P.document.images[P.rid].src=P.ri2;
 261          else{    if(P.HiBck)P.bgColor=P.HiBck;
 262              if(P.value.indexOf('<img')==-1){
 263                  P.document.write(P.Ovalue);
 264                  P.document.close()}}}
 265      else{    if(P.ro){    var Lc=P.Level==1?FrstLoc:ScLoc;
 266              Lc.document.images[P.rid].src=P.ri2}
 267          else{    if(P.HiBck)P.style.backgroundColor=P.HiBck;
 268              if(P.HiFntClr)P.style.color=P.HiFntClr}}
 269      P.Hilite=1}
 270  
 271  function LowItem(P){
 272      if(P.ro){    if(Nav4)P.document.images[P.rid].src=P.ri1;
 273          else{    var Lc=P.Level==1?FrstLoc:ScLoc;
 274              Lc.document.images[P.rid].src=P.ri1}}
 275      else{    if(Nav4){    if(P.LoBck)P.bgColor=P.LoBck;
 276              if(P.value.indexOf('<img')==-1){
 277                  P.document.write(P.value);
 278                  P.document.close()}}
 279          else{    if(P.LoBck)P.style.backgroundColor=P.LoBck;
 280              if(P.LwFntClr)P.style.color=P.LwFntClr}}}
 281  
 282  function OpenMenu(){    
 283      if(!Loadd||!Creatd) return;
 284      var TpScrlld=ExpYes?ScLoc.document.body.scrollTop:ScLoc.pageYOffset;
 285      var LScrlld=ExpYes?ScLoc.document.body.scrollLeft:ScLoc.pageXOffset;
 286      var CCnt=Nav4?this.LowLyr.ChildCntnr:this.ChildCntnr;
 287      var ThisHt=Nav4?this.clip.height:parseInt(this.style.height);
 288      var ThisWt=Nav4?this.clip.width:parseInt(this.style.width);
 289      var ThisLft=AcrssFrms&&this.Level==1&&!FirstLineHorizontal?0:Nav4?this.Container.left:parseInt(this.Container.style.left);
 290      var ThisTp=AcrssFrms&&this.Level==1&&FirstLineHorizontal?0:Nav4?this.Container.top:parseInt(this.Container.style.top);
 291      var HP=Nav4?this.LowLyr:this;
 292      CurrntOvr=this;
 293      IniFlg=0;
 294      ClearAllChilds(this.Container.FrstMbr);
 295      HiliteItem(HP);
 296      if(CCnt!=null){
 297          if(!ShwFlg){ShwFlg=1;    BeforeFirstOpen()}
 298          var CCW=Nav4?this.LowLyr.ChildCntnr.clip.width:parseInt(this.ChildCntnr.style.width);
 299          var CCH=Nav4?this.LowLyr.ChildCntnr.clip.height:parseInt(this.ChildCntnr.style.height);
 300          var ChCntTL=Nav4?this.LowLyr.ChildCntnr:this.ChildCntnr.style;
 301          var SubLt=AcrssFrms&&this.Level==1?CCnt.OrgLeft+ThisLft+LScrlld:CCnt.OrgLeft+ThisLft;
 302          var SubTp=AcrssFrms&&this.Level==1?CCnt.OrgTop+ThisTp+TpScrlld:CCnt.OrgTop+ThisTp;
 303          if(MenuWrap){
 304              if(RightToLeft){
 305                  if(SubLt<LScrlld)SubLt=this.Level==1?LScrlld:SubLt+(CCW+(1-2*ChildOverlap)*ThisWt);
 306                  if(SubLt+CCW>ScWinWdth+LScrlld)SubLt=ScWinWdth+LScrlld-CCW}
 307              else{    if(SubLt+CCW>ScWinWdth+LScrlld)SubLt=this.Level==1?ScWinWdth+LScrlld-CCW:SubLt-(CCW+(1-2*ChildOverlap)*ThisWt);
 308                  if(SubLt<LScrlld)SubLt=LScrlld}
 309              if(SubTp+CCH>TpScrlld+ScWinHght)SubTp=this.Level==1?SubTp=TpScrlld+ScWinHght-CCH:SubTp-CCH+(1-2*ChildVerticalOverlap)*ThisHt;
 310              if(SubTp<TpScrlld)SubTp=TpScrlld}
 311          ChCntTL.top=SubTp;ChCntTL.left=SubLt;ChCntTL.visibility=M_Show}
 312      status=this.LinkTxt}
 313  
 314  function OpenMenuClick(){
 315      if(!Loadd||!Creatd) return;
 316      var HP=Nav4?this.LowLyr:this;
 317      CurrntOvr=this;
 318      IniFlg=0;
 319      ClearAllChilds(this.Container.FrstMbr);
 320      HiliteItem(HP);
 321      status=this.LinkTxt}
 322  
 323  function CloseMenu(){
 324      if(!Loadd||!Creatd) return;
 325      if(!KeepHilite){
 326          var HP=Nav4?this.LowLyr:this;
 327          LowItem(HP)}
 328      status='';
 329      if(this==CurrntOvr){
 330          IniFlg=1;
 331          if(CloseTmr)clearTimeout(CloseTmr);
 332          CloseTmr=setTimeout('Initiate(CurrntOvr)',DissapearDelay)}}
 333  
 334  function CntnrSetUp(Wdth,Hght,NoOff){
 335      var x=RcrsLvl==1?BorderColor:BorderSubColor;
 336      this.FrstMbr=null;
 337      this.OrgLeft=this.OrgTop=0;
 338      if(x)this.bgColor=x;
 339      if(Nav4){    this.visibility='hide';
 340          this.resizeTo(Wdth,Hght)}
 341      else{    if(x)this.style.backgroundColor=x;
 342          this.style.width=Wdth;
 343          this.style.height=Hght;
 344          this.style.fontFamily=FontFamily;
 345          this.style.fontWeight=FontBold?'bold':'normal';
 346          this.style.fontStyle=FontItalic?'italic':'normal';
 347          this.style.fontSize=FontSize+'pt';
 348          this.style.zIndex=RcrsLvl+Ztop}}
 349  
 350  function MbrSetUp(MmbrCntnr,PrMmbr,WhatMenu,Wdth,Hght){
 351      var Location=RcrsLvl==1?FrstLoc:ScLoc;
 352      var MemVal=eval(WhatMenu+'[0]');
 353      var t,T,L,W,H,S;
 354      var a,b,c,d;
 355      this.PrvMbr=PrMmbr;
 356      this.Level=RcrsLvl;
 357      this.LinkTxt=eval(WhatMenu+'[1]');
 358      this.Container=MmbrCntnr;
 359      this.ChildCntnr=null;
 360      this.Hilite=0;
 361      this.style.overflow='hidden';
 362      this.style.cursor=ExpYes&&(this.LinkTxt||(RcrsLvl==1&&UnfoldsOnClick))?'hand':'default';
 363      this.ro=0;
 364      if(MemVal.indexOf('rollover')!=-1){
 365          this.ro=1;
 366          this.ri1=MemVal.substring(MemVal.indexOf(':')+1,MemVal.lastIndexOf(':'));
 367          this.ri2=MemVal.substring(MemVal.lastIndexOf(':')+1,MemVal.length);
 368          this.rid=WhatMenu+'i';MemVal="<img src='"+this.ri1+"' name='"+this.rid+"'>"}
 369      this.value=MemVal;
 370      if(RcrsLvl==1){
 371          a=LowBgColor;
 372          b=HighBgColor;
 373          c=FontLowColor;
 374          d=FontHighColor}
 375      else{    a=LowSubBgColor;
 376          b=HighSubBgColor;
 377          c=FontSubLowColor;
 378          d=FontSubHighColor}
 379      this.LoBck=a;
 380      this.LwFntClr=c;
 381      this.HiBck=b;
 382      this.HiFntClr=d;
 383      this.style.color=this.LwFntClr;
 384      if(this.LoBck)this.style.backgroundColor=this.LoBck;
 385      this.style.textAlign=MenuTextCentered;
 386      if(eval(WhatMenu+'[2]'))this.style.backgroundImage="url(\'"+eval(WhatMenu+'[2]')+"\')";
 387      if(MemVal.indexOf('<')==-1){
 388          this.style.width=Wdth-LftXtra;
 389          this.style.height=Hght-TpXtra;
 390          this.style.paddingLeft=LeftPaddng;
 391          this.style.paddingTop=TopPaddng}
 392      else{    this.style.width=Wdth;
 393          this.style.height=Hght}
 394      if(MemVal.indexOf('<')==-1&&DomYes){
 395          t=Location.document.createTextNode(MemVal);
 396          this.appendChild(t)}
 397      else this.innerHTML=MemVal;
 398      if(eval(WhatMenu+'[3]')&&ShowArrow){
 399          a=RcrsLvl==1&&FirstLineHorizontal?3:RightToLeft?6:0;
 400          S=Arrws[a];
 401          W=Arrws[a+1];
 402          H=Arrws[a+2];
 403          T=RcrsLvl==1&&FirstLineHorizontal?Hght-H-2:(Hght-H)/2;
 404          L=RightToLeft?2:Wdth-W-2;
 405          if(DomYes){
 406  
 407              t=Location.document.createElement('img');
 408              this.appendChild(t);
 409              t.style.position='absolute';
 410              t.src=S;
 411  
 412              t.style.width=W;
 413              t.style.height=H;
 414              t.style.top=T;
 415              t.style.left=L}
 416          else{    MemVal+="<div style='position:absolute; top:"+T+"; left:"+L+"; width:"+W+"; height:"+H+";visibility:inherit'><img src='"+S+"'></div>";
 417              this.innerHTML=MemVal}}
 418      if(ExpYes){this.onselectstart=CnclSlct;
 419          this.onmouseover=RcrsLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;
 420          this.onmouseout=CloseMenu;
 421          this.onclick=RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?OpenMenu:GoTo    }
 422      else{    RcrsLvl==1&&UnfoldsOnClick?this.addEventListener('mouseover',OpenMenuClick,false):this.addEventListener('mouseover',OpenMenu,false);
 423          this.addEventListener('mouseout',CloseMenu,false);
 424          RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?this.addEventListener('click',OpenMenu,false):this.addEventListener('click',GoTo,false)}}
 425  
 426  function NavMbrSetUp(MmbrCntnr,PrMmbr,WhatMenu,Wdth,Hght){
 427      var a,b,c,d;
 428      if(RcrsLvl==1){
 429          a=LowBgColor;
 430          b=HighBgColor;
 431          c=FontLowColor;
 432          d=FontHighColor}
 433      else {    a=LowSubBgColor;
 434          b=HighSubBgColor;
 435          c=FontSubLowColor;
 436          d=FontSubHighColor    }
 437      this.value=eval(WhatMenu+'[0]');
 438      this.ro=0;
 439      if(this.value.indexOf('rollover')!=-1){
 440          this.ro=1;
 441          this.ri1=this.value.substring(this.value.indexOf(':')+1,this.value.lastIndexOf(':'));
 442          this.ri2=this.value.substring(this.value.lastIndexOf(':')+1,this.value.length);
 443          this.rid=WhatMenu+'i';this.value="<img src='"+this.ri1+"' name='"+this.rid+"'>"}
 444      if(LeftPaddng&&this.value.indexOf('<')==-1&&MenuTextCentered=='left')this.value='&nbsp\;'+this.value;
 445      if(FontBold)this.value=this.value.bold();
 446      if(FontItalic)this.value=this.value.italics();
 447      this.Ovalue=this.value;
 448      this.value=this.value.fontcolor(c);
 449      this.Ovalue=this.Ovalue.fontcolor(d);
 450      this.value=CntrTxt+"<font face='"+FontFamily+"' point-size='"+FontSize+"'>"+this.value+TxtClose;
 451      this.Ovalue=CntrTxt+"<font face='"+FontFamily+"' point-size='"+FontSize+"'>"+this.Ovalue+TxtClose;
 452      this.LoBck=a;
 453      this.HiBck=b;
 454      this.ChildCntnr=null;
 455      this.PrvMbr=PrMmbr;
 456      this.Hilite=0;
 457      this.visibility='inherit';
 458      if(this.LoBck)this.bgColor=this.LoBck;
 459      this.resizeTo(Wdth,Hght);
 460      if(!AcrssFrms&&eval(WhatMenu+'[2]'))this.background.src=eval(WhatMenu+'[2]');
 461      this.document.write(this.value);
 462      this.document.close();
 463      this.CmdLyr=new Layer(Wdth,MmbrCntnr);
 464      this.CmdLyr.Level=RcrsLvl;
 465      this.CmdLyr.LinkTxt=eval(WhatMenu+'[1]');
 466      this.CmdLyr.visibility='inherit';
 467      this.CmdLyr.onmouseover=RcrsLvl==1&&UnfoldsOnClick?OpenMenuClick:OpenMenu;
 468      this.CmdLyr.onmouseout=CloseMenu;
 469      this.CmdLyr.captureEvents(Event.MOUSEUP);
 470      this.CmdLyr.onmouseup=RcrsLvl==1&&UnfoldsOnClick&&eval(WhatMenu+'[3]')?OpenMenu:GoTo;
 471      this.CmdLyr.LowLyr=this;
 472      this.CmdLyr.resizeTo(Wdth,Hght);
 473      this.CmdLyr.Container=MmbrCntnr;
 474      if(eval(WhatMenu+'[3]')&&ShowArrow){
 475          a=RcrsLvl==1&&FirstLineHorizontal?3:RightToLeft?6:0;
 476          this.CmdLyr.ImgLyr=new Layer(Arrws[a+1],this.CmdLyr);
 477          this.CmdLyr.ImgLyr.visibility='inherit';
 478          this.CmdLyr.ImgLyr.top=RcrsLvl==1&&FirstLineHorizontal?Hght-Arrws[a+2]-2:(Hght-Arrws[a+2])/2;
 479          this.CmdLyr.ImgLyr.left=RightToLeft?2:Wdth-Arrws[a+1]-2;
 480          this.CmdLyr.ImgLyr.width=Arrws[a+1];
 481          this.CmdLyr.ImgLyr.height=Arrws[a+2];
 482          ImgStr="<img src='"+Arrws[a]+"' width='"+Arrws[a+1]+"' height='"+Arrws[a+2]+"'>";
 483          this.CmdLyr.ImgLyr.document.write(ImgStr);
 484          this.CmdLyr.ImgLyr.document.close()}}
 485  
 486  function CreateMenuStructure(MName,NumberOf){
 487      RcrsLvl++;
 488      var i,NoOffSubs,Mbr,Wdth=0,Hght=0;
 489      var PrvMmbr=null;
 490      var WMnu=MName+'1';
 491      var MenuWidth=eval(WMnu+'[5]');
 492      var MenuHeight=eval(WMnu+'[4]');
 493      var Location=RcrsLvl==1?FrstLoc:ScLoc;
 494      if (RcrsLvl==1&&FirstLineHorizontal){
 495          for(i=1;i<NumberOf+1;i++){
 496              WMnu=MName+eval(i);
 497              Wdth=eval(WMnu+'[5]')?Wdth+eval(WMnu+'[5]'):Wdth+MenuWidth}
 498          Wdth=BorderBtwnElmnts?Wdth+(NumberOf+1)*BorderWidth:Wdth+2*BorderWidth;Hght=MenuHeight+2*BorderWidth}
 499      else{    for(i=1;i<NumberOf+1;i++){
 500              WMnu=MName+eval(i);
 501              Hght=eval(WMnu+'[4]')?Hght+eval(WMnu+'[4]'):Hght+MenuHeight}
 502          Hght=BorderBtwnElmnts?Hght+(NumberOf+1)*BorderWidth:Hght+2*BorderWidth;Wdth=MenuWidth+2*BorderWidth}
 503      if(DomYes){
 504          var MmbrCntnr=Location.document.createElement("div");
 505          MmbrCntnr.style.position='absolute';
 506          MmbrCntnr.style.visibility='hidden';
 507          Location.document.body.appendChild(MmbrCntnr)}
 508      else{    if(Nav4) var MmbrCntnr=new Layer(Wdth,Location)
 509          else{    WMnu+='c';
 510              Location.document.body.insertAdjacentHTML("AfterBegin","<div id='"+WMnu+"' style='visibility:hidden; position:absolute;'><\/div>");
 511              var MmbrCntnr=Location.document.all[WMnu]}}
 512      MmbrCntnr.SetUp=CntnrSetUp;
 513      MmbrCntnr.SetUp(Wdth,Hght,NumberOf);
 514      if(Exp4){    MmbrCntnr.InnerString='';
 515          for(i=1;i<NumberOf+1;i++){
 516              WMnu=MName+eval(i);
 517              MmbrCntnr.InnerString+="<div id='"+WMnu+"' style='position:absolute;'><\/div>"}
 518          MmbrCntnr.innerHTML=MmbrCntnr.InnerString}
 519      for(i=1;i<NumberOf+1;i++){
 520          WMnu=MName+eval(i);
 521          NoOffSubs=eval(WMnu+'[3]');
 522          Wdth=RcrsLvl==1&&FirstLineHorizontal?eval(WMnu+'[5]')?eval(WMnu+'[5]'):MenuWidth:MenuWidth;
 523          Hght=RcrsLvl==1&&FirstLineHorizontal?MenuHeight:eval(WMnu+'[4]')?eval(WMnu+'[4]'):MenuHeight;
 524          if(DomYes){
 525              Mbr=Location.document.createElement("div");
 526              Mbr.style.position='absolute';
 527              Mbr.style.visibility='inherit';
 528              MmbrCntnr.appendChild(Mbr)}
 529          else Mbr=Nav4?new Layer(Wdth,MmbrCntnr):Location.document.all[WMnu];
 530          Mbr.SetUp=Nav4?NavMbrSetUp:MbrSetUp;
 531          Mbr.SetUp(MmbrCntnr,PrvMmbr,WMnu,Wdth,Hght);
 532          if(NoOffSubs) Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
 533          PrvMmbr=Mbr}
 534      MmbrCntnr.FrstMbr=Mbr;
 535      RcrsLvl--;
 536      return(MmbrCntnr)}
 537  
 538  function CreateMenuStructureAgain(MName,NumberOf){
 539      var i,WMnu,NoOffSubs,PrvMmbr,Mbr=FrstCntnr.FrstMbr;
 540      RcrsLvl++;
 541      for(i=NumberOf;i>0;i--){
 542          WMnu=MName+eval(i);
 543          NoOffSubs=eval(WMnu+'[3]');
 544          PrvMmbr=Mbr;
 545          if(NoOffSubs)Mbr.ChildCntnr=CreateMenuStructure(WMnu+'_',NoOffSubs);
 546          Mbr=Mbr.PrvMbr}
 547      RcrsLvl--}


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7