var allSupport = (document.all!=null);

/// CHANGE THESE VARIABLES
var popupBGColor = "#1D1E5B";
var popupFontColor = "#c0c0ff";
var highlightBGColor = "#3F4177";
var highlightFontColor = "#e0e0ff";
var popupFontFace  = "Verdana, Arial, Tahoma, Helvetica";
var popupFontSize  = "-2";

var productspt = [ "DICE Aegis", "http://www.dicecorp.com/cgi-bin/productindex.cgi?product=aegis",
	"Alarm Monitoring", "http://www.dicecorp.com/cgi-bin/productindex.cgi?product=alarm",
	"Accounting", "http://www.dicecorp.com/cgi-bin/productindex.cgi?product=accounting",
	"Service", "http://www.dicecorp.com/cgi-bin/productindex.cgi?product=service",
	"DICE*eLink", "http://www.dicecorp.com/cgi-bin/productindex.cgi?product=elink",
	"Video Operations Center Software","http://www.dicecorp.com/cgi-bin/contenttemplate.cgi?content=productinfo&product=Video_Operations_Center_Software&division=alarm",
	"AltiGen Phone Systems", "http://www.telecom.dicecorp.com" ];

var servicespt = [ "Deployment Services", "http://www.dicecorp.com/service_deploy.html",
	"Education Services", "http://www.dicecorp.com/service_training.html",
	"Disaster Recovery","http://www.dicecorp.com/disaster_recovery.html",
	"VoIP Telephone Solutions","http://telecom.dicecorp.com",
	"Nationwide Guard Dispatch","http://www.dicecorp.com/guard.html",
	"ASP Hosting","http://www.dicecorp.com/asphosting.html",
	"DC Capital","http://www.dicecorp.com/dc_capital.html", 
	"Installation", "http://www.dicecorp.com/service_installation.html",
	"Custom Scripting", "http://www.dicecorp.com/service_programming.html",
	"Marketing & Media", "http://www.dicecorp.com/service_webdesign.html" ];

var corporatept = [ "Corporate Profile", "http://www.dicecorp.com/companyprofile.html",
"Corporate Video", "http://www.dicecorp.com/corporate_video.html",
	"Careers", "http://www.dicecorp.com/employmentopportunities.html", 
	"Driving Directions","http://www.dicecorp.com/directions.html",
    "Contact Info", "http://www.dicecorp.com/contactus.html",
    "Links","http://www.dicecorp.com/links.html"];

var customerpt = ["Customer Profiles","http://www.dicecorp.com/custprofiles.html",
"View a Demonstration","http://www.dicecorp.com/demo_register.html",
"WebEx Meeting Center","http://dicecorp.webex.com",
"User Forums", "http://www.dicecorp.com/cgi-bin/Ultimate.cgi?action=intro&category=1",
    "User Feedback", "http://www.dicecorp.com/commentform.html",
	"Support Queue", "http://www.dicecorp.com/tickets.html" ];

var newspt = ["News Archive", "http://www.dicecorp.com/cgi-bin/newsarchive.cgi",
    "In the Press", "http://www.dicecorp.com/inthepress.html",
	"Tradeshows & Events", "http://www.dicecorp.com/tradeshow.html"];

/// END CHANGES

function getElement(elName) {
  // Get an element from its ID
  if (allSupport)
    return document.all[elName]
  else
    return document.layers[elName]
}

var storebg;

function IEMouseOverMenuOp(el) {
   storebg = el.style.backgroundColor;
   el.style.backgroundColor = highlightBGColor;
}

function IEMouseOutMenuOp(el) {
   el.style.backgroundColor = storebg;
}

function retHTML(opts) {
  var out = "<table cellspacing=0 cellpadding=1";
//  if (allSupport) {
//     out = out + " onmouseout='event.cancelBubble=true;'";
//  }
  out = out + ">";
  for (i=0; i<opts.length; i++) {
     out = out + "<tr><td align='left'";
     if (allSupport) {
        out = out + " onmouseover='IEMouseOverMenuOp(this)' onmouseout='IEMouseOutMenuOp(this)'";
     }
     out = out + "><a href='"+opts[i+1]+"'>"+
          "<font face='"+popupFontFace+"' size="+popupFontSize+
            " color="+popupFontColor+">"+opts[i]+"</font></a></td></tr>";
     i++;
  }
  return out + "</table>";
}

var actualHideTimer = 0;

function actualHide() {
   MM_swapImgRestore();
   clearInterval(actualHideTimer);
   if ( allSupport ) {
      if ( document.all["popupMenu"] ) {
         document.all["popupMenu"].style.visibility = 'hidden';
      }
   } else {
      if ( document.layers["popupLayer"] ) { 
         document.layers["popupLayer"].visibility = 'hide';
      }
   }
}

function stopTimer() {
   if (actualHideTimer) {
      clearInterval(actualHideTimer);
      actualHideTimer = 0;
   }
}

function hideMenu() {
   if (!actualHideTimer)  {
      actualHideTimer = setInterval("actualHide()",1000);
   }
}

function bodyMouseMove() {
   if ( allSupport ) {
      var el = event.srcElement;
      var isInMenu = 0;
      if ( el.IEisMenu ) { 
         isInMenu = 1;
      }
      while (el.parentElement) {
         el = el.parentElement;
         if (el.IEisMenu) {
            isInMenu = 1;
         }
      }
      if ( document.all["popupMenu"] ) {
         if (!isInMenu && document.all["popupMenu"].style.visibility != 'hidden') {
            hideMenu();
         } else {
            stopTimer();
         }
      }
   } else {
      hideMenu();
   }
}

function getOffset(el, which) {
  // Function for IE to calculate position 
  // of an element.
  var amount = el["offset"+which] 
  if (which=="Top")
    amount+=el.offsetHeight
  el = el.offsetParent
  while (el!=null) {
    amount+=el["offset"+which]
    el = el.offsetParent
  }
  return amount
}

function showMenu(el,opts) {
   stopTimer();
   if ( allSupport ) {
      document.all["popupMenu"].innerHTML = retHTML(opts);
      document.all["popupMenu"].style.backgroundColor = popupBGColor;
      document.all["popupMenu"].style.pixelTop = getOffset(el,"Top");
      document.all["popupMenu"].style.pixelLeft = getOffset(el,"Left");
//      document.all["popupMenu"].style.pixelLeft = (getOffset(el,"Left") + el.offsetWidth) - document.all["popupMenu"].offsetWidth;
      document.all["popupMenu"].style.visibility = 'visible';
   } else {
      document.layers["popupLayer"].document.open()
      document.layers["popupLayer"].document.write("<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 bgcolor="+popupBGColor+"><TR><TD WIDTH=100% align='left'>")
      document.layers["popupLayer"].document.write( retHTML(opts) )
      document.layers["popupLayer"].document.write("</TD></TR></TABLE>")
      document.layers["popupLayer"].document.close()
      document.layers["popupLayer"].top = el.y + 20;
      document.layers["popupLayer"].left = el.x;
      document.layers["popupLayer"].visibility = 'show';
   }
}

 

