﻿// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 


// Added function for the box links on the home page (12/29/08 tmcmillan)

	function switchBG(obj,bMouseOver)
	{
	    // to use this, add the following attributes to each object whose mouseover/out you want to affect:
	    
	    // onmouseover="javascript:return switchBG(this,true);" onmouseout="javascript:return switchBG(this,false)";
	    
	    if(bMouseOver)
	    {
	        obj.style.backgroundColor = "white";
  	    }
	    else
	    {
	        obj.style.backgroundColor = "";
	    }
	    
	    return true;
	}

// Banner Image Rotator script (2/11/2009 tmcmillan)

var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '/images/jBanner/PhotoBar1.jpg'
theImages[1] = '/images/jBanner/PhotoBar2.jpg'
theImages[2] = '/images/jBanner/PhotoBar3.jpg'
theImages[3] = '/images/jBanner/PhotoBar4.jpg'
theImages[4] = '/images/jBanner/PhotoBar5.jpg'
theImages[5] = '/images/jBanner/PhotoBar6.jpg'
theImages[6] = '/images/jBanner/PhotoBar7.jpg'
theImages[7] = '/images/jBanner/PhotoBar8.jpg'
theImages[8] = '/images/jBanner/PhotoBar9.jpg'
theImages[9] = '/images/jBanner/PhotoBar10.jpg'
theImages[10] = '/images/jBanner/PhotoBar11.jpg'
theImages[11] = '/images/jBanner/PhotoBar12.jpg'
theImages[12] = '/images/jBanner/PhotoBar13.jpg'
theImages[13] = '/images/jBanner/PhotoBar14.jpg'
theImages[14] = '/images/jBanner/PhotoBar15.jpg'
theImages[15] = '/images/jBanner/PhotoBar16.jpg'
theImages[16] = '/images/jBanner/PhotoBar17.jpg'

var altInfo = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

altInfo[0] = 'Greg Parker, President, Gregory M. Parker, Inc.'
altInfo[1] = 'Sonja Hubbard, CEO, E-Z Mart Stores, Inc.'
altInfo[2] = 'Gus Olympidis, President & CEO, Family Express Corporation'
altInfo[3] = 'Scott Hartman, President & CEO, Rutters Farm Stores'
altInfo[4] = 'Jana Callier, IT Manager, American General Investments, LLC'
altInfo[5] = 'Tom Robinson, President, Robinson Oil Company'
altInfo[6] = 'John MacDougall, President & CEO, Fran Duskiewicz, Sr. Exec. Vice President, Nice N Easy Grocery Shoppes, Inc.'
altInfo[7] = 'Cheryl Thomas, Vice President Retail Systems, Valero Services, Inc.'
altInfo[8] = 'Ben Jatlow, Director of Information Technology, Highs of Baltimore, Inc.'
altInfo[9] = 'Mark Kelly, Dir. Application Services, Holiday Stationstores, Inc.'
altInfo[10] = 'Lisa Taylor, Office Manager/IT, Wadsworth Oil Co. of Clanton, Inc.'
altInfo[11] = 'Bud Young, Finance Director, Freds Minit Mart, LLC.'
altInfo[12] = 'Jay Ricker, CEO, Quinn Ricker, Director of Operations, Ricker Oil Company, Inc.'
altInfo[13] = 'Chris Pirozzi, Controller, Petr-all Petroleum Corporation'
altInfo[14] = 'Kym Howe, Vice President IT, Kum & Go, L.C.'
altInfo[15] = 'Carl Boyett, CEO, Dale Boyett, President, Boyett Petroleum'
altInfo[16] = 'Jamie Larson, Controller, PetroTex Fuels, Inc.'


// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var rotImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[rotImage]+'" alt="'+altInfo[rotImage]+'" title="'+altInfo[rotImage]+'">');
}

