Requires the "hierMenus.js" file, found at: www.dhtmlab.com. "; echo "\n"; $num=count($name); if (strchr($identifier,"_")) echo "arMenu" . $identifier . " = new Array("; else { // modify the hex (#RRGGBB) numbers to get different colors echo "arMenu" . $identifier . " = new Array(null, 0, 0, '#000000','#000000', '#00FFFF','#FFFF00', '#008888','#008888'"; if ($num>0) echo ","; else echo ",'None','javascript:hideAll();',0"; } for($i=0; $i<$num; $i++) { $n=$name[$i]; $h=$href[$i]; $s=$submenu[$i]; echo "'$n','$h',$s"; if ($i<$num-1) echo ","; } echo "); "; echo "\n"; echo " "; echo "\n"; if (!(strchr($identifier,"_"))) { echo " "; echo "$title"; echo ""; } } // Modify the following for your own application. $name=array("CNN","Tribune","NY Times"); $href=array("http://cnn.com", "javascript:alert(\'hello\')", "http://nytimes.com"); $submenu=array(1,0,1); buildMenu("1",$name,$href,$submenu, "Click on me"); $name=array("Washington Post","Mercury Star","Wall St Journal"); $href=array("http://washingtonpost.com", "javascript:alert(\'aloha\')", "http://wsj.com"); $submenu=array(0,0,1); buildMenu("1_1",$name,$href,$submenu); $name=array("Star Wars"); $href=array("http://starwars.com"); $submenu=array(0,0,0); buildMenu("1_1_3",$name,$href,$submenu); $name=array("Apple","IBM","Dell"); $href=array("http://apple.com", "http://ibm.com", "http://dell.com"); $submenu=array(0,0,0); buildMenu("1_3",$name,$href,$submenu); echo "

"; $name=array("Mattel", "Hasbro"); $href=array("http://mattel.com", "http://hasbro.com"); $submenu=array(0,1); buildMenu("2",$name,$href,$submenu, "Click on me also"); $name=array("Lego"); $href=array("http://lego.com"); $submenu=array(0); buildMenu("2_2",$name,$href,$submenu); ?>