// IM_Menus ------------------------- Insider's universal code for generating flyout menus -----------------------
// V3.22 02/06/01 --major fixes to stylesheet detect and selector reading (MS-PC), and fix to hiding submenus (NS6!)
// V3.21 01/30/01 --working version under Opera. It pretends to be M5, but doesn't have stylesheets
// V3.20 01/11/01 --Restored IE4PC and NS4PC compatibility; improved browser detection (sigh.)
// V3.11 12/20/00 --now handles stylesheets hover/lit -- but only for MSIE!
// V3.1 12/01/00 --now handles stylesheets hover/lit as well as images
// V3.0 11/26/00 --rethunk for shorter code, gretaer compatibility, complete generalization, Insider style
// (C) 2000 Insider Creative, Inc. All Rights Reserved
// enhancements - test for "Hover" and 'Lit" image source before using them; preload them?
// Some global settings
rollPause = 120 //time in ms before rolloffs take effects
timerID = null //current menu timer setting
submenuToRevert = null //name of any submenu that must be vanished upon rolling on a new menu
menuToRevert = null //name of any mainmenu image that must be reverted upon rolloff
revertState=null //the last state a menu was in.
menuPostfixLit="-lit" //extension to add to styles and images when a menu is turned on
menuPostfixHover="-hover" //extention to add to styles and images while a menu is hoverred
currentStyles="" //we're going to build the list of known styles
// on load, figure out what browser we are using, and act accordingly
compatible=false //presume we have an old browser
app= (navigator.appName.charAt(0)=='M') ? ((navigator.userAgent.indexOf('Mac')>-1) ? 'M':'I') : navigator.appName.charAt(0)
vers = navigator.appVersion
app = app + ((vers.indexOf("MSIE ")==-1) ? vers.charAt(0): vers.charAt(vers.indexOf("MSIE ")+5))
if (app.charAt(1)>=4) { visible = "visible"; hidden = "hidden"; compatible=true } //NS5,6,MS uses DIVS
if (app=="N4") {visible = "show"; hidden = "hide"; compatible=true } //NS4 only uses LAYERS
document.write("") //add in custom stylesheet
//rlist=document.styleSheets[0].cssRules //this is the way Netscape SHOULD do, but a known bug means it don't work with @imported css
if (document.styleSheets) { //for MS browsers, read all stylesheet tags
for (x=0; x<=document.styleSheets[0].rules.length-1; x++) {
currentStyles = currentStyles + "|" + document.styleSheets[0].rules[x].selectorText
}
}
//////////// Function to build submenu; final two argeuments are semi-optional ///////////////
function IM_createSubmenu(name, content, top, left, width, color){
if (!compatible) {return}
if (width=="") {width="150"} //optional arguement; default width if not supplied
if (color=="") {color="#ffffff"} //optional background color; white if not supplied
state=hidden //visible only for testing
zindex=100
if (app!="N4"){
//in most browsers we write DIVs...
document.writeln("
")
document.writeln(content)
document.writeln("
")
}
else {
//only in Navigator 4 do we write layers...
document.writeln("")
document.writeln(content)
document.writeln('')
mymenu=getObject(name)
mymenu.width=width
}
}
/////////////// subfunction to return a page object given the name /////////////////
function getObject(objectID) {
if (typeof objectID!="string") {return(objectID)} //in case we passed actual object, not object name
if (app=="N4") {
if (document.layers[objectID]) {return(document.layers[objectID]) } //netscape 4's object..
else { return (null) } //in case the automenu attempt finds it doesn't exist
}
if ((app=="I4")||(app=="M4")) {
if (document.all[objectID]) { return(document.all[objectID].style)} //MS4 object
else { return (null) } //in case the automenu attempt finds it doesn't exist
}
return (document.getElementById(objectID)) //NS6 / MS5+ object...
}
/////////////// subfunction to change the visibility a submenu given the ID /////////////////
function changeVisibility(objectID, myState) {
if (app=="N4") {
myMenu=document.layers[objectID] //netscape 4's object...
}else{
if ((app=="I4")||(app=="M4")) {
myMenu=document.all[objectID].style //MS4 object
}else{
myMenu=document.getElementById(objectID).style //NS6 / MS5+ object...
}
}
if (myMenu!=null) {myMenu.visibility=myState}
}
/////////////// function when rolling onto menu or submenu: turn on submenu; turn off timer and old menus ///////////
function IM_enterMenu(enteredMenu, submenuName) {
if (!compatible) {return} //don't do this on old browsers
clearTimeout(timerID)
if (submenuName==null) {return} //if called from submenu (item 2 missing), it's already on; we're done.
if (submenuToRevert) {IM_hideMenu(submenuToRevert)} //turn off any still-on menus/submenus
changeVisibility(submenuName,visible) //turn ON our new submenu
submenuToRevert = submenuName //remember submenu for if/when we have to turn it off.
IM_setMenustate( enteredMenu,menuPostfixHover) //attempt a change of mainmenu state
}
/////////////// when you leave menu or submenu, prepare to turn off named submenu ////////////////
function IM_closeMenu(menuToClose) {
if (!compatible) {return}
timerID = setTimeout("IM_hideMenu('" + menuToClose + "')", rollPause) //set a new time to turn off menus
}
///////// when timer fires or mainmenu exited, vanish submenu & revert main ///////////
function IM_hideMenu(menuToHide) {
changeVisibility(menuToHide,hidden) //turn off our new submenu
submenuToRevert = null //ns6 will die on the next line so this has to come first
IM_setMenustate(menuToRevert, revertState) //if there's a mainmenu style/image to change, then change it.
menuToRevert =null //leaving us nothing to turn off.
}
////////// called near pagestart to "light up" a desired menu via images or style /////////////
function IM_lightMenu(menuName) {
IM_setMenustate (menuName, menuPostfixLit)
}
////////// general subroutine to set the style of a given menu to one style or another /////////////
function IM_setMenustate (myMenu, myState) {
if (getObject(myMenu)!=null) { //the only way NS4PC is allowed to skip this stuff
menuToRevert=myMenu //remember what we changed for later
if (document.images[myMenu+ "-img"]) { //this menu has an image; (try) changing that to another one
revertState = (document.images[myMenu+ "-img"].src) //this is the state we now have...
dotSplit = revertState.indexOf(".") // find the file extension
dashSplit=revertState.indexOf("-") //check for hover/lit divider too
if (dashSplit<0) {dashSplit=dotSplit} //if there wasn't one, split completely at the dot.
desiredstate = revertState.substring(0,dashSplit) + myState + revertState.substr(dotSplit)
document.images[myMenu+ "-img"].src = desiredstate
}
mainMenu=getObject(myMenu) //convert our menuname to a found object
if (mainMenu.className>"" && currentStyles>"") { //this (microsoft-ish) object has a style associated with it
revertState = mainMenu.className //this is the state we now have...
dashSplit=revertState.indexOf("-") //check for hover/lit divider too
if (dashSplit<0) {dashSplit=revertState.length} //if there wasn't one, split completely at the end.
desiredState=revertState.substring(0,dashSplit)+myState //create new style
revertState = revertState.substring(dashSplit) //save in the old style extension
if (currentStyles.indexOf(desiredState)>=0) { //can I find the new version in the stylesheets?
mainMenu.className = desiredState //switch to the desired style
}
}
menuToRevert=myMenu //remember what we changed for later
}
}
// --THE FOLLOWING ARE SHARED SUBMENUS for all sites.
// 03/28/02 LG - CONTACT US addes a dtml-var BASE location
// 12/12/01 LG - added "Forgot password?" choice
// 04/27/01 LG - moved from individual menu defintions
// ---About Vision Events Menu---
menu7 = "Overview "
+ "FAQs "
+ "Our Events "
+ "About Gartner "
+ "Privacy Policy "
// ---Calendar Menu---
menu8 = "VARVision "
+ " May 29-31, 2002 "
+ "EnterpriseVision "
+ " July 14-16, 2002 "
+"System Builder Summit "
+" Sept. 3-5, 2002 "
"VARVision "
+ " Sept. 3-5, 2002 "
+ "RetailVision "
+ " Sept. 10-13, 2002 "
+ "Small Business Vision Central "
+ " Sept. 25-27, 2002 "
+"Midsize Enterprise Summit Central "
+" Sept. 25-27, 2002 "
+ ""
+ "System Builder Europe "
+ " May 15-18, 2002 "
+ "EnterpriseVision Europe "
+ " June 16-18, 2002 "
+ ""
+ "Complete Calendar "
// ---Contact Menu---
menu9 = "Contact Information "
+ "Driving Directions "
// + "Online Chat "
+ "603-471-4200 "
// ---Login---
menu10 = "Log-In "
+"Forgot Password?"