/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_hfrecc4 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_hfrecc4 = new Array("button1up_hfrecc4.png","button2up_hfrecc4.png","button3up_hfrecc4.png","button4up_hfrecc4.png","button5up_hfrecc4.png");

overSources_hfrecc4 = new Array("button1over_hfrecc4.png","button2over_hfrecc4.png","button3over_hfrecc4.png","button4over_hfrecc4.png","button5over_hfrecc4.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_hfrecc4 = new Array();
subInfo_hfrecc4[1] = new Array();
subInfo_hfrecc4[2] = new Array();
subInfo_hfrecc4[3] = new Array();
subInfo_hfrecc4[4] = new Array();
subInfo_hfrecc4[5] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo_hfrecc4[2][1] = new Array("About HFRECC","about.htm","");
subInfo_hfrecc4[2][2] = new Array("Contact Us","contact.htm","");
subInfo_hfrecc4[2][3] = new Array("Career Opportunities","career.htm","");
subInfo_hfrecc4[2][4] = new Array("Thoughts from the CEO","ceo.htm","");
subInfo_hfrecc4[2][5] = new Array("Organizational Chart","http://www.hfrecc.com/Organizationalchart.pdf","blank");
subInfo_hfrecc4[2][6] = new Array("HFRECC BYLAWS","bylaws.htm","");
subInfo_hfrecc4[2][7] = new Array("Articles of Incorporation","articles.htm","");
subInfo_hfrecc4[2][8] = new Array("Holiday Schedule","holiday.htm","");
subInfo_hfrecc4[2][9] = new Array("HFRECC Scholarships","scholarship.htm","");
subInfo_hfrecc4[2][10] = new Array("Youth Capital Tour","capitaltour.htm","");
subInfo_hfrecc4[2][11] = new Array("Electric Junction","electricjunction.htm","");
subInfo_hfrecc4[2][12] = new Array("Staff Webmail Log-In","staff.htm","");
subInfo_hfrecc4[2][13] = new Array("Policy Manual Online","policy.htm","");
subInfo_hfrecc4[2][14] = new Array("Title XI Info","title6.htm","");
subInfo_hfrecc4[2][15] = new Array("Annual Meeting","http://www.hfrecc.com/AMeeting.pdf","blank");







subInfo_hfrecc4[3][1] = new Array("Electrical Rates","rates.htm","");
subInfo_hfrecc4[3][2] = new Array("Online Bill Pay","billpay.htm","");
subInfo_hfrecc4[3][3] = new Array("Bank/Credit Card Draft","draft.htm","");
subInfo_hfrecc4[3][4] = new Array("General Information","general.htm","");
subInfo_hfrecc4[3][5] = new Array("Water Heater Program","waterheaterprogram.htm","");
subInfo_hfrecc4[3][6] = new Array("Heat Pump Program","heatpumps.htm","");
subInfo_hfrecc4[3][7] = new Array("Energy Audit","energyaudit.htm","");
subInfo_hfrecc4[3][8] = new Array("New Homes","newhomes.htm","");
subInfo_hfrecc4[3][9] = new Array("Trade-A-Tree Program","tradeatree.htm","");
subInfo_hfrecc4[3][10] = new Array("Security Lights","securitylights.htm","");
subInfo_hfrecc4[3][11] = new Array("Manufactured Home Info","manufacturedhome.htm","");
subInfo_hfrecc4[3][12] = new Array("Gift Certificates ","giftcertificates.htm","");
subInfo_hfrecc4[3][13] = new Array("TVA Fuel Cost Adjustment","tvafuel.htm","");








subInfo_hfrecc4[4][1] = new Array("Local Weather","weather.htm","");
subInfo_hfrecc4[4][2] = new Array("Connection Cards","http://www.connections.coop/","blank");
subInfo_hfrecc4[4][3] = new Array("Web Start Page","start.htm","");
subInfo_hfrecc4[4][4] = new Array("Kentucky Living Magazine","http://www.kentuckyliving.com/magazine/index.asp","blank");
subInfo_hfrecc4[4][5] = new Array("Kentucky AEC","http://www.kaec.org/","blank");
subInfo_hfrecc4[4][6] = new Array("TVA Energy Right","http://www.energyright.com/","blank");
subInfo_hfrecc4[4][7] = new Array("Hickman Chamber","http://www.hickmankychamber.org/","blank");
subInfo_hfrecc4[4][8] = new Array("Hickman County","http://www.hickmancounty.ky.gov/","blank");
subInfo_hfrecc4[4][9] = new Array("Carlisle County, Ky","http://carlislecounty.org/","blank");
subInfo_hfrecc4[4][10] = new Array("West Ky Economic","http://www.westkyeconomic.com/","blank");
subInfo_hfrecc4[4][11] = new Array("National RECA","http://www.nreca.org/","blank");
subInfo_hfrecc4[4][12] = new Array("Tn Valley Authority","http://www.tva.gov/","blank");
subInfo_hfrecc4[4][13] = new Array("Public Power Assn.","http://www.tvppa.com/","blank");
subInfo_hfrecc4[4][14] = new Array("Touchstone Energy","https://touchstoneenergy.cooperative.com/public/index.html","blank");
subInfo_hfrecc4[4][15] = new Array("Home Energy Saver","https://touchstoneenergy.cooperative.com/public/programs/energyefficiency/lblfiles/launch.htm","blank");
subInfo_hfrecc4[4][16] = new Array("Our Energy, Our Future","https://www.ourenergy.coop/","blank");
subInfo_hfrecc4[4][17] = new Array("Fulton Co Sheriff","http://www.fultoncountysheriff.net/","blank");








//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_hfrecc4 = 0;
var ySubOffset_hfrecc4 = 22;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_hfrecc4 = false;
var delay_hfrecc4 = 1000;
totalButtons_hfrecc4 = upSources_hfrecc4.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_hfrecc4; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_hfrecc4[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_hfrecc4">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_hfrecc4" class="dropmenu_hfrecc4" ');
		document.write('onMouseOver="overSub_hfrecc4=true;');
		document.write('setOverImg_hfrecc4(\'' + (x+1) + '\',\'_hfrecc4\');"');
		document.write('onMouseOut="overSub_hfrecc4=false;');
		document.write('setTimeout(\'hideSubMenu_hfrecc4(\\\'submenu' + (x+1) + '_hfrecc4\\\')\',delay_hfrecc4);');
		document.write('setOutImg_hfrecc4(\'' + (x+1) + '\',\'_hfrecc4\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_hfrecc4[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_hfrecc4[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_hfrecc4[x+1][k+1][2] + '">');
			document.write( subInfo_hfrecc4[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_hfrecc4() {
	for ( x=0; x<totalButtons_hfrecc4; x++ ) {
		buttonUp_hfrecc4 = new Image();
		buttonUp_hfrecc4.src = buttonFolder_hfrecc4 + upSources_hfrecc4[x];
		buttonOver_hfrecc4 = new Image();
		buttonOver_hfrecc4.src = buttonFolder_hfrecc4 + overSources_hfrecc4[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_hfrecc4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_hfrecc4 + overSources_hfrecc4[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_hfrecc4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_hfrecc4 + upSources_hfrecc4[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_hfrecc4(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_hfrecc4(id) { 
	var el = getElement_hfrecc4(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_hfrecc4(id) {
	var el = getElement_hfrecc4(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_hfrecc4(objectID,x,y) {
	var el = getElement_hfrecc4(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_hfrecc4(subID, buttonID) {
	hideAllSubMenus_hfrecc4();
	butX = getRealLeft_hfrecc4(buttonID);
	butY = getRealTop_hfrecc4(buttonID);
	moveObjectTo_hfrecc4(subID,butX+xSubOffset_hfrecc4, butY+ySubOffset_hfrecc4);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_hfrecc4() {
	for ( x=0; x<totalButtons_hfrecc4; x++) {
		moveObjectTo_hfrecc4("submenu" + (x+1) + "_hfrecc4",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_hfrecc4(subID) {
	if ( overSub_hfrecc4 == false ) {
		moveObjectTo_hfrecc4(subID,-500, -500);
	}
}



//preload_hfrecc4();

