if(document.images) { var id1 = 1; while(eval("window.SDDM_image"+id1+"_highlight_src")) { (new Image()).src = eval("window.SDDM_image"+id1+"_highlight_src"); id1++; } } //we will define submenus based on the presence of image variables SDDM_imageID on SDDM_main var SDDM_over_submenu = new Array(); //note that SDDM_over_submenu array would have element at index 0 never set. It will have elements with index starting at 1 and ending at id of last menu. So length would have one extra var id1 = 1; while(eval("window.SDDM_image"+id1+"_src")) { if(id1==1) SDDM_submenu_width=178; else if(id1==2) SDDM_submenu_width=167; else if(id1==3) SDDM_submenu_width=391; else if(id1==4) SDDM_submenu_width=153; var submenuHeight=108; if(id1==1) submenuHeight=161; var bgImage=imageFolderPath+"/bg_submenu_genewatch.png"; //declare each submenu with unique id SDDM_submenuID. This will be used by most functions if(id1==1) document.write("
"); id1++; /* if(id1==1) SDDM_submenu_width=178; else if(id1==2) SDDM_submenu_width=165; else if(id1==3) SDDM_submenu_width=391; else if(id1==4) SDDM_submenu_width=153; var submenuHeight=108; if(id1==1) submenuHeight=161; else if(id1==2) submenuHeight=112; else if(id1==3) submenuHeight=108; else if(id1==4) submenuHeight=69; var bgImage=imageFolderPath+"/bg_submenu_genewatch.png"; if(id1==2) bgImage=imageFolderPath+"/bg_submenu_currentprojects.png"; else if(id1==3) bgImage=imageFolderPath+"/bg_submenu_pastprojects.png"; else if(id1==4) bgImage=imageFolderPath+"/bg_submenu_support.png"; //declare each submenu with unique id SDDM_submenuID. This will be used by most functions document.write(" "); id1++; */ }; function SDDM_activate(id) { SDDM_over_submenu[id] = true; SDDM_deactivateAll(); SDDM_showSubMenu(id); SDDM_setImageSrc("SDDM_image"+id, eval("window.SDDM_image"+id+"_highlight_src")); }; function SDDM_deactivate(id) { SDDM_over_submenu[id] = false; SDDM_deactivateAllDelay(); }; function SDDM_deactivateAllDelay() { setTimeout("SDDM_deactivateAll()",SDDM_hide_delay); }; function SDDM_deactivateAll() { var id = 1; while(eval("window.SDDM_image"+id+"_src")) { if(!SDDM_over_submenu[id]) { SDDM_hideSubMenu(id); SDDM_setImageSrc("SDDM_image"+id, eval("window.SDDM_image"+id+"_src")); } id++; } }; function SDDM_setImageSrc(theImageName,theImageSrc) { if(document.images) { document.images[theImageName].src=theImageSrc; } }; function SDDM_showSubMenu(id) { var theImageName = "SDDM_image" + id; var theImage; if(document.images) { theImage = document.images[theImageName]; } var theSubMenu = document.getElementById("SDDM_submenu"+id); var yPos=SDDM_submenu_y; //first submenu need to be up little because of the curved part if(id==1) yPos=21; theSubMenu.style.top=eval(SDDM_getCoordinates(theImage).y + yPos)+"px"; var xPos=SDDM_getCoordinates(theImage).x; if(id!=1) xPos-=1; theSubMenu.style.left=eval(xPos)+"px"; theSubMenu.style.visibility = 'visible'; }; function SDDM_getCoordinates(obj) { var newObj = new Object(); newObj.x = obj.offsetLeft; newObj.y = obj.offsetTop; theParent = obj.offsetParent; while(theParent != null) { newObj.y += theParent.offsetTop; newObj.x += theParent.offsetLeft; theParent = theParent.offsetParent; } return newObj; }; function SDDM_hideSubMenu(id) { var theSubMenu = document.getElementById("SDDM_submenu"+id); theSubMenu.style.visibility='hidden'; }