/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png","button15up.png","button16up.png","button17up.png","button18up.png","button19up.png","button20up.png","button21up.png","button22up.png","button23up.png","button24up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png","button8over.png","button9over.png","button10over.png","button11over.png","button12over.png","button13over.png","button14over.png","button15over.png","button16over.png","button17over.png","button18over.png","button19over.png","button20over.png","button21over.png","button22over.png","button23over.png","button24over.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();
subInfo[11] = new Array();
subInfo[12] = new Array();
subInfo[13] = new Array();
subInfo[14] = new Array();
subInfo[15] = new Array();
subInfo[16] = new Array();
subInfo[17] = new Array();
subInfo[18] = new Array();
subInfo[19] = new Array();
subInfo[20] = new Array();
subInfo[21] = new Array();
subInfo[22] = new Array();
subInfo[23] = new Array();
subInfo[24] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo[2][1] = new Array("Am. Topper & Accessories","ata.html","");
subInfo[2][2] = new Array("Bowman Body Shop","bowman.html","");
subInfo[2][3] = new Array("Butch\'s Auto and Tire","butch.html","");
subInfo[2][4] = new Array("Cliff\'s Truck World","cliffs.html","");
subInfo[2][5] = new Array("Dewey Ford","dewey.html","");
subInfo[2][6] = new Array("Holmes Chevrolet","holmes.html","");
subInfo[2][7] = new Array("I80 Truck Stop","I80.html","");
subInfo[2][8] = new Array("Karl Chevrolet","karl.html","");
subInfo[2][9] = new Array("Main Street Garage","main.html","");
subInfo[2][10] = new Array("Simon Tire","sim.html","");
subInfo[2][11] = new Array("Stew Hansen Dodge","sh.html","");
subInfo[2][12] = new Array("Stivers Ford","sti.html","");

subInfo[3][1] = new Array("Cedar Ridge Ranch","crranch.html","");
subInfo[3][2] = new Array("Haywire Farm","haywire.html","");
subInfo[3][3] = new Array("Hunters Glen","hunters.html","");
subInfo[3][4] = new Array("Irish Run Farm","irish.html","");
subInfo[3][5] = new Array("Jester Park","jes.html","");
subInfo[3][6] = new Array("Maffit Lake Farm","mlf.html","");
subInfo[3][7] = new Array("Prairie Ridge Ranch","prr.html","");
subInfo[3][8] = new Array("River Oaks Farm","rof.html","");
subInfo[3][9] = new Array("The Paddock","padd.html","");
subInfo[3][10] = new Array("Stagecoach Stables","stagecoach.html","");
subInfo[3][11] = new Array("Valley Park Stables","vps.html","");

subInfo[4][1] = new Array("Cedar Ridge Ranch","crranch.html","");
subInfo[4][2] = new Array("Flights of Fantasy Arabians","fof.html","");
subInfo[4][3] = new Array("Haywire Farm","haywire.html","");
subInfo[4][4] = new Array("NLSN Sporthorses","nls.html","");
subInfo[4][5] = new Array("River Oaks Farm","rof.html","");

subInfo[5][1] = new Array("AJ Allen","aja.html","");
subInfo[5][2] = new Array("Baker Electric","bak.html","");
subInfo[5][3] = new Array("Barker Implement","barker.html","");
subInfo[5][4] = new Array("Gilcrest/Jewett Lumber","gjl.html","");
subInfo[5][5] = new Array("Henning Construction","henning.html","");
subInfo[5][6] = new Array("Hicklin Power","hic.html","");
subInfo[5][7] = new Array("Mannatts","man.html","");
subInfo[5][8] = new Array("McKlveen Lumber","mck.html","");
subInfo[5][9] = new Array("Pro-Line","pro.html","");
subInfo[5][10] = new Array("Regency Commercial","rege.html","");
subInfo[5][11] = new Array("Star Equipment","star.html","");
subInfo[5][12] = new Array("Stetson Building Products","stetson.html","");
subInfo[5][13] = new Array("Vetter Equipment","vetter.html","");
subInfo[5][14] = new Array("Wes Jarnigan","wes.html","");

subInfo[6][1] = new Array("Destination Everywhere","dest.html","");
subInfo[6][2] = new Array("Family Center F & H","fcfh.html","");
subInfo[6][3] = new Array("Hilton Garden Inn","hilton.html","");
subInfo[6][4] = new Array("Iowa Cubs Baseball","icubs.html","");
subInfo[6][5] = new Array("Prairie Meadows","pm.html","");
subInfo[6][6] = new Array("Rusty Duck Restaurant","rustyd.html","");
subInfo[6][7] = new Array("Silver Spur Cafe and Bar","ssc.html","");
subInfo[6][8] = new Array("The Big Steer","steer.html","");
subInfo[6][9] = new Array("The Firken and Fox","firken.html","");
subInfo[6][10] = new Array("Timber Ridge Camping","trcamp.html","");
subInfo[6][11] = new Array("Willow Creek Golf","wcg.html","");

subInfo[7][1] = new Array("D Series Show Schedule","d.html","");
subInfo[7][2] = new Array("Good Luck Hannah","hannah.html","");
subInfo[7][3] = new Array("In Memory of Kaly","kaly.html","");
subInfo[7][4] = new Array("Iowa Horse Fair","ihc.html","");
subInfo[7][5] = new Array("Moingona Hunt Ball","ball.html","");
subInfo[7][6] = new Array("Warren Co. Shows","warren.html","");

subInfo[8][1] = new Array("Hensley Hoof Care","hens.html","");
subInfo[8][2] = new Array("Jerry Morgan","jmor.html","");

subInfo[9][1] = new Array("BB and P Feed & Grain","bbp.html","");
subInfo[9][2] = new Array("Brekkes","btc.html","");
subInfo[9][3] = new Array("Country Mile","cmile.html","");
subInfo[9][4] = new Array("Egli Feed and Supply","egli.html","");
subInfo[9][5] = new Array("Griffeon Farms","gri.html","");
subInfo[9][6] = new Array("Great Plains Dog Food","gpd.html","");
subInfo[9][7] = new Array("Heartland Co-op","hea.html","");
subInfo[9][8] = new Array("Kemin","kem.html","");
subInfo[9][9] = new Array("Kent Feed","kent.html","");
subInfo[9][10] = new Array("Orscheln","orsch.html","");
subInfo[9][11] = new Array("Peck\'s Feed and Supply","pec.html","");
subInfo[9][12] = new Array("RC Welding and Hay","rc.html","");
subInfo[9][13] = new Array("Reynolds Feed Service","rey.html","");
subInfo[9][14] = new Array("Redfield Feeds","red.html","");

subInfo[10][1] = new Array("Gilcrest/Jewett Lumber","gjl.html","");
subInfo[10][2] = new Array("J and L Fence","jlf.html","");
subInfo[10][3] = new Array("McKlveen Lumber","mck.html","");
subInfo[10][4] = new Array("Kneuper Fencing","kne.html","");
subInfo[10][5] = new Array("Sund\'s Custom Fencing","scf.html","");

subInfo[11][1] = new Array("American National Ins.","amnat.html","");
subInfo[11][2] = new Array("Berthel Fisher","bfish.html","");
subInfo[11][3] = new Array("Colburn & Son","col.html","");
subInfo[11][4] = new Array("Ebank","eba.html","");
subInfo[11][5] = new Array("Holmes Murphy","holmesm.html","");
subInfo[11][6] = new Array("Krist Insurance","krist.html","");
subInfo[11][7] = new Array("Joseph S. Coy","coy.html","");
subInfo[11][8] = new Array("Sommers Danforth","sdanf.html","");

subInfo[12][1] = new Array("Astro Eyes","astro.html","");
subInfo[12][2] = new Array("Body Detox Center","kimheal.html","");
subInfo[12][3] = new Array("Louise Convery, DO","lou.html","");

subInfo[13][1] = new Array("Ellsworth Community Col.","ell.html","");

subInfo[14][1] = new Array("Augustine Tree Farm","aug.html","");
subInfo[14][2] = new Array("Barbara Hall Equine Art","bhall.html","");
subInfo[14][3] = new Array("Blue Horse Enterprizes","blue.html","");
subInfo[14][4] = new Array("Designing Women","des.html","");
subInfo[14][5] = new Array("Fredericks Tailor/Cleaners","ftc.html","");
subInfo[14][6] = new Array("Goode Greenhouses","goode.html","");
subInfo[14][7] = new Array("Larry\'s Window Service","lar.html","");
subInfo[14][8] = new Array("Maynard Reece Gallery","may.html","");
subInfo[14][9] = new Array("Service Master","ser.html","");
subInfo[14][10] = new Array("Tire Swing Taxidermy","tire.html","");
subInfo[14][11] = new Array("Wes Jarnigan","wes.html","");

subInfo[15][1] = new Array("Whitfield and Eddy","whi.html","");

subInfo[16][1] = new Array("Carpenter Uniform","carp.html","");
subInfo[16][2] = new Array("Diamond D Graphic","diamond.html","");
subInfo[16][3] = new Array("It\'s a Tiff Media Design","tiff.html","");
subInfo[16][4] = new Array("Mdesign","mdes.html","");
subInfo[16][5] = new Array("Thunder Road Embroidery","tre.html","");

subInfo[17][1] = new Array("The Moingona Hunt","tmh.html","");
subInfo[17][2] = new Array("AQHA","aqha.html","");
subInfo[17][3] = new Array("Iowa Land Conservancy","ilc.html","");
subInfo[17][4] = new Array("IA Buckskin Horse Ass.","ibh.html","");
subInfo[17][5] = new Array("IA Thoroughbred Ass.","itboa.html","");
subInfo[17][6] = new Array("Miracles in Motion","mim.html","");
subInfo[17][7] = new Array("Timber Ridge Pony Club","trpc.html","");

subInfo[18][1] = new Array("Apples \'n Oats","ano.html","");

subInfo[19][1] = new Array("Hickman Properties","hickman.html","");
subInfo[19][2] = new Array("Kevin Sandquist","kev.html","");

subInfo[20][1] = new Array("Dehner Boots","deh.html","");
subInfo[20][2] = new Array("Equi-spa","equi.html","");
subInfo[20][3] = new Array("Edge Pro","edge.html","");
subInfo[20][4] = new Array("Family Center F & H","fcfh.html","");
subInfo[20][5] = new Array("Hawkeye Tack","haw.html","");
subInfo[20][6] = new Array("Hillview Farms","hillv.html","");
subInfo[20][7] = new Array("Leather Plus and Repair","lpr.html","");
subInfo[20][8] = new Array("Nymeyers at Tanglewood","nym.html","");
subInfo[20][9] = new Array("Regg and Wally\'s","reg.html","");
subInfo[20][10] = new Array("The Paddock","pad.html","");
subInfo[20][11] = new Array("Veach\'s","vea.html","");
subInfo[20][12] = new Array("Western Edge","west.html","");

subInfo[21][1] = new Array("Arena Trailer Sales","are.html","");
subInfo[21][2] = new Array("Central Iowa Featherlite","cen.html","");
subInfo[21][3] = new Array("Duba\'s Trailer Customizing","duba.html","");
subInfo[21][4] = new Array("Hinshaw Trailer Sales","hin.html","");
subInfo[21][5] = new Array("Jaykee Trailer Repair","jayk.html","");
subInfo[21][6] = new Array("KES Customizing","kes.html","");
subInfo[21][7] = new Array("Northwest Trailer","nwt.html","");
subInfo[21][8] = new Array("Schuling Hitch","schul.html","");
subInfo[21][9] = new Array("Sundowner of MN","sundmn.html","");
subInfo[21][10] = new Array("Twin Cities Featherlite","tcf.html","");
subInfo[21][11] = new Array("Winterview Trailers","winter.html","");
subInfo[21][12] = new Array("Wright-Way Trailers","ww.html","");

subInfo[22][1] = new Array("3G Farms","3g.html","");
subInfo[22][2] = new Array("Davis Ranch","davis.html","");
subInfo[22][3] = new Array("Field Day","fd.html","");
subInfo[22][4] = new Array("Hunter\'s Glen","hunters.html","");
subInfo[22][5] = new Array("Irish Run Farm","irish.html","");
subInfo[22][6] = new Array("Jester Park","jes.html","");
subInfo[22][7] = new Array("Maffit Lake Farm","mlf.html","");
subInfo[22][8] = new Array("Stagecoach Stables","stagecoach.html","");

subInfo[23][1] = new Array("A Limousine","ali.html","");
subInfo[23][2] = new Array("Okoboji Trasnport","oko.html","");

subInfo[24][1] = new Array("Abrahams Equine","abr.html","");
subInfo[24][2] = new Array("Equine Referral Clinic","eref.html","");
subInfo[24][3] = new Array("Ft. Dodge Animal Health","fdah.html","");
subInfo[24][4] = new Array("Heartland Acupuncture","heartl.html","");
subInfo[24][5] = new Array("ISU Equine Services","isu.html","");
subInfo[24][6] = new Array("Midwest Vet Supply","mvs.html","");
subInfo[24][7] = new Array("Pheasant Ridge","phe.html","");
subInfo[24][8] = new Array("Roy Kipper","roy.html","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 123;
var ySubOffset = 3;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[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() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(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(id) {
	var el = getElement(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(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

