/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_gas5 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_gas5 = new Array("button1up_gas5.png","button2up_gas5.png","button3up_gas5.png","button4up_gas5.png","button5up_gas5.png");

overSources_gas5 = new Array("button1over_gas5.png","button2over_gas5.png","button3over_gas5.png","button4over_gas5.png","button5over_gas5.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_gas5 = new Array();
subInfo_gas5[1] = new Array();
subInfo_gas5[2] = new Array();
subInfo_gas5[3] = new Array();
subInfo_gas5[4] = new Array();
subInfo_gas5[5] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo_gas5[2][1] = new Array("About GCUD","about.htm","");
subInfo_gas5[2][2] = new Array("Management","mgmt.htm","");
subInfo_gas5[2][3] = new Array("Commissioners","comm.htm","");
subInfo_gas5[2][4] = new Array("Holliday Closings","holliday.htm","");
subInfo_gas5[2][5] = new Array("Contact Us","contact.htm","");

subInfo_gas5[3][1] = new Array("Natural Gas","natgas.htm","");
subInfo_gas5[3][2] = new Array("Propane","propane.htm","");
subInfo_gas5[3][3] = new Array("Appliances","app.htm","");
subInfo_gas5[3][4] = new Array("Tariffs /Rates","tariffs.htm","");
subInfo_gas5[3][5] = new Array("Pmt. Options","payments.htm","");
subInfo_gas5[3][6] = new Array("Service Area","servicearea.htm","");

subInfo_gas5[4][1] = new Array("FAQ\'s","faqs.htm","");
subInfo_gas5[4][2] = new Array("Read Your Meter","meter.htm","");
subInfo_gas5[4][3] = new Array("AMR Program","amr.htm","");
subInfo_gas5[4][4] = new Array("Read Your Bill","billread.htm","");
subInfo_gas5[4][5] = new Array("Gas Safety","safety.htm","");
subInfo_gas5[4][6] = new Array("Energy Tips","etips.htm","");
subInfo_gas5[4][7] = new Array("Gas Links","gaslinks.htm","");
subInfo_gas5[4][8] = new Array("Community Links","links.htm","");
subInfo_gas5[4][9] = new Array("Before You Dig","dig.htm","");
subInfo_gas5[4][10] = new Array("Local Weather","weather.htm","");
subInfo_gas5[4][11] = new Array("News & Newsletter","news.htm","");



//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_gas5 = 0;
var ySubOffset_gas5 = 18;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_gas5 = false;
var delay_gas5 = 1000;
totalButtons_gas5 = upSources_gas5.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_gas5; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_gas5[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_gas5">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_gas5" class="dropmenu_gas5" ');
		document.write('onMouseOver="overSub_gas5=true;');
		document.write('setOverImg_gas5(\'' + (x+1) + '\',\'_gas5\');"');
		document.write('onMouseOut="overSub_gas5=false;');
		document.write('setTimeout(\'hideSubMenu_gas5(\\\'submenu' + (x+1) + '_gas5\\\')\',delay_gas5);');
		document.write('setOutImg_gas5(\'' + (x+1) + '\',\'_gas5\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_gas5[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_gas5[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_gas5[x+1][k+1][2] + '">');
			document.write( subInfo_gas5[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload_gas5() {
	for ( x=0; x<totalButtons_gas5; x++ ) {
		buttonUp_gas5 = new Image();
		buttonUp_gas5.src = buttonFolder_gas5 + upSources_gas5[x];
		buttonOver_gas5 = new Image();
		buttonOver_gas5.src = buttonFolder_gas5 + overSources_gas5[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_gas5(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_gas5 + overSources_gas5[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_gas5(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_gas5 + upSources_gas5[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_gas5(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_gas5(id) { 
	var el = getElement_gas5(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop_gas5(id) {
	var el = getElement_gas5(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo_gas5(objectID,x,y) {
	var el = getElement_gas5(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_gas5(subID, buttonID) {
	hideAllSubMenus_gas5();
	butX = getRealLeft_gas5(buttonID);
	butY = getRealTop_gas5(buttonID);
	moveObjectTo_gas5(subID,butX+xSubOffset_gas5, butY+ySubOffset_gas5);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_gas5() {
	for ( x=0; x<totalButtons_gas5; x++) {
		moveObjectTo_gas5("submenu" + (x+1) + "_gas5",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_gas5(subID) {
	if ( overSub_gas5 == false ) {
		moveObjectTo_gas5(subID,-500, -500);
	}
}



//preload_gas5();

