/*****************************************************
* dropMenu
* 3/04/2001
*
* a nice little script to create exclusive, slide-out
* menus for ns4, ns6, mozilla, opera, ie4, ie5 on 
* mac and win32. I've got no linux or unix to test on but 
* it should(?) work... 
*
* Revised:
* - 08/29/2002 : added .hideAll()
*
* --youngpup--
*****************************************************/
dropMenu.Registry = []
dropMenu.aniLen = 250
dropMenu.hideDelay = 1000
dropMenu.minCPUResolution = 10
// constructor




//fires on instantiation of each new menu object
function dropMenu(id, dir, left, top, width, height)
{
	this.ie = document.all ? 1 : 0
	this.ns4 = document.layers ? 1 : 0
	this.dom = document.getElementById ? 1 : 0
	if (this.ie || this.ns4 || this.dom) 
	{
		
		//alert ('height = ' + height + '   id=' + id)
		this.id = id
		this.dir = dir
		this.orientation = dir == "left" || dir == "right" ? "h" : "v"
		this.dirType = dir == "right" || dir == "down" ? "-" : "+"
		this.dim = this.orientation == "h" ? width : height
		this.hideTimer = false
		this.aniTimer = false
		this.open = false
		this.over = false
		this.startTime = 0
		this.gRef = "dropMenu_"+id
		eval(this.gRef+"=this")
		dropMenu.Registry[id] = this
		var d = document
		var strCSS = '<style type="text/css">';
		strCSS += '#' + this.id + 'Container { visibility:hidden; '
		strCSS += 'left:' + left + 'px; '
		strCSS += 'top:' + top + 'px; '
		strCSS += 'overflow:hidden; z-index:10000; }'
		strCSS += '#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; '
		strCSS += 'width:' + width + 'px; '
		strCSS += 'height:' + height + 'px; '
		strCSS += 'clip:rect(0 ' + width + ' ' + height + ' 0); '
		strCSS += '}'
		strCSS += '</style>'
		d.write(strCSS)
		this.load()
	}
}

dropMenu.prototype.load = function() 
{
	var d = document
	var lyrId1 = this.id + "Container"
	var lyrId2 = this.id + "Content"
	var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
	if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
	var temp
	if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
	else
	 {
		this.container = obj1
		this.menu = obj2
		this.style = this.ns4 ? this.menu : this.menu.style
		this.homePos = eval("0" + this.dirType + this.dim)
		this.outPos = 0
		this.accelConst = (this.outPos - this.homePos) / dropMenu.aniLen / dropMenu.aniLen 
		// set event handlers.
		if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
		this.menu.onmouseover = new Function("dropMenu.showMenu('" + this.id + "')")
		//this is what casey noted out.
		this.menu.onmouseout = new Function("dropMenu.hideMenu('" + this.id + "')")
		
		//set initial state
		this.endSlide()
	}
}

dropMenu.showMenu = function(id)
{
	var reg = dropMenu.Registry
	var obj = dropMenu.Registry[id]
	if (obj.container)
	{
		obj.over = true
		for (menu in reg) if (id != menu) dropMenu.hide(menu)
		if (obj.hideTimer) 
			{
				reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer)
		    }
		if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
	}
}

dropMenu.hideMenu = function(id)
{
    if(id=='events')
    {
       
	 	var obj = dropMenu.Registry[id]
		if (obj.container) {
		if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
		obj.hideTimer = window.setTimeout("dropMenu.hide('" + id + "')", dropMenu.hideDelay);
	}
	
}
}
dropMenu.hideAll = function()
{
var reg = dropMenu.Registry
for (menu in reg) {
dropMenu.hide(menu);
if (menu.hideTimer) window.clearTimeout(menu.hideTimer);
}
}
dropMenu.hide = function(id)
{
var obj = dropMenu.Registry[id]
obj.over = false
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = 0
if (obj.open && !obj.aniTimer) obj.startSlide(false)
}
dropMenu.prototype.startSlide = function(open) {
this[open ? "onactivate" : "ondeactivate"]()
this.open = open
if (open) this.setVisibility(true)
this.startTime = (new Date()).getTime() 
this.aniTimer = window.setInterval(this.gRef + ".slide()", dropMenu.minCPUResolution)
}
dropMenu.prototype.slide = function() {
var elapsed = (new Date()).getTime() - this.startTime
if (elapsed > dropMenu.aniLen) this.endSlide()
else {
var d = Math.round(Math.pow(dropMenu.aniLen-elapsed, 2) * this.accelConst)
if (this.open && this.dirType == "-") d = -d
else if (this.open && this.dirType == "+") d = -d
else if (!this.open && this.dirType == "-") d = -this.dim + d
else d = this.dim + d
this.moveTo(d)
}
}
dropMenu.prototype.endSlide = function() {
this.aniTimer = window.clearTimeout(this.aniTimer)
this.moveTo(this.open ? this.outPos : this.homePos)
if (!this.open) this.setVisibility(false)
if ((this.open && !this.over) || (!this.open && this.over)) {
this.startSlide(this.over)
}
}
dropMenu.prototype.setVisibility = function(bShow) { 
var s = this.ns4 ? this.container : this.container.style
s.visibility = bShow ? "visible" : "hidden"
}
dropMenu.prototype.moveTo = function(p) { 
this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : p + "px"
}
dropMenu.prototype.getPos = function(c) {
return parseInt(this.style[c])
}
dropMenu.prototype.onactivate = function() {}
dropMenu.prototype.ondeactivate = function() { }

<!-- Hide from old browsers
// Copyright &copy; 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
i = 17 // Number of banners that you have
banner1 = new Image();
banner1.src = "Images/bpsponsor_logo.png";
banner2 = new Image();
banner2.src = "Images/georexsponsor_logo.png";
banner3 = new Image();
banner3.src = "Images/anadarkosponsor_logo.png";
banner4 = new Image();
banner4.src = "Images/egisponsor_logo.png";
banner5 = new Image();
banner5.src = "Images/apachesponsor_logo.png";
banner6 = new Image();
banner6.src = "Images/oilandgassponsor_logo.png";
banner7 = new Image();
banner7.src = "Images/newfieldsponsor_logo.png";
banner8 = new Image();
banner8.src = "Images/nexensponsor_logo.png";
banner9 = new Image();
banner9.src = "Images/shellsponsor_logo.png";
banner10 = new Image();
banner10.src = "Images/cggveritassponsor_logo.png";
banner11 = new Image();
banner11.src = "Images/deloittesponsor_logo.png";
banner12 = new Image();
banner12.src = "Images/thundersponsor_logo.png";
banner13 = new Image();
banner13.src = "Images/remorasponsor_logo.png";
banner14 = new Image();
banner14.src = "Images/marathonsponsor_logo.png";
banner15 = new Image();
banner15.src = "Images/spectrumsponsor_logo.png";
banner16 = new Image();
banner16.src = "Images/vancosponsor_logo.png";
banner17 = new Image();
banner17.src = "Images/devonsponsor_logo.png";






links = new Array
links[1] = "http://www.bp.com"
links[2] = "http://www.georex.com"
links[3] = "http://www.anadarko.com"
links[4] = "http://www.egi.utah.edu"
links[5] = "http://www.apachecorp.com"
links[6] = "http://www.oilandgasinvestor.com"
links[7] = "http://www.newfield.com"
links[8] = "http://www.nexeninc.com"
links[9] = "http://www.shell.com"
links[10] = "http://www.cggveritas.com"
links[11] = "http://www.deloitte.com"
links[12] = "http://www.internationalpavilion.com"
links[13] = "http://www.remoraenergy.com"
links[14] = "http://www.marathon.com"
links[15] = "http://www.spectrumasa.com"
links[16] = "http://www.vancoenergy.com"
links[17] = "http://www.devonenergy.com"




description = new Array
description[1] = ""
description[2] = ""
description[3] = ""
description[4] = ""
description[5] = ""
description[6] = ""
description[7] = ""
description[8] = ""
description[9] = ""
description[10] = ""
description[11] = ""
description[12] = ""
description[13] = ""
description[14] = ""
description[15] = ""
description[16] = ""
description[17] = ""


function randombanner(){
var randomnumber = Math.random();
i = Math.round( (i - 1) * randomnumber) + 1;
document.banner.src = eval("banner" + i + ".src");
}
function startTime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=3;   
Timer();
}
function Timer(){

//alert(" banner timer")

var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 17){
i++;
document.banner.src = eval("banner" + i + ".src");
}
else{
i = 1;
document.banner.src = eval("banner" + i + ".src");
}
startTime();
}
else{
window.setTimeout("Timer()",1000)}
}
function clickLink(){
top.location = links[i]
}
function descript(){
window.status = description[i]
}







<!-- Hide from old browsers
// Copyright &copy; 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
i = 3 // Number of Rotate that you have
Rotate1 = new Image();
Rotate1.src = "Cutup/2009AnnualEvent_Rotate.gif";
Rotate2 = new Image();
Rotate2.src = "Cutup/2009InternationalEvent_Rotate.gif";
Rotate3 = new Image();
Rotate3.src = "Cutup/2010NAPEEvent_Rotate.gif";



Rotatelinks = new Array
Rotatelinks[1] = "annual.htm"
Rotatelinks[2] = "events.htm"
Rotatelinks[3] = "events.htm"



Rotatedescription = new Array
Rotatedescription[1] = ""
Rotatedescription[2] = ""
Rotatedescription[3] = ""


function randomRotate(){
var randomnumber = Math.random();
i = Math.round( (i - 1) * randomnumber) + 1;
document.Rotate.src = eval("Rotate" + i + ".src");
}
function RotatestartTime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=3;   
RotateTimer();
}
function RotateTimer(){

var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 3){
i++;
document.Rotate.src = eval("Rotate" + i + ".src");
}
else{
i = 1;
document.Rotate.src = eval("Rotate" + i + ".src");
}
RotatestartTime();
}
else{
window.setTimeout("RotateTimer()",1000)}
}
function RotateclickLink(){
top.location = Rotatelinks[i]
}
function Rotatedescript(){
window.status = Rotatedescription[i]
}










function offlink(id){
	//Main Menus
		document.all.item(id).style.color = "#000000"
		document.all.item(id).style.fontFamily = "Arial, Helvetica, sans-serif";
		document.all.item(id).style.fontSize = "12px";
		document.all.item(id).style.fontWeight = "normal";
}
function currentlink(id){
	//Main menus

		document.all.item(id).style.color = "#A43B22"
		document.all.item(id).style.fontFamily = "Arial, Helvetica, sans-serif";
		document.all.item(id).style.fontSize = "12px";
		document.all.item(id).style.fontWeight = "bold";		
	
}

function offlinksmaller(id){
	//Main Menus
		document.all.item(id).style.color = "#000000"
		document.all.item(id).style.fontFamily = "Arial, Helvetica, sans-serif";
		document.all.item(id).style.fontSize = "10px";
		document.all.item(id).style.fontWeight = "normal";
}
function currentlinksmaller(id){
	//Main menus

		document.all.item(id).style.color = "#A43B22"
		document.all.item(id).style.fontFamily = "Arial, Helvetica, sans-serif";
		document.all.item(id).style.fontSize = "10px";
		document.all.item(id).style.fontWeight = "normal";		
	
}