﻿/*
 Copyright 2010: Thomson Reuters Global Resources. 
 All Rights Reserved. Proprietary and Confidential information of TRGR. 
 Disclosure, Use or Reproduction without the written authorization of TRGR is prohibited.
*/
var PreviousDropdownMenu = null
var highlightobj = null
var timeout

function dropit(obj, dropmenuID) {
    if (this.PreviousDropdownMenu != null) //hide previous menu
    {
        dohide()
    }
    this.PreviousDropdownMenu = document.getElementById(dropmenuID)
    window.clearTimeout(timeout)
    this.PreviousDropdownMenu.onmouseover = function() { cancelhide() }
    this.PreviousDropdownMenu.onmouseout = function() { hideall() }
    obj.onmouseout = function() { hideall() }
    this.PreviousDropdownMenu.style.visibility = "visible"
    obj.style.backgroundColor = "#9c0000"
    highlightobj = obj
}

function hideall() {
    if (this.PreviousDropdownMenu != null)
        timeout = window.setTimeout(dohide, 100)
}

function dohide() {
    if (PreviousDropdownMenu != null) {
        PreviousDropdownMenu.style.visibility = "hidden"
        if (highlightobj.className != "current") {
            highlightobj.style.backgroundColor = "#006633"
        }
        PreviousDropdownMenu = null
    }
}

function cancelhide() {
    window.clearTimeout(timeout)
}
