SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weird error using documentGetElementById

    Whenever I click on "History" or "AI scripting" the unordered list would have to dissapear as you see from my code. But when clicking on any of them I get an error "Object expected" (line 79).

    Could anyone enlighten me ?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
        <title>WildFire Games</title>
    
        <meta http-equiv="Content-Type" content="text/html;
        charset=iso-8859-1" />
    
        <!-- <link rel="shortcut icon" href="/favicon.ico" /> -->
    
    
    
    	<script type="text/javascript">
    
    	function mirage(choice)
    	{
    		if( !document.getElementById ) return false;
    
    		var objweb_+_community_development = document.getElementById("navItemweb_+_community_development");
    var objartificial_intelligence_scripting = document.getElementById("navItemartificial_intelligence_scripting");
    var objgame_design = document.getElementById("navItemgame_design");
    var objgraphic_art = document.getElementById("navItemgraphic_art");
    var objhistory = document.getElementById("navItemhistory");
    var objprogramming = document.getElementById("navItemprogramming");
    var objrandom_map_scripting = document.getElementById("navItemrandom_map_scripting");
    var objscenario_design = document.getElementById("navItemscenario_design");
    var objsound = document.getElementById("navItemsound");
    
    		if( choice == "openweb_+_community_development" ) objweb_+_community_development.style.display = "block";
    if( choice == "openartificial_intelligence_scripting" ) objartificial_intelligence_scripting.style.display = "block";
    if( choice == "opengame_design" ) objgame_design.style.display = "block";
    if( choice == "opengraphic_art" ) objgraphic_art.style.display = "block";
    if( choice == "openhistory" ) objhistory.style.display = "block";
    if( choice == "openprogramming" ) objprogramming.style.display = "block";
    if( choice == "openrandom_map_scripting" ) objrandom_map_scripting.style.display = "block";
    if( choice == "openscenario_design" ) objscenario_design.style.display = "block";
    if( choice == "opensound" ) objsound.style.display = "block";
    
    		if( choice == "closeweb_+_community_development" ) objweb_+_community_development.style.display = "none";
    if( choice == "closeartificial_intelligence_scripting" ) objartificial_intelligence_scripting.style.display = "none";
    if( choice == "closegame_design" ) objgame_design.style.display = "none";
    if( choice == "closegraphic_art" ) objgraphic_art.style.display = "none";
    if( choice == "closehistory" ) objhistory.style.display = "none";
    if( choice == "closeprogramming" ) objprogramming.style.display = "none";
    if( choice == "closerandom_map_scripting" ) objrandom_map_scripting.style.display = "none";
    if( choice == "closescenario_design" ) objscenario_design.style.display = "none";
    if( choice == "closesound" ) objsound.style.display = "none";
    
    	}
    	</script>
    	
    </head>
    
    <body>
    <div id="topline">Wildfire Games Intranet 2.0</div>
    <div id="banner"> <a href="http://wildfiregames.com/0ad/"><img id="header_left" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_left.jpg" alt="G to Wildfire Games: Project 0.A.D Website"/></a> 
      <a href="http://wildfiregames.com/"><img id="header_right" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_right.jpg" alt="Go to Wildfire Games Website" /></a> 
      <div id="navcontainer"> 
        <ul id="navlist">
          <li><a id="taba" class="active" href="#" title="0 A.D.">0 A.D.</a></li>
          <li><a id="tabb" href="#" title="TLA">TLA</a></li>
          <li><a accesskey="6" id="tabb" href="http://localhost/wildfire_games/wfg/" title="Our friendly, vibrant and well-informed community">Forums</a></li>
        </ul>
      </div>
    </div>
    
    
    <div id="tabbar"></div>
    <div id="content"> <div id="lside">
    <h2>Welcome back</h2>
    <p><b><span style='color:#c00'>DarkAngelBGE</span></b></p>
    <p>0.A.D. Web + Community Development Department Leader</p>
    <p><b><a href="http://localhost/wildfire_games/intranet/index.php?act=logout">Logout</a></b></p>
    <h2>Departments</h2><h3><a href="#" onclick="mirage('closeweb_+_community_development')"><b><span style='color:#c00'>Web + Community Development</span></b></a></h3><ul id="navItemweb_+_community_development" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=8">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=8">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closeartificial_intelligence_scripting')">Artificial Intelligence Scripting</a></h3><ul id="navItemartificial_intelligence_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=6">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=6">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=6">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closegame_design')">Game Design</a></h3><ul id="navItemgame_design"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=1">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=1">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=1">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closegraphic_art')">Graphic Art</a></h3><ul id="navItemgraphic_art"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=7">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=7">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=7">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closehistory')">History</a></h3><ul id="navItemhistory"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=25">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=25">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=25">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closeprogramming')">Programming</a></h3><ul id="navItemprogramming"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=3">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=3">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=3">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closerandom_map_scripting')">Random Map Scripting</a></h3><ul id="navItemrandom_map_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=5">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=5">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=5">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closescenario_design')">Scenario Design</a></h3><ul id="navItemscenario_design"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=2">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=2">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=2">Memberlist</a></li></ul><h3><a href="#" onclick="mirage('closesound')">Sound</a></h3><ul id="navItemsound"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=4">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=4">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=4">Memberlist</a></li></ul></div><div>
    <div id="botleftcurve"></div>
    <div id="topleftcurve"></div>
    
    <ul class="breadcrumb" id="top_breadcrumb">
    <li><span id="sitemap"><a href="index.php?act=sitemap" title="SiteMap">Site Map</a></span></li>
    <li>&raquo;<a href="#" title="Link 1">Home</a></li>
    <li>&raquo;<a href="#" title="Link 1">Articles</a></li>
    <li>&raquo;<a href="#" title="Link 1">Wildfire Games Crier</a></li>
    <li>&raquo; Design Principles of the WFG Crier -- Page 1 <a href="#">2</a><a href="#">3</a><a href="#">4</a> 
    </ul>
    
    <div id="contentcont">          
    <h2><span>View Members - Graphic Art Department</span></h2>
    <div class="contentbar"></div><p>Total Department Members: <b>10</b></p><table><tr>
    <td width="25%"><div class="table_top_row">Name</div></td>
    <td width="25%"><div class="table_top_row">Project/Rank</div></td>
    <td width="30%"><div class="table_top_row">Department</div></td>
    <td width="5%"><div class="table_top_row">Absence</div></td>
    <td width="5%"><div class="table_top_row">Edit</div></td><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=3"><b><span style='color:red'>Wijitmaker</span></b></a></td>
    <td><b><span style='color:red'>0.A.D. Project Leader</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=5"><b><span style='color:#9898FF'>Fire Giant</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=24"><b><span style='color:#9898FF'>irishstag</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=17"><b><span style='color:#9898FF'>Jeru</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=130"><b><span style='color:#9898FF'>Mythos_Ruler</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=55"><b><span style='color:#9898FF'>Quacker</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=62"><b><span style='color:#9898FF'>Render</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=37"><b><span style='color:#9898FF'>Saurabh</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=252"><b><span style='color:#9898FF'>Annatar</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=244"><b><span style='color:#9898FF'>Hyborian</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr></table></div></div>
    <br class="clear" />
    </div>
    </div>
    <div id="footer"><p id="copyinfo">| Execution Time: <b>0.053822040557861</b> sec |&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 2000-2004 Wildfire Games | All Rights Reserved</p>
    <a href="http://wildfiregames.com/0ad/"><img src="http://localhost/wildfire_games/intranet/skins/2/graphics/footer_left.jpg" alt="WFG Intranet" /></a> 
    </div>
    </body>
    </html>

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not entirely sure what you needed - but 'objweb_+_community_development' is not a legal variable name in JS (alphanumerics, underscores, dollar signs only). The error is keeping your 'mirage' function from being compiled ('Object expected' - in MSIE - means 'where's my function?'). Otherwise, this is the long way around if you just want to toggle the list items in & out of the document. Try:
    Code:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
        <title>WildFire Games</title>
    
        <meta http-equiv="Content-Type" content="text/html;
        charset=iso-8859-1" />
    
        <!-- <link rel="shortcut icon" href="/favicon.ico" /> -->
    
    <style type="text/css">
    
    .secbg {display: none;}
    
    </style>
    <script type="text/javascript">
    
    var nav_ids = [
    		'navItemweb__community_development' ,
    		'navItemartificial_intelligence_scripting' ,
    		'navItemgame_design' ,
    		'navItemgraphic_art' ,
    		'navItemhistory' ,
    		'navItemprogramming' ,
    		'navItemrandom_map_scripting' ,
    		'navItemscenario_design' ,
    		'navItemsound'
    	       ];
    
    function mirage(el_id)
    {
    	if (document.getElementById)
    	{
    		var el, id, i = 0;
    		while (id = nav_ids[i++])
    		{
    			el = document.getElementById(id);
    			if (id == el_id)
    				el.style.display = (el.style.display == 'block') ? 'none' : 'block';
    			else el.style.display = 'none';
    		}
    	}
    	return false;
    }
    
    </script>
    </head>
    <body>
    <div id="topline">Wildfire Games Intranet 2.0</div>
    <div id="banner"> <a href="http://wildfiregames.com/0ad/"><img id="header_left" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_left.jpg" alt="G to Wildfire Games: Project 0.A.D Website"/></a> 
      <a href="http://wildfiregames.com/"><img id="header_right" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_right.jpg" alt="Go to Wildfire Games Website" /></a> 
      <div id="navcontainer"> 
        <ul id="navlist">
          <li><a id="taba" class="active" href="#" title="0 A.D.">0 A.D.</a></li>
          <li><a id="tabb" href="#" title="TLA">TLA</a></li>
          <li><a accesskey="6" id="tabb" href="http://localhost/wildfire_games/wfg/" title="Our friendly, vibrant and well-informed community">Forums</a></li>
        </ul>
      </div>
    </div>
    <div id="tabbar"></div>
    <div id="content"> <div id="lside">
    <h2>Welcome back</h2>
    <p><b><span style='color:#c00'>DarkAngelBGE</span></b></p>
    <p>0.A.D. Web + Community Development Department Leader</p>
    <p><b><a href="http://localhost/wildfire_games/intranet/index.php?act=logout">Logout</a></b></p>
    <h2>Departments</h2><h3><a href="#" onclick="return mirage('navItemweb__community_development')"><b><span style='color:#c00'>Web + Community Development</span></b></a></h3><ul id="navItemweb__community_development" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=8">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=8">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemartificial_intelligence_scripting')">Artificial Intelligence Scripting</a></h3><ul id="navItemartificial_intelligence_scripting" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=6">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=6">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=6">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemgame_design')">Game Design</a></h3><ul id="navItemgame_design" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=1">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=1">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=1">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemgraphic_art')">Graphic Art</a></h3><ul id="navItemgraphic_art" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=7">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=7">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=7">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemhistory')">History</a></h3><ul id="navItemhistory" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=25">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=25">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=25">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemprogramming')">Programming</a></h3><ul id="navItemprogramming" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=3">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=3">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=3">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemrandom_map_scripting')">Random Map Scripting</a></h3><ul id="navItemrandom_map_scripting" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=5">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=5">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=5">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemscenario_design')">Scenario Design</a></h3><ul id="navItemscenario_design" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=2">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=2">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=2">Memberlist</a></li></ul><h3><a href="#" onclick="return mirage('navItemsound')">Sound</a></h3><ul id="navItemsound" class="secbg"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=4">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=4">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=4">Memberlist</a></li></ul></div><div>
    <div id="botleftcurve"></div>
    <div id="topleftcurve"></div>
    
    <ul class="breadcrumb" id="top_breadcrumb">
    <li><span id="sitemap"><a href="index.php?act=sitemap" title="SiteMap">Site Map</a></span></li>
    <li>&raquo;<a href="#" title="Link 1">Home</a></li>
    <li>&raquo;<a href="#" title="Link 1">Articles</a></li>
    <li>&raquo;<a href="#" title="Link 1">Wildfire Games Crier</a></li>
    <li>&raquo; Design Principles of the WFG Crier -- Page 1 <a href="#">2</a><a href="#">3</a><a href="#">4</a> 
    </ul>
    
    <div id="contentcont">          
    <h2><span>View Members - Graphic Art Department</span></h2>
    <div class="contentbar"></div><p>Total Department Members: <b>10</b></p><table><tr>
    <td width="25%"><div class="table_top_row">Name</div></td>
    <td width="25%"><div class="table_top_row">Project/Rank</div></td>
    <td width="30%"><div class="table_top_row">Department</div></td>
    <td width="5%"><div class="table_top_row">Absence</div></td>
    <td width="5%"><div class="table_top_row">Edit</div></td><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=3"><b><span style='color:red'>Wijitmaker</span></b></a></td>
    <td><b><span style='color:red'>0.A.D. Project Leader</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=5"><b><span style='color:#9898FF'>Fire Giant</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=24"><b><span style='color:#9898FF'>irishstag</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=17"><b><span style='color:#9898FF'>Jeru</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=130"><b><span style='color:#9898FF'>Mythos_Ruler</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=55"><b><span style='color:#9898FF'>Quacker</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=62"><b><span style='color:#9898FF'>Render</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=37"><b><span style='color:#9898FF'>Saurabh</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=252"><b><span style='color:#9898FF'>Annatar</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr><tr><td><a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=244"><b><span style='color:#9898FF'>Hyborian</span></b></a></td>
    <td><b><span style='color:#9898FF'>0.A.D. Staff Member</span></b></td>
    <td>Graphic Art</td>
    <td>no</td>
    <td></tr></table></div></div>
    <br class="clear" />
    </div>
    </div>
    <div id="footer"><p id="copyinfo">| Execution Time: <b>0.053822040557861</b> sec |&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 2000-2004 Wildfire Games | All Rights Reserved</p>
    <a href="http://wildfiregames.com/0ad/"><img src="http://localhost/wildfire_games/intranet/skins/2/graphics/footer_left.jpg" alt="WFG Intranet" /></a> 
    </div>
    </body>
    </html>
    
    Passing the id to a basic function simplifies things; let the function figure it out, using available data. Returning false from both the function call ('return mirage(...)') and the function itself keeps the link href from being loaded. If you just wanted to toggle one item without closing the others:
    Code:
    <script type="text/javascript">
    
    function mirage(el_id)
    {
    	if (document.getElementById)
    	{
    		var el = document.getElementById(el_id);
    		el.style.display = (el.style.display == 'block') ? 'none' : 'block';
    	}
    	return false;
    }
    
    </script>
    ::: certified wild guess :::

  3. #3
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried it, there is a small issue still though (is '&' perhaps not allowed?). Code is not exactly yours, as I pass the departments from a database.

    Here is the error message (when clicking on one of the guys):
    line 22: 'undefined' is NULL or no object.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
        <title>WildFire Games</title>
    
        <meta http-equiv="Content-Type" content="text/html;
        charset=iso-8859-1" />
    
        <!-- <link rel="shortcut icon" href="/favicon.ico" /> -->
    
    	<script type="text/javascript">
    		
    function mirage(el_id)
    {
    	var nav_ids;
    	nav_ids[1] = web_&_community_development;
    nav_ids[2] = artificial_intelligence_scripting;
    nav_ids[3] = game_design;
    nav_ids[4] = graphic_art;
    nav_ids[5] = history;
    nav_ids[6] = programming;
    nav_ids[7] = random_map_scripting;
    nav_ids[8] = scenario_design;
    nav_ids[9] = sound;
    
    	
    	if (document.getElementById)
    	{
    		var el, id, i = 0;
    		while (id = nav_ids[i++])
    		{
    			el = document.getElementById(id);
    			if (id == el_id)
    				el.style.display = (el.style.display == 'block') ? 'none' : 'block';
    			else el.style.display = 'none';
    		}
    	}
    	return false;
    }
    	</script>
    	
    </head>
    
    <body>
    <div id="topline">Wildfire Games Intranet 2.0</div>
    <div id="banner"> <a href="http://wildfiregames.com/0ad/"><img id="header_left" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_left.jpg" alt="G to Wildfire Games: Project 0.A.D Website"/></a> 
      <a href="http://wildfiregames.com/"><img id="header_right" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_right.jpg" alt="Go to Wildfire Games Website" /></a> 
      <div id="navcontainer"> 
        <ul id="navlist">
          <li><a id="taba" class="active" href="#" title="0 A.D.">0 A.D.</a></li>
          <li><a id="tabb" href="#" title="TLA">TLA</a></li>
          <li><a accesskey="6" id="tabb" href="http://localhost/wildfire_games/wfg/" title="Our friendly, vibrant and well-informed community">Forums</a></li>
        </ul>
      </div>
    </div>
    
    
    <div id="tabbar"></div>
    <div id="content"> <div id="lside">
    <h2>Welcome back</h2>
    <p><b><span style='color:#c00'>DarkAngelBGE</span></b></p>
    <p>0.A.D. Web & Community Development Department Leader</p>
    <p><b><a href="http://localhost/wildfire_games/intranet/index.php?act=logout">Logout</a></b></p>
    <h2>Departments</h2>
    <div id="departments"><div class="myDept"><h3><a href="#" onclick="mirage('web_&_community_development')">Web & Community Development</h3></a><ul id="navItemweb_&_community_development"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=8">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=8">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('artificial_intelligence_scripting')">Artificial Intelligence Scripting</a></h3><ul id="navItemartificial_intelligence_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=6">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=6">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=6">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('game_design')">Game Design</a></h3><ul id="navItemgame_design"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=1">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=1">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=1">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('graphic_art')">Graphic Art</a></h3><ul id="navItemgraphic_art"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=7">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=7">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=7">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('history')">History</a></h3><ul id="navItemhistory"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=25">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=25">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=25">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('programming')">Programming</a></h3><ul id="navItemprogramming"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=3">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=3">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=3">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('random_map_scripting')">Random Map Scripting</a></h3><ul id="navItemrandom_map_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=5">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=5">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=5">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('scenario_design')">Scenario Design</a></h3><ul id="navItemscenario_design"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=2">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=2">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=2">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('sound')">Sound</a></h3><ul id="navItemsound"><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=01&amp;deptId=4">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=4">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php?act=memberlist&amp;code=01&amp;deptId=4">Memberlist</a></li></ul></div></div></div><div>
    <div id="botleftcurve"></div>
    <div id="topleftcurve"></div>
    
    <ul class="breadcrumb" id="top_breadcrumb">
    <li><span id="sitemap"><a href="index.php?act=sitemap" title="SiteMap">Site Map</a></span></li>
    <li>&raquo;<a href="#" title="Link 1">Home</a></li>
    <li>&raquo;<a href="#" title="Link 1">Articles</a></li>
    <li>&raquo;<a href="#" title="Link 1">Wildfire Games Crier</a></li>
    <li>&raquo; Design Principles of the WFG Crier -- Page 1 <a href="#">2</a><a href="#">3</a><a href="#">4</a> 
    </ul>
    
    <div id="contentcont">          
    <h2><span>View Tasks - Web & Community Development Department</span></h2>
    <div class="contentbar"></div><h3>Quick Jump</h3><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8&amp;mid=31"><b><span style='color:#c00'>DarkAngelBGE</span></b></a> ( Department Leader )<br /><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8&amp;mid=80"><b><span style='color:#f80'>Black OP</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8&amp;mid=199"><b><span style='color:#f80'>Brian</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8&amp;mid=56"><b><span style='color:#f80'>CodeOptimist</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php?act=task&amp;code=02&amp;deptId=8&amp;mid=171"><b><span style='color:#f80'>Ph4ntom</span></b></a><br /><br />Click on one of the Members from above. :)</div></div>
    <br class="clear" />
    </div>
    </div>
    <div id="footer"><p id="copyinfo">| Execution Time: <b>0.07017993927002</b> sec |&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 2000-2004 Wildfire Games | All Rights Reserved</p>
    <div id="footer_left"><a href="http://wildfiregames.com/0ad/"><img src="http://localhost/wildfire_games/intranet/skins/2/graphics/footer_left.jpg" alt="WFG Intranet" /></a></div>
    </div>
    </body>
    </html>

  4. #4
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay I could fix this one. Also deleted the ampersand of web & community dev.

    Now getting an error (with the code below), line 72, object expected.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
        <title>WildFire Games</title>
    
        <meta http-equiv="Content-Type" content="text/html;
        charset=iso-8859-1" />
    
        <!-- <link rel="shortcut icon" href="/favicon.ico" /> -->
    
        <!-- Style Sheet -->
        <link rel="stylesheet" type="text/css" href="http://localhost/wildfire_games/intranet/skins/2/structure.css" />
        <link rel="stylesheet" type="text/css" href="http://localhost/wildfire_games/intranet/skins/2/format.css" />
        <link rel="stylesheet" type="text/css" href="http://localhost/wildfire_games/intranet/skins/2/header.css" />
    
    	<script type="text/javascript">
    		
    function mirage(el_id)
    {
    	array nav_ids;
    	nav_ids[1] = web___community_development;
    nav_ids[2] = artificial_intelligence_scripting;
    nav_ids[3] = game_design;
    nav_ids[4] = graphic_art;
    nav_ids[5] = history;
    nav_ids[6] = programming;
    nav_ids[7] = random_map_scripting;
    nav_ids[8] = scenario_design;
    nav_ids[9] = sound;
    
    	
    	if (document.getElementById)
    	{
    		var el, id, i = 0;
    		while (id = nav_ids[i++])
    		{
    			el = document.getElementById(id);
    			if (id == el_id)
    				el.style.display = (el.style.display == 'block') ? 'none' : 'block';
    			else el.style.display = 'none';
    		}
    	}
    	return false;
    }
    	</script>
    	
    </head>
    
    <body>
    <div id="topline">Wildfire Games Intranet 2.0</div>
    <div id="banner"> <a href="http://wildfiregames.com/0ad/"><img id="header_left" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_left.jpg" alt="G to Wildfire Games: Project 0.A.D Website"/></a> 
      <a href="http://wildfiregames.com/"><img id="header_right" src="http://localhost/wildfire_games/intranet/skins/2/graphics/header_right.jpg" alt="Go to Wildfire Games Website" /></a> 
      <div id="navcontainer"> 
        <ul id="navlist">
          <li><a id="taba" class="active" href="#" title="0 A.D.">0 A.D.</a></li>
          <li><a id="tabb" href="#" title="TLA">TLA</a></li>
          <li><a accesskey="6" id="tabb" href="http://localhost/wildfire_games/wfg/" title="Our friendly, vibrant and well-informed community">Forums</a></li>
        </ul>
      </div>
    </div>
    
    
    <div id="tabbar"></div>
    <div id="content"> <div id="lside">
    <h2>Welcome back</h2>
    <p><b><span style='color:#c00'>DarkAngelBGE</span></b></p>
    <p>0.A.D. Web & Community Development Department Leader</p>
    <p><b><a href="http://localhost/wildfire_games/intranet/index.php/logout/">Logout</a></b></p>
    <h2>Departments</h2>
    <div id="departments"><div class="myDept"><h3><a href="#" onclick="mirage('web___community_development')">Web & Community Development</h3></a><ul id="web___community_development"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/8/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/8/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('artificial_intelligence_scripting')">Artificial Intelligence Scripting</a></h3><ul id="artificial_intelligence_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/6/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/6/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/6/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('game_design')">Game Design</a></h3><ul id="game_design"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/1/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/1/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/1/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('graphic_art')">Graphic Art</a></h3><ul id="graphic_art"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/7/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/7/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/7/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('history')">History</a></h3><ul id="history"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/25/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/25/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/25/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('programming')">Programming</a></h3><ul id="programming"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/3/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/3/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/3/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('random_map_scripting')">Random Map Scripting</a></h3><ul id="random_map_scripting"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/5/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/5/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/5/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('scenario_design')">Scenario Design</a></h3><ul id="scenario_design"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/2/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/2/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/2/">Memberlist</a></li></ul></div><div class="notMyDept"><h3><a href="#" onclick="mirage('sound')">Sound</a></h3><ul id="sound"><li><a href="http://localhost/wildfire_games/intranet/index.php/task/01/4/">New Task</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/task/02/4/">View Tasks</a></li><li><a href="http://localhost/wildfire_games/intranet/index.php/memberlist/01/4/">Memberlist</a></li></ul></div></div></div><div>
    <div id="botleftcurve"></div>
    <div id="topleftcurve"></div>
    
    <ul class="breadcrumb" id="top_breadcrumb">
    <li><span id="sitemap"><a href="index.php/sitemap/" title="SiteMap">Site Map</a></span></li>
    <li>&raquo;<a href="#" title="Link 1">Home</a></li>
    <li>&raquo;<a href="#" title="Link 1">Articles</a></li>
    <li>&raquo;<a href="#" title="Link 1">Wildfire Games Crier</a></li>
    <li>&raquo; Design Principles of the WFG Crier -- Page 1 <a href="#">2</a><a href="#">3</a><a href="#">4</a> 
    </ul>
    
    <div id="contentcont">          
    <h2><span>View Tasks - Web & Community Development Department</span></h2>
    <div class="contentbar"></div><h3>Quick Jump</h3><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/31/"><b><span style='color:#c00'>DarkAngelBGE</span></b></a> ( Department Leader )<br /><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/80/"><b><span style='color:#f80'>Black OP</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/199/"><b><span style='color:#f80'>Brian</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/56/"><b><span style='color:#f80'>CodeOptimist</span></b></a><br /><a href="http://localhost/wildfire_games/intranet/index.php/task/02/8/171/"><b><span style='color:#f80'>Ph4ntom</span></b></a><br /><br /><h3>The Task List</h3>
    <table><tr>
    <td width="10%"><div class="table_top_row">To</div></td>
    <td width="40%"><div class="table_top_row">Task</div></td>
    <td width="40%"><div class="table_top_row">Progress Report</td></tr><tr class= "my_row"><td><a name="DarkAngelBGE"></a> <a href="http://forums.wildfiregames.com/wfg/index.php?act=Msg&amp;CODE=4&amp;MID=31"><b><span style='color:#c00'>DarkAngelBGE</span></b></a><p><span id="dept_lead_on_view_task">Department Leader</span></p><p><a href="http://localhost/wildfire_games/intranet/index.php/task/03/52/31/"> &raquo; Edit</a></p></td>
    <td><b>Updated:</b> <b><span style='color:#c00'>Jan 20, 2004 07:04:18</span></b><br /><br /> INTRANET<br />-- General<br />- Change design; use horiz. nav instead of vertic. nav to have more space for the tables<br /><br />--Task System<br /><br />- [<b>STILL BEING DISCUSSED</b>] progress bar for each task, upgradable by member<br /><br />- admin panel where you can edit member&#39;s permissions, the email sender intervals (department-dependent), make forumers staff<br /><br />- work out better reminder mechanisms (screw the emails; use forceful forum view permissions/redirecting)<br /><br />- absent page (personal control panel) (-&gt; prevent reminder mechanisms)<br /><br />- reminder mechanisms editable for each task individ.<br /><br /><br />--Memberlist<br /><br />WEBSITES<br />- Make Content-to-Screen stuff (public interface)<br /><br />- Make feature list for Admin Panel<br /><br />--WFG Site<br /><br />- discuss more features<br /><br />--0AD Site<br /><br />- finish main page layout (get welcome part at the top of news)<br /><br />- make layout for main article page<br /><br />- make layout for main media page<br /><br />FORUMS<br />- Implement PM note if rep change feature<br /><br />- Rank colors in Memberlist<br /><br />- Fix fast Reply More Options bug<br /><br />- upgrade boards to v2.0 Final when it&#39;s available; install any mods if needed and search for more useful mods and install them after upgrade<br /><br />- Fix bug last posts profile although PW&#39;ed forum<br /><br />- Left bar customization tool:<br />I would say hide the: <br />group icon<br />post stats<br />status<br />reputation<br />currency<br /><br />That would leave:<br />title<br />avatar<br /><br />ADDITIONAL TOOLS<br />- build tool to automize staff surveys<br /><br />MEMBERS<br /><br />MODERATORS<br />- work out Moderator Exams<br /><br />OTHER<br />- read the PHP Anthology books to finally become PHP Expert. :D<br /><br />- make task conf_global.php ini-style for better security<br /><br />- rewrite emailer class; use foreach statement in class not in public; get an &quot;addAdress&quot; method for emailing multiple people<br /><br />- mirror the entire WFG stuff on hard drive to test before uploading and making stuff public </td>
    <td><b>Updated:</b> <b><span style='color:#c00'>Jan 21, 2004 06:34:48</span></b><br /><br /> INTRANET<br />-- Task System<br /><br />- remove dates when task was assigned<br /><br />- version numbers for section in navbar<br /><br />- quick jump box<br /><br />- auto redirect when edited/deleted task to task list<br /><br />- links to top of page after each member<br /><br />- edit col screwed -&gt; in member col (more space for the task and progress cols)<br /><br />- guidelines for usage in table header<br /><br />- delete function when permission (dept leads and proj leads)<br /><br />[<b>NOTE</b>] As of now email reminder gets no updates -&gt; not sure if method will be still used in future<br /><br />WEBSITES<br /><br />-- WFG website<br /><br />built classes that resizing images to thumbsize<br />-implemented custom error handler<br />-implemented core code for search engine friendly URLs (we will move first so I can set this all up)<br />-implemented code for &quot;bread crumb&quot; navigation<br />-started with database design<br /><br />- get feedback for and perfect main page layout<br /><b>12/01</b> Implemented pictures jason made for me. Looking for more feedback.<br /><br />- first draft for main page layout<br /><br />FORUMS<br />- ask for and install new smilies<br /><br />ADDITIONAL TOOLS<br /> <br />MEMBERS<br />- redo WFG Moderator Guide and resend it to members<br /><br />- integrate ph4ntom more<br /><br />MODERATORS<br />- work out Moderator Exams (30% done)<br /><br />PREPARE FOR NEW SERVER<br />- design an application to autmize back ups of the database </td></tr>
    </tr></table></div></div>
    <br class="clear" />
    </div>
    </div>
    <div id="footer"><p id="copyinfo">| Execution Time: <b>0.12744307518005</b> sec |&nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; 2000-2004 Wildfire Games | All Rights Reserved</p>
    <div id="footer_left"><a href="http://wildfiregames.com/0ad/"><img src="http://localhost/wildfire_games/intranet/skins/2/graphics/footer_left.jpg" alt="WFG Intranet" /></a></div>
    </div>
    </body>
    </html>

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problems:

    1) This isn't JavaScript&#58; array nav_ids;
    2) JavaScript counts from zero.
    3) Shouldn't put an array declaration - where the array involved is used multiple times - inside a function (repeatedly declaring it)
    Code:
    var nav_ids = [
    		'navItemweb__community_development' ,
    		'navItemartificial_intelligence_scripting' ,
    		'navItemgame_design' ,
    		'navItemgraphic_art' ,
    		'navItemhistory' ,
    		'navItemprogramming' ,
    		'navItemrandom_map_scripting' ,
    		'navItemscenario_design' ,
    		'navItemsound'
    	       ];
    
    function mirage(el_id)
    {
    This: [] is an array literal, makes an array by itself; an alternative approach is to call the host constructor: var nav_ids = new Array();
    I prefer the literal - it's well supported now - but, take your pick. Note the absence of a comma after the last element;
    imagine the whole thing strung out on one line and you'll see why.
    You've given the first element in your 'array' the index 1, which will break the while loop immediately, since there's no 'nav_ids[0]'.
    Doesn't matter though, since you left out the quote marks for the ids!
    The JS interpreter now thinks they're variable names; this would have actually worked in IE if you hadn't plugged it into .getElementById(),
    but it's the wrong solution.
    Please analyze the approach I took, it's nothing special but it is logical (and simple).

    Be sure and set the initial CSS display to 'none' if you want to toggle.
    ::: certified wild guess :::

  6. #6
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also worked it out now beforehand (sorry I didn't tell):

    Code:
    function mirage(el_id)
    {	
    	if (!document.getElementById) return false;
    	el = document.getElementById(el_id);
    	el.style.display = (el.style.display == "block") ? "none" : "block";		
    }
    No declaration at all.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •