Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 16th, 2004, 08:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 26
Help change code to fit my needs

I am panning on using the below code on a website I am making, however I need for the code to fit into where I want the images assosated with the code to be placed where the javascript is located in my HTML file. Thanks for anyhelp you can give me.

Below is the HTML Code:

php Code:
Original - php Code
  1. <HTML>
  2. <Head>
  3. <!-- Below is the javacode for image rollover -->
  4. <SCRIPT LANGUAGE="JavaScript">
  5. home = new Image();
  6. home.src = "images/home_rollover.gif";
  7.  
  8. staff = new Image();
  9. staff.src = "images/staff_rollover.gif";
  10. </script>
  11.  
  12. <!-- Below is the code for the menu -->
  13. <script language="javascript" src="Config.js"></script>
  14. <script language="javascript" src="Menu.js"></script>
  15. </header>
  16. <Body BGCOLOR='#000000'>
  17. <CENTER>
  18. <!-- Below is the code for the toolbar -->
  19. <Table cellpadding="0" cellspacing="0" border="0">
  20. <tr>
  21. <td>
  22. <img BORDER="0"  src='images/lt_end.gif'>
  23.   </td>
  24.    <td>
  25.      <a href="index.php" onmouseover="home.src='images/home_rollover.gif';"onmouseout="home.src='images/home.gif';"><img name="home" src="images/home.gif" border=0></a>
  26.    </td>
  27.    <td>
  28.      <img BORDER="0" src='images/spacer.gif'>
  29.    </td>
  30.    <td>
  31.      <SCRIPT LANGUAGE="JavaScript">
  32.     <!-- Begin
  33.     AddMenu("1"  ,  "1"   ,  ""       ,  "images/pictures.gif"  ,  "images/pictures_rollover.gif"  , "");
  34.     AddMenu("2"  ,  "1"   ,  "Me"       ,  ""  ,  ""  , "http://www.javascriptsource.com");   
  35.     AddMenu("3"  ,  "1"   ,  "Trip to Vegas"      ,  ""  ,  ""  , "http://www.javascriptsource.com");
  36.     AddMenu("4"  ,  "1"   ,  "Star Trek"        ,  ""  ,  ""  , "http://www.javascriptsource.com");
  37.     AddMenu("5"  ,  "1"   ,  "Random Pictures"       ,  ""  ,  ""  , "http://www.javascriptsource.com");   
  38.     Build();
  39.     //  End -->
  40.     </script>
  41.    </td>
  42.    <td>
  43.      <img BORDER="0" src='images/middle.gif'>
  44.    </td>
  45.    <td>
  46.      <a href="staff/" onmouseover="staff.src='images/staff_rollover.gif';"onmouseout="staff.src='images/staff.gif';"><img name="staff" src="images/staff.gif" border=0></a>
  47.    </td>
  48.    <td>
  49.      <img BORDER="0" src='images/rt_end.gif'>
  50.    </td>
  51.  </tr>
  52. </Table>
  53. </Center>
  54. </Body>
  55. </HTML>


here is the Config.js
php Code:
Original - php Code
  1. //Author: Younes Bouab
  2. //Date:   05-02-02
  3. //Title:  Menu Configuration: Config.js
  4. //
  5. //Copyright: Younes Bouab 2001
  6. //Technical Support: bouaby@SUPEReDITION.com
  7. //
  8. /////////////////////////////////////////////////////////////////////////////////////
  9. //Copyright (c) 2002 Younes Bouab (www.SUPEReDITION.com) Version 1.0
  10. //
  11. //Eperience the DHTML Menu - Get it at www.SUPEReDITION.com
  12. //
  13. //This script can be used freely as long as all copyright messages are intact.
  14. //
  15. //Menu HomePage: http://www.superedition.com/Main.asp?Page=Tutorials&query=Javascript
  16. //////////////////////////////////////////////////////////////////////////////////////
  17. //Menu Configuration File
  18. /////////////////////////////////////////////////
  19. /////You can change the value of a variable
  20. /////below or turn it off by making it equal ""
  21. /////to suit your needs, but you should not
  22. /////delete any variable.
  23. ///////////////////////////////////////////////
  24. /**********************************************/
  25. //Menu Type: Do Not Change!
  26. /**********************************************/
  27. MENU_TYPE=1; //1: Horizental
  28.              //2: Vertical
  29.  
  30. Sort=0;   //Sort: When set to 1, the
  31.           //menu items are sorted according
  32.           //to the index value. This feature
  33.           //can be used when a server side
  34.           //language (asp. jsp. php,...)
  35.           //is used to generate the menu items
  36.           //from a database and they are not always
  37.           //in order. 
  38.  
  39.  
  40.  
  41. /**********************************************/
  42. //Menu Starting point
  43. /**********************************************/
  44. TOP=50;
  45. LEFT=50;
  46.  
  47.  
  48. /**********************************************/
  49. //Menu item Dimension
  50. /**********************************************/
  51. WIDTH=69;
  52. HEIGHT=30;
  53.  
  54.  
  55. /**********************************************/
  56. //Layers Alignment
  57. /**********************************************/
  58. HALIGN="LEFT";
  59. VALIGN="MIDDLE";
  60.  
  61.  
  62. /**********************************************/
  63. //Global Menu Settings for all
  64. /**********************************************/
  65. //Main Menu Items
  66. LayerColor="#FFFFFF";
  67. LayerRollColor="#CCCCCC";
  68. FONT="verdana";
  69. FONTSIZE="1";
  70. FONTSTYLE="" // "": Normal, "B": Bold, "I": Italic
  71. FONTCOLOR="#000033";
  72. ROLL_FONTCOLOR="#000000";
  73. START_CHAR="-"; //Starting Character
  74.  
  75.  
  76. /**********************************************/
  77. //Main Parent Settings: Optional
  78. // leave empty "", if you would like to use
  79. // the Global Menu Settings above
  80. /**********************************************/
  81. Main_Parent_LayerColor="";
  82. Main_Parent_LayerRollColor="";
  83. Main_Parent_FONT="verdana";
  84. Main_Parent_FONTSTYLE="";
  85. Main_Parent_FONTSIZE="";
  86. Main_Parent_FONTCOLOR="";
  87. Main_Parent_ROLL_FONTCOLOR="";
  88. Main_Parent_START_CHAR="";
  89.  
  90.  
  91. /**********************************************/
  92. //Layer Border Properties
  93. /**********************************************/
  94. LayerBorderSize="1";
  95. LayerBorderStyle="solid";
  96. LayerBorderColor="#000000";
  97.  
  98.  
  99. /**********************************************/
  100. //Menu Children Offsets
  101. /**********************************************/
  102. TOP_OFFSET=0;
  103. LEFT_OFFSET=0;


and here is Menu.js

php Code:
Original - php Code
  1. //Author: Younes Bouab
  2. //Date:   03-05-01
  3. //Title:  Menu Generator: Menu.js
  4. //Copyright: Younes Bouab 2001
  5. //Technical Support: bouaby@SUPEReDITION.com
  6. ////////////////////////////////////////////
  7. ////////////////////////////////////////////
  8. //DO NOT CHANGE ANYTHING IN THIS FILE!
  9. //"Config.js" is the file you can edit
  10. ////////////////////////////////////////////
  11.  
  12. /*******************************************/
  13. //Dreamweaver Show/Hide/Obj Layer functions
  14. /*******************************************/
  15. function showHideLayers() {
  16.   var i,p,v,obj,args=showHideLayers.arguments;
  17.   for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
  18.     if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
  19.     obj.visibility=v; }
  20. }
  21. function findObj(n, d) {
  22.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  23.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  24.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  25.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  26.   if(!x && document.getElementById) x=document.getElementById(n); return x;
  27. }
  28. function changeProp(objName,x,theProp,theValue) {
  29.   var obj = findObj(objName);
  30.   if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
  31. }
  32.  
  33. function reloadPage(init) {
  34.   if (init==true) with (navigator)
  35.   {
  36.     if ((appName=="Netscape")&&(parseInt(appVersion)==4))
  37.     {
  38.       document.pgW=innerWidth;
  39.       document.pgH=innerHeight;
  40.       onresize=reloadPage;
  41.     }
  42.   }
  43.   else if (innerWidth!=document.pgW || innerHeight!=document.pgH) {location.reload();}
  44. }
  45. reloadPage(true);
  46.  
  47. /******************************************/
  48. // Initialize
  49. /******************************************/
  50. //Menu Array
  51. Menu =new Array(); //Menu[x][0]=INDEX - Menu[x][1]=PARENT - Menu[x][2]=Text - Menu[x][3]=Image - Menu[x][4]=Roll Image - Menu[x][5]=URL
  52. var i=0;
  53. var ii=0; //used in validation of Menu Array
  54. var MaxMenuIndex=0;
  55.  
  56. //Default Layer Frame for IE and NS6.X
  57. var Layer=""<div id='"+IDLABEL+"' class='CBORDER' Style='Position:absolute; visibility:"+VISIBILITY+"; left:"+(LEFT+NS6X)+"px; top:"+(TOP+NS6X)+"px; width:"+(WIDTH+NS6X)+"px; height:"+(HEIGHT+NS6X)+"px; background-color:"+MyLayerColor+"; z-index:"+ZINDEX+"; URL("+MyURL+")' "";
  58. var Layer_End="</div>";
  59.  
  60. LAYER= new Array();//Menu string FOR EACH ITEM
  61. MOUSEOVEROUT=new Array();//HOLDS THE LAYERIDs that should have OnMouseOver && OnMouseOut for each menu
  62. TOPLEFT=new Array(); //holds Top and left measures for each menu item
  63. Parent_Children_ID=new Array();
  64.  
  65. //Layers Variables
  66. var IDLABEL="";
  67. var VISIBILITY="visible"; //default
  68. var ZINDEX=0;
  69. var MyURL="";
  70.  
  71. //Position function variables
  72. var TopParent=TOP;
  73. var LeftParent=LEFT;
  74. var ORGWIDTH=WIDTH;
  75. Parent_Child_Count=new Array(); //Counts the children of each Main Menu
  76. var Main_Parent_Count=0; //Counts the number of the Main menu
  77.  
  78. //Validation Variable
  79. Error=false;
  80. SortingError=false;
  81.  
  82. //NS CORRECTIONS
  83. var NS_Table_Width_Corr=0;
  84. var NS_Table_Heigth_Corr=0;
  85. var NS6X=0; if(!document.all && document.getElementById) {NS6X=-2;}
  86.  
  87.  
  88. /******************************************/
  89. //Add Menu item to Menu Array
  90. /******************************************/
  91. function AddMenu(ID, Parent_ID, Text, Image, RollImage, URL)
  92. {
  93.   //Validation
  94.   var valid = "0123456789";
  95.   var temp;
  96.   if(ID.length==0) {alert("The Menu #"+(ii+1)+" does not have an ID assigned"); Error=true;}
  97.   //check if ID is composed
  98.   else
  99.   {
  100.     //Checking if number
  101.     for(var j=0;j<ID.length;j++)
  102.     {
  103.       temp=ID.substring(j,j+1);
  104.       if(valid.indexOf(temp)==-1) {alert("The ID of the Menu #"+(ii+1)+" should be a number value"); Error=true;}
  105.     }
  106.   }
  107.   if(Parent_ID.length==0) {alert("The Menu #"+(ii+1)+" does not have a Parent_ID assigned"); Error=true;}
  108.   //check if Parent_ID is composed of only numbers and dashes "-"
  109.   else
  110.   {
  111.     //Checking if number
  112.     for(var j=0;j<Parent_ID.length;j++)
  113.     {
  114.       temp=Parent_ID.substring(j,j+1);
  115.       if(valid.indexOf(temp)==-1) {alert("The Parent_ID of the Menu #"+(ii+1)+" should be a number value"); Error=true;}
  116.     }
  117.   }
  118.   if(Text.length==0 && Image.length==0) {alert("The Menu #"+(ii+1)+" should have either an image or a text assigned"); Error=true;}
  119.   ii++;
  120.    
  121.   Menu[i] = new Array();   
  122.   if(!Error)
  123.   {
  124.      for (var j=0; j < 6 ;j++)
  125.      {         
  126.         if (j==0) { Menu[i][0]=ID;      }
  127.         if (j==1) { Menu[i][1]=Parent_ID;     }
  128.         if (j==2) { Menu[i][2]=Text;       }
  129.         if (j==3) { Menu[i][3]=Image;      }
  130.         if (j==4) { Menu[i][4]=RollImage;  }
  131.         if (j==5) { Menu[i][5]=URL;        }
  132.      }
  133.      i++;
  134.      MaxMenuIndex = i;
  135.   } 
  136.   //Reinitialze Error Value
  137.   Error=false;
  138. }
  139.  
  140. /******************************************/
  141. //Build Menus
  142. /******************************************/
  143. function Build()
  144. {
  145.     //Browser Check
  146.     NS4XCorrection()
  147.    
  148.     //Initilize Position Variables
  149.     for (var j=0;j<MaxMenuIndex;j++)
  150.     {
  151.       TOPLEFT[j]=new Array();
  152.       Parent_Child_Count[j]=0;
  153.       MOUSEOVEROUT[j]=new Array();
  154.       Parent_Children_ID[j]=new Array()
  155.       TOPLEFT[j][0]=0;
  156.       TOPLEFT[j][1]=0;
  157.     }   
  158.  
  159.    //Sort and check menu for errors
  160.    if(Sort==1) {Sorting();}
  161.  
  162.    if(!SortingError)
  163.    { 
  164.    
  165.     //Build CSS: Layer Border
  166.     if (LayerBorderSize!="")
  167.     {document.writeln("<Style type="text/css">");
  168.      document.writeln(".CBORDER {");
  169.      document.writeln(" width:"+WIDTH+"px;");
  170.      document.writeln(" heigth:"+HEIGHT+"px;")
  171.      document.writeln(" border: "+LayerBorderStyle+" "+LayerBorderColor+" "+LayerBorderSize+"px;");
  172.      document.writeln("}n</style>n");
  173.     }
  174.          
  175.    //Build each Menu
  176.    for (i=0; i < MaxMenuIndex;i++)
  177.    {
  178.      //Calculates Main Positions, visibility, and determines ID
  179.      CalcLayerVariables(i);
  180.  
  181.      //Global Properties
  182.      var MyLayerColor=LayerColor;
  183.      var MyLayerRollColor=LayerRollColor;
  184.      //Parent Color
  185.      if(Menu[i][0]==Menu[i][1])
  186.      {
  187.         //BG ROLL Color
  188.         if (Main_Parent_LayerColor!="" )
  189.         {
  190.             MyLayerColor=Main_Parent_LayerColor;
  191.         }           
  192.      }     
  193.      //Layer Code 
  194.      LAYER[i]=eval(Layer);           
  195.    }
  196.  
  197.    //Add samelevel mouse events
  198.    SameLevelMouseEvents();
  199.  
  200.    //Build
  201.    for (var j=0;j<MaxMenuIndex;j++)
  202.    {
  203.      var MyFONT=FONT;
  204.      var MyFONTCOLOR=FONTCOLOR;
  205.      var MyFONTSIZE=FONTSIZE;
  206.      var MyFONTSTYLE=FONTSTYLE;
  207.      var MySTARTCHAR=START_CHAR;
  208.  
  209.      //Parent/Children FONT Properties
  210.      if(Menu[j][0]==Menu[j][1])
  211.      {   
  212.         if(Main_Parent_FONT!="")
  213.         {
  214.             MyFONT=Main_Parent_FONT;
  215.         } 
  216.         if(Main_Parent_FONTCOLOR!="")
  217.         {
  218.             MyFONTCOLOR=Main_Parent_FONTCOLOR;
  219.         } 
  220.         if(Main_Parent_FONTSIZE!="")
  221.         {
  222.             MyFONTSIZE=Main_Parent_FONTSIZE;
  223.         }   
  224.         if(Main_Parent_FONTSTYLE!="")
  225.         {
  226.             MyFONTSTYLE=Main_Parent_FONTSTYLE;
  227.         } 
  228.         if(Main_Parent_START_CHAR!="")
  229.         {
  230.             MySTARTCHAR=Main_Parent_START_CHAR;
  231.         }       
  232.      } 
  233.  
  234.  
  235.      var MOUSEOVERCODE="";
  236.      var MOUSEOUTCODE="";
  237.      for (var jj=0;jj<MaxMenuIndex;jj++)
  238.      {
  239.        if(MOUSEOVEROUT[j][jj]!=null)
  240.        {
  241.           MOUSEOVERCODE=MOUSEOVERCODE+"showHideLayers('"+MOUSEOVEROUT[j][jj]+"','','show');";
  242.           MOUSEOUTCODE=MOUSEOUTCODE+"showHideLayers('"+MOUSEOVEROUT[j][jj]+"','','hide');";
  243.        }
  244.        else
  245.        {
  246.           MOUSEOVERCODE=MOUSEOVERCODE+"PathRoad("+j+",1)";           
  247.           MOUSEOUTCODE=MOUSEOUTCODE+"PathRoad("+j+",0)";         
  248.           break;
  249.        }
  250.      }
  251.  
  252.      //Linking the entire layer area
  253.      document.write(LAYER[j]+" onMouseOver=""+MOUSEOVERCODE+"" onMouseOut=""+MOUSEOUTCODE+""");
  254.      if(Menu[j][5]!="") //{document.write(" class="location.href='"+Menu[j][5]+"';"");}
  255.      {document.write(" onClick="location.href='"+Menu[j][5]+"';"");}
  256.      document.write(" >");     
  257.      
  258.      var LINK="";     
  259.      //display link if any and setup rollover image if any
  260.      if(Menu[j][5]!="")
  261.      {   
  262.         LINK="<A href=""+Menu[j][5]+"">";
  263.      }
  264.      
  265.      //Image Code
  266.      var ImageCode="";
  267.      if(Menu[j][3]!="")
  268.      {
  269.        ImageCode=ImageCode+"<IMG Name='Image"+Menu[j][0]+"' SRC='"+Menu[j][3]+"' BORDER=0>"
  270.      }
  271.      
  272.      //Fonts if any
  273.      var FONT_PROPERTIES=""
  274.      if(MyFONT!="")     {FONT_PROPERTIES=" Type='"+MyFONT+"'";}
  275.      if(MyFONTSIZE!="") {FONT_PROPERTIES=FONT_PROPERTIES+" size='"+MyFONTSIZE+"'";}
  276.      if(MyFONTCOLOR!=""){FONT_PROPERTIES=FONT_PROPERTIES+" color='"+MyFONTCOLOR+"'";}
  277.      if(FONT_PROPERTIES!="" ){FONT_PROPERTIES="<FONT "+FONT_PROPERTIES+">";}
  278.      if(MyFONTSTYLE!=""){FONT_PROPERTIES="<"+MyFONTSTYLE+">"+FONT_PROPERTIES;}
  279.      
  280.  
  281.      //Display IMAGE  and TEXT
  282.      document.write("<table border='0' WIDTH='100%' height='100%' cellpadding='0' cellspacing='0'><tr>");     
  283.  
  284.      if(ImageCode!="")
  285.      {
  286.        document.write("<td ");
  287.        if(HALIGN !=""){document.write(" align='"+HALIGN+"' ");}
  288.        if(VALIGN !=""){document.write(" valign='"+VALIGN+"' ");}
  289.        document.write(">");
  290.  
  291.        if(LINK!="") {document.write(LINK);}
  292.        document.write(ImageCode);
  293.        if(LINK!=""){document.write("</a>");}
  294.        document.write("</td>");
  295.      }
  296.  
  297.      if(Menu[j][2]!="")
  298.      {
  299.        document.write("<td ");
  300.        if(HALIGN !=""){document.write("  align='"+HALIGN+"' ");}
  301.        if(VALIGN !=""){document.write(" valign='"+VALIGN+"' ");}
  302.        document.write(">");
  303.  
  304.        if(FONT_PROPERTIES!="") {document.write(FONT_PROPERTIES);}
  305.        document.write(MySTARTCHAR);
  306.        if(LINK!="") {document.write(LINK);}
  307.        document.write(Menu[j][2]);       
  308.        if(LINK!=""){document.write("</a>");}
  309.        if(FONT_PROPERTIES!="")  {document.write("</FONT>");}
  310.        if(MyFONTSTYLE!="") {document.write("</"+MyFONTSTYLE+">");}
  311.        document.write("</td>");
  312.      }
  313.      document.write("</tr></table>");
  314.  
  315.       //close layer
  316.       document.writeln(Layer_End);
  317.    }
  318.   }   
  319. }
  320. /**************************************************  *******************************/
  321. ////Sort in-case not ordered and check if every menu parent has a matching index
  322. /**************************************************  ******************************/
  323. function Sorting()
  324. {
  325.   //Place all Parents before children
  326.   for (i=0; i<(MaxMenuIndex-1);i++)
  327.   {
  328.     TheParent=Menu[i][1];   
  329.     for (j=(i+1); j<MaxMenuIndex; j++)
  330.     {
  331.        if(Menu[j][0]==TheParent)   
  332.        {             
  333.            for(var f=0;f<6;f++)
  334.            {           
  335.              temp=Menu[i][f];               
  336.              Menu[i][f]=Menu[j][f];
  337.              Menu[j][f]=temp; 
  338.            }
  339.            i=0;   
  340.            break;           
  341.        }
  342.     }
  343.   }
  344. }
  345. /******************************************/
  346. //Netscape 4.X Correction
  347. /******************************************/
  348. function NS4XCorrection()
  349. {
  350.   if(document.layers)
  351.   {
  352.    Layer=""<layer class='CBORDER' id='"+IDLABEL+"' position='absolute' visibility='"+VISIBILITY+"' left='"+LEFT+"' top='"+TOP+"' width='"+WIDTH+"' height='"+HEIGHT+"' bgcolor='"+MyLayerColor+"' z-index='"+ZINDEX+"'" ";   
  353.    Layer_End="</layer>";
  354.   }
  355.   NS_Table_Width_Corr=5;
  356.   NS_Table_Heigth_Corr=5;
  357. }
  358.  
  359. function NS4ImageCorrect(Index)
  360. {
  361.   var NS4FIX="";
  362.   if(document.layers)
  363.   {
  364.      return "layers.Layer"+Menu[Index][0]+".document.";
  365.   }
  366.   return "";
  367. } 
  368.  
  369. /******************************************/
  370. //Calculates Menu Item Position                           
  371. /******************************************/
  372. function CalcLayerVariables(Index)
  373. {
  374.        var ID= Menu[Index][0];
  375.        var Parent_ID= Menu[Index][1];
  376.  
  377.        //if Main Parent   
  378.        if (ID==Parent_ID)
  379.        {   
  380.           //Menu Type 
  381.           if(MENU_TYPE==1)
  382.           { 
  383.             TOP=TopParent;
  384.             LEFT=(Main_Parent_Count * WIDTH)+ LeftParent - (LayerBorderSize*Main_Parent_Count)
  385.           }
  386.           else
  387.           {
  388.             TOP=(Main_Parent_Count * HEIGHT)+TopParent - (LayerBorderSize*Main_Parent_Count);
  389.             LEFT=LeftParent; 
  390.           }
  391.           TOPLEFT[Index][0]=TOP;       
  392.           TOPLEFT[Index][1]=LEFT;                   
  393.           IDLABEL="Layer"+Menu[i][0];       
  394.           VISIBILITY="visible";
  395.           ZINDEX=100; //on top of the first 99 layers in the page!
  396.           WIDTH=((+ORGWIDTH)-(+LayerBorderSize));
  397.  
  398.           Main_Parent_Count++;               
  399.        }
  400.        //Child
  401.        else
  402.        { 
  403.           //Find Parent       
  404.           ChildofAParent=false;       
  405.           var ParentIndex=0;
  406.           for (var j=0;j<MaxMenuIndex;j++)
  407.           {
  408.             if (Menu[j][0]== Parent_ID)
  409.             { 
  410.                //collecting Children of Parents
  411.                for (var g=0;g<MaxMenuIndex;g++)
  412.                {
  413.                  if(Parent_Children_ID[j][g]==null)
  414.                  { Parent_Children_ID[j][g]=IDLABEL;
  415.                    break;
  416.                  }
  417.                }
  418.                if(Menu[j][0]==Menu[j][1])
  419.                {ChildofAParent=true;}
  420.                ParentIndex=j;
  421.                break;
  422.             }
  423.           }
  424.           //if child of a Main Parent and Menu Type is Horizental                       
  425.           if(ChildofAParent && MENU_TYPE==1)
  426.           {
  427.              Parent_Child_Count[ParentIndex] = Parent_Child_Count[ParentIndex] + 1;                                   
  428.              TOP=TopParent+(Parent_Child_Count[ParentIndex] * HEIGHT) - ((Parent_Child_Count[ParentIndex])*LayerBorderSize);
  429.              LEFT=TOPLEFT[ParentIndex][1];                 
  430.              ZINDEX=101; //on top of the first 100 layers in the page!                 
  431.           }
  432.           //if a child of a child 
  433.           else
  434.           {
  435.              Parent_Child_Count[ParentIndex] = Parent_Child_Count[ParentIndex] + 1;
  436.              TOP=(TOPLEFT[ParentIndex][0])+((Parent_Child_Count[ParentIndex]-1) * HEIGHT) - ((Parent_Child_Count[ParentIndex]-1)*LayerBorderSize) + TOP_OFFSET;
  437.              LEFT=(WIDTH + TOPLEFT[ParentIndex][1]) - LEFT_OFFSET - LayerBorderSize;               
  438.              if(ChildofAParent){ZINDEX=101;}else{ZINDEX=102;} //on top of the first 100 layers in the page,100 is Main Parent and 101 is Parent
  439.           }       
  440.           VISIBILITY="hidden"
  441.           IDLABEL="Layer"+Menu[Index][0];         
  442.           TOPLEFT[Index][0]=TOP;                                             
  443.           TOPLEFT[Index][1]=LEFT;
  444.           WIDTH=((+ORGWIDTH)-(+LayerBorderSize));
  445.        }   
  446. }
  447. /******************************************/
  448. //Generates onMouseOver Event for same
  449. //level layers
  450. //                           
  451. /******************************************/
  452. function SameLevelMouseEvents()
  453. {
  454.   //1 showHide Main Parent children
  455.   for(var u=0;u<MaxMenuIndex;u++)
  456.   {
  457.      //if Main Parent 
  458.      if (Menu[u][0]==Menu[u][1])
  459.      {
  460.           for(var y=0;y<MaxMenuIndex;y++)
  461.           {
  462.              //if not the one being tested and has the same parent
  463.              if(y!=u && (Menu[y][1]==Menu[u][0]))
  464.              {
  465.                for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];break;}}
  466.              }
  467.  
  468.           }
  469.       }
  470.    }
  471.    //2 show hide same Parent menu items
  472.    for(var u=0;u<MaxMenuIndex;u++)
  473.    {
  474.       if (Menu[u][1]!=Menu[u][0])
  475.       {
  476.          for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[u][0];break;}}
  477.          for(var y=0;y<MaxMenuIndex;y++)
  478.           {
  479.              //if not the one being tested and has the same parent and bot the parent menu
  480.              if(y!=u && (Menu[y][1]==Menu[u][1]) && (Menu[y][0]!=Menu[y][1]) )
  481.              {
  482.                 for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];break;}} 
  483.              }
  484.           }
  485.       }
  486.    }
  487.    //3 show hide children of non Main Parent
  488.    var same="";
  489.    for(var u=0;u<MaxMenuIndex;u++)
  490.    {
  491.        if (Menu[u][1]!=Menu[u][0])
  492.        {
  493.           for(var y=0;y<MaxMenuIndex;y++)
  494.           {
  495.              if ((Menu[u][0]==Menu[y][1]) && (Menu[y][0]!=Menu[y][1]) && y!=u)
  496.              {
  497.                 for(var z=0;z<MaxMenuIndex;z++)
  498.                 {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];same=z;break;}}                 
  499.                 //Pass Parent's show hide to the children
  500.                 for(var z=0;z<MaxMenuIndex;z++)
  501.                 {
  502.                   if(MOUSEOVEROUT[u][z]!=null)
  503.                   {
  504.                     for(var x=0;x<MaxMenuIndex;x++)
  505.                     {
  506.                       if(MOUSEOVEROUT[y][x]==null) {MOUSEOVEROUT[y][x]=MOUSEOVEROUT[u][z];break;}
  507.                     }
  508.                   }
  509.                   else {break;}
  510.                 } 
  511.              }
  512.           }
  513.        }
  514.    }   
  515.  
  516. }
  517. /******************************/
  518. //PathColor
  519. /******************************/
  520. function PathRoad(Parent,flag)
  521. {
  522.   AtStart=false;
  523.   while (!AtStart)
  524.   { 
  525.      //change both layer color and image     
  526.      if(flag==1) //Roll
  527.      {
  528.        //Layer's Image: Browser Check
  529.        if(Main_Parent_LayerRollColor!="" && Menu[Parent][0]==Menu[Parent][1]) {MyLayerRollColor=Main_Parent_LayerRollColor;} else {MyLayerRollColor=LayerRollColor;}       
  530.        if(Menu[Parent][4]!="")
  531.        {
  532.          eval("document."+NS4ImageCorrect(Parent)+"images.Image"+Menu[Parent][0]+".src='"+Menu[Parent][4]+"'");
  533.        }
  534.  
  535.        //Layer Color: Browser Check
  536.        if(document.layers)
  537.        {
  538.          eval("changeProp('Layer"+Menu[Parent][0]+"','','document.bgColor','"+MyLayerRollColor+"','LAYER')");
  539.        }
  540.        else  if(document.getElementById || document.all)
  541.        {
  542.  
  543.          eval("changeProp('Layer"+Menu[Parent][0]+"','','style.backgroundColor','"+MyLayerRollColor+"','DIV')");
  544.        }
  545.      }
  546.      else //Origin Image and Color
  547.      {
  548.        //Layer's Image: Browser Check
  549.        if(Main_Parent_LayerColor!="" && Menu[Parent][0]==Menu[Parent][1]) {MyLayerColor=Main_Parent_LayerColor;} else {MyLayerColor=LayerColor;}
  550.        if(Menu[Parent][3]!="")
  551.        {
  552.          eval("document."+NS4ImageCorrect(Parent)+"images.Image"+Menu[Parent][0]+".src='"+Menu[Parent][3]+"'");
  553.        }
  554.        //Layer Color: Browser Check 
  555.        if(document.layers){eval("changeProp('Layer"+Menu[Parent][0]+"','','document.bgColor','"+MyLayerColor+"','LAYER')");}
  556.        else if(document.getElementById || document.all){eval("changeProp('Layer"+Menu[Parent][0]+"','','style.backgroundColor','"+MyLayerColor+"','DIV')");}     
  557.      }
  558.      if(Menu[Parent][0] == Menu[Parent][1])
  559.      {
  560.        AtStart=true;
  561.      }
  562.      Parent=INDEXof(Menu[Parent][1])
  563.   }
  564. }
  565. //Find the index of the Menu Array with the Parent: Parent
  566. function INDEXof(Parent)   
  567. {
  568.  for(var j=0;j<MaxMenuIndex;j++)
  569.  {
  570.    if(Menu[j][0]==Parent)
  571.    {
  572.      return (j);
  573.    } 
  574.  }
  575. }


Thanks for anyhelp you can give me.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Help change code to fit my needs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.


© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek