/***********************************************
* AnyLink Drop Down Menu- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

// Menu items for whyUSI
var whyUSI = new Array()
whyUSI[0] = '<a href="whyUSIAboutUSI.jsp">&nbsp;About USI</a>'


// Menu items for productsAndServices
var productsAndServices = new Array()
productsAndServices[0] = '<a href="productsAndServicesFinancialServices.jsp">&nbsp;Financial Services</a>'
productsAndServices[1] = '<a href="productsAndServicesPropertyAndCasualty.jsp">&nbsp;Property and Casualty</a>'
productsAndServices[2] = '<a href="productsAndServicesHealthAndWelfare.jsp">&nbsp;Health and Welfare</a>'

// Menu items for locations
var locations = new Array()
locations[0]  = '<a href="locationsCalifornia.jsp">&nbsp;California</a>'
locations[1]  = '<a href="locationsConnecticut.jsp">&nbsp;Connecticut</a>'
locations[2]  = '<a href="locationsFlorida.jsp">&nbsp;Florida</a>'
locations[3]  = '<a href="locationsIllinois.jsp">&nbsp;Illinois</a>'
locations[4]  = '<a href="locationsKentucky.jsp">&nbsp;Kentucky</a>'
locations[5]  = '<a href="locationsLouisiana.jsp">&nbsp;Louisiana</a>'
locations[6]  = '<a href="locationsMaine.jsp">&nbsp;Maine</a>'
locations[7]  = '<a href="locationsMassachusetts.jsp">&nbsp;Massachusetts</a>'
locations[8]  = '<a href="locationsMissouri.jsp">&nbsp;Missouri</a>'
locations[9]  = '<a href="locationsNewHampshire.jsp">&nbsp;New Hampshire</a>'
locations[10] = '<a href="locationsNewJersey.jsp">&nbsp;New Jersey</a>'
locations[11] = '<a href="locationsNewMexico.jsp">&nbsp;New Mexico</a>'
locations[12] = '<a href="locationsNewYork.jsp">&nbsp;New York</a>'
locations[13] = '<a href="locationsNorthCarolina.jsp">&nbsp;North Carolina</a>'
locations[14] = '<a href="locationsOhio.jsp">&nbsp;Ohio</a>'
locations[15] = '<a href="locationsOregon.jsp">&nbsp;Oregon</a>'
locations[16] = '<a href="locationsPennsylvania.jsp">&nbsp;Pennsylvania</a>'
locations[17] = '<a href="locationsRhodeIsland.jsp">&nbsp;Rhode Island</a>'
locations[18] = '<a href="locationsTennessee.jsp">&nbsp;Tennessee</a>'
locations[19] = '<a href="locationsTexas.jsp">&nbsp;Texas</a>'
locations[20] = '<a href="locationsVermont.jsp">&nbsp;Vermont</a>'
locations[21] = '<a href="locationsVirginia.jsp">&nbsp;Virginia</a>'
locations[22] = '<a href="locationsWashington.jsp">&nbsp;Washington</a>'
locations[23] = '<a href="locationsOther.jsp">&nbsp;Other</a>'

// Menu items for usiMarketplace
var usiMarketplace = new Array()
usiMarketplace[0] = '<a href="marketplaceConstructionServicesGroup.jsp">&nbsp;Construction Services Group</a>'
usiMarketplace[1] = '<a href="marketplaceCraneAndRiggingRiskManagement.jsp">&nbsp;Crane and Rigging Risk Management</a>'
usiMarketplace[2] = '<a href="marketplaceEnvironmentalRiskMitigationGroup.jsp">&nbsp;Environmental Risk Mitigation Group</a>'
usiMarketplace[3] = '<a href="marketplaceTransportationGroup.jsp">&nbsp;Transportation Group</a>'

// Menu items for usiFamilyOfCompanies
var usiFamilyOfCompanies = new Array()
usiFamilyOfCompanies[0] = '<a href="familyOfCompanies.jsp#USIConsultingGroup">&nbsp;Consulting Group</a>'
usiFamilyOfCompanies[1] = '<a href="familyOfCompanies.jsp#USIAffinity">&nbsp;Affinity</a>'
usiFamilyOfCompanies[2] = '<a href="familyOfCompanies.jsp#USIHealthcare">&nbsp;Healthcare</a>'
usiFamilyOfCompanies[3] = '<a href="familyOfCompanies.jsp#UniversWorkplaceBenefits">&nbsp;Univers Workplace Benefits</a>'
usiFamilyOfCompanies[4] = '<a href="usiSecurities.jsp">&nbsp;USI Securities</a>'

// Menu items for investorRelations
var investorRelations = new Array()
investorRelations[0] = '<a href="investorRelationsPressReleases.jsp">&nbsp;Press Releases</a>'
investorRelations[1] = '<a href="investorRelationsSeniorExecutivesAndOfficers.jsp">&nbsp;Senior Executives and Officers</a>'
investorRelations[3] = '<a href="investorRelationsInformationRequests.jsp">&nbsp;Information Requests</a>'
investorRelations[4] = '<a href="investorRelationsSecure/investorsSecureAreaPassword.jsp">&nbsp;Investor Secure Area</a>'


var menuwidth        = '165px'   // Default menu width
var menubgcolor      = '#dadada' // Menu bgcolor
var disappeardelay   = 250       // Menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick = "yes"     // Hide menu when user clicks within menu?

// No further editting needed

var ie4 = document.all
var ns6 = document.getElementById && !document.all

if (ie4||ns6)
{
  document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
}

function getposOffset(what, offsettype)
{
  var totaloffset = (offsettype=="left") ? what.offsetLeft : what.offsetTop;
  var parentEl    = what.offsetParent;

  while (parentEl != null)
  {
    totaloffset = (offsettype == "left") ? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
  }

  return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth)
{
  if (ie4 || ns6)
  {
    dropmenuobj.style.left=dropmenuobj.style.top="-500px"
  }

  if (menuwidth != "")
  {
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=menuwidth
  }

  if (e.type == "click" && obj.visibility == hidden || e.type == "mouseover")
  {
    obj.visibility=visible
  }
  else if (e.type == "click")
  {
    obj.visibility=hidden
  }
}

function iecompattest()
{
  return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge)
{
  var edgeoffset = 0

  if (whichedge=="rightedge")
  {
    var windowedge=ie4 && !window.opera ? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15

    dropmenuobj.contentmeasure = dropmenuobj.offsetWidth

    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
        {
      edgeoffset = dropmenuobj.contentmeasure-obj.offsetWidth
        }
  }
  else
  {
    var topedge    = ie4 && !window.opera ? iecompattest().scrollTop : window.pageYOffset
    var windowedge = ie4 && !window.opera ? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18

    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight

    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
        { // Move up?
      edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight

      if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure)
          { // Up no good either?
        edgeoffset = dropmenuobj.y + obj.offsetHeight-topedge
          }
    }
  }

  return edgeoffset
}

function populatemenu(what)
{
  if (ie4 || ns6)
  {
    dropmenuobj.innerHTML=what.join("")
  }
}


function dropdownmenu(obj, e, menucontents, menuwidth)
{
  if (window.event)
  {
    event.cancelBubble = true
  }
  else
  {
    if (e.stopPropagation) e.stopPropagation()
  }

  clearhidemenu()

  dropmenuobj = document.getElementById ? document.getElementById("dropmenudiv") : dropmenudiv

  populatemenu(menucontents)

  if (ie4 || ns6)
  {
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

    dropmenuobj.x = getposOffset(obj, "left")
    dropmenuobj.y = getposOffset(obj, "top")

    //dropmenuobj.style.left = dropmenuobj.x-clearbrowseredge(obj, "rightedge")  + "px"
    //dropmenuobj.style.top  = dropmenuobj.y-clearbrowseredge(obj, "bottomedge") + obj.offsetHeight + "px"

    dropmenuobj.style.left = dropmenuobj.x - 7  + "px"  // Added - 5
    dropmenuobj.style.top  = dropmenuobj.y + obj.offsetHeight + 7 + "px"  // Added + 25
  }

  return clickreturnvalue()
}

function clickreturnvalue()
{
  if (ie4 || ns6)
  {
    return false
  }
  else
  {
    return true
  }
}

function contains_ns6(a, b)
{
  while (b.parentNode)
  {
    if ((b = b.parentNode) == a)
        {
      return true;
        }
  }

  return false;
}

function dynamichide(e)
{
  if (ie4 && !dropmenuobj.contains(e.toElement))
  {
    delayhidemenu()
  }
  else if (ns6 && e.currentTarget != e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))
  {
    delayhidemenu()
  }
}

function hidemenu(e)
{
  if (typeof dropmenuobj != "undefined")
  {
    if (ie4 || ns6)
    {
      dropmenuobj.style.visibility = "hidden"
        }
  }
}

function delayhidemenu()
{
  if (ie4 || ns6)
  {
    delayhide = setTimeout("hidemenu()", disappeardelay)
  }
}

function clearhidemenu()
{
  if (typeof delayhide != "undefined")
  {
    clearTimeout(delayhide)
  }
}

if (hidemenu_onclick == "yes")
{
  document.onclick=hidemenu
}

function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=1, width=660, height=505, left = 199.5, top = 134');");
}

