/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.gif","button2up.gif","button3up.gif","button4up.gif","button5up.gif","button6up.gif","button7up.gif","button8up.gif","button9up.gif","button10up.gif","button11up.gif","button12up.gif","button13up.gif","button14up.gif","button15up.gif","button16up.gif","button17up.gif","button18up.gif","button19up.gif","button20up.gif","button21up.gif","button22up.gif","button23up.gif","button24up.gif","button25up.gif","button26up.gif","button27up.gif","button28up.gif","button29up.gif");

overSources = new Array("button1over.gif","button2over.gif","button3over.gif","button4over.gif","button5over.gif","button6over.gif","button7over.gif","button8over.gif","button9over.gif","button10over.gif","button11over.gif","button12over.gif","button13over.gif","button14over.gif","button15over.gif","button16over.gif","button17over.gif","button18over.gif","button19over.gif","button20over.gif","button21over.gif","button22over.gif","button23over.gif","button24over.gif","button25over.gif","button26over.gif","button27over.gif","button28over.gif","button29over.gif");

// 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();
subInfo[25] = new Array();
subInfo[26] = new Array();
subInfo[27] = new Array();
subInfo[28] = new Array();
subInfo[29] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo[1][1] = new Array(" Handbags","http://www.onestopwonders.com/accessories/Handbags.htm","");
subInfo[1][2] = new Array(" Jewelry","http://www.onestopwonders.com/accessories/Jewelry.htm","");
subInfo[1][3] = new Array(" Shoes","http://www.onestopwonders.com/accessories/Shoes.htm","");

subInfo[2][1] = new Array(" Art","http://www.onestopwonders.com/artphotomusic/Art.htm","");
subInfo[2][2] = new Array(" Music","http://www.onestopwonders.com/artphotomusic/Music.htm","");
subInfo[2][3] = new Array(" Photo","http://www.onestopwonders.com/artphotomusic/Photo.htm","");

subInfo[3][1] = new Array(" Cars and Trucks","http://www.onestopwonders.com/automotive/Cars&Trucks.htm","");
subInfo[3][2] = new Array(" Motorcycles","http://www.onestopwonders.com/automotive/Motorcycles.htm","");
subInfo[3][3] = new Array(" Parts and Accessories","http://www.onestopwonders.com/automotive/Parts&Accessories.htm","");
subInfo[3][4] = new Array(" Rentals","http://www.onestopwonders.com/automotive/Rentals.htm","");
subInfo[3][5] = new Array(" Tools & Supplies","http://www.onestopwonders.com/automotive/Tools&Supplies.htm","");

subInfo[4][1] = new Array(" Bath & Body","http://www.onestopwonders.com/beauty/Bath&Body.htm","");
subInfo[4][2] = new Array(" Cosmetics","http://www.onestopwonders.com/beauty/Cosmetics.htm","");
subInfo[4][3] = new Array(" Fragrance","http://www.onestopwonders.com/beauty/Fragrance.htm","");

subInfo[5][1] = new Array(" Audio Books","http://www.onestopwonders.com/books&media/Audio_Books.htm","");
subInfo[5][2] = new Array(" Books","http://www.onestopwonders.com/books&media/Books.htm","");
subInfo[5][3] = new Array(" Magazines","http://www.onestopwonders.com/books&media/Magazines.htm","");
subInfo[5][4] = new Array(" News","http://www.onestopwonders.com/books&media/News.htm","");
subInfo[5][5] = new Array(" Television","http://www.onestopwonders.com/books&media/Television.htm","");
subInfo[5][6] = new Array(" Videos/Movies","http://www.onestopwonders.com/books&media/Videos_Movies.htm","");

subInfo[6][1] = new Array(" Business-to-Business","http://www.onestopwonders.com/business/Business-to-Business.htm","");
subInfo[6][2] = new Array(" Marketing","http://www.onestopwonders.com/business/Marketing.htm","");
subInfo[6][3] = new Array(" Office","http://www.onestopwonders.com/business/Office.htm","");
subInfo[6][4] = new Array(" Productivity Tools","http://www.onestopwonders.com/business/Productivity_Tools.htm","");
subInfo[6][5] = new Array(" Travel","http://www.onestopwonders.com/business/Travel.htm","");

subInfo[7][1] = new Array(" Auction","http://www.onestopwonders.com/buying&selling/Auction.htm","");
subInfo[7][2] = new Array(" Classifieds","http://www.onestopwonders.com/buying&selling/Classifieds.htm","");
subInfo[7][3] = new Array(" E-commerce Solutions/Providers","http://www.onestopwonders.com/buying&selling/E-commerce_Solutions_Providers.htm","");
subInfo[7][4] = new Array(" New/Used Goods","http://www.onestopwonders.com/buying&selling/New_Used_Goods.htm","");

subInfo[8][1] = new Array(" Employment","http://www.onestopwonders.com/careers/Employment.htm","");
subInfo[8][2] = new Array(" Military Careers","http://www.onestopwonders.com/careers/Military.htm","");

subInfo[9][1] = new Array(" Children\'s Clothing","http://www.onestopwonders.com/clothing&apparel/Childrens_Clothing.htm","");
subInfo[9][2] = new Array(" Malls","http://www.onestopwonders.com/clothing&apparel/Malls.htm","");
subInfo[9][3] = new Array(" Men\'s Clothing","http://www.onestopwonders.com/clothing&apparel/Mens_Clothing.htm","");
subInfo[9][4] = new Array(" Women\'s Clothing","http://www.onestopwonders.com/clothing&apparel/Womens_Clothing.htm","");

subInfo[10][1] = new Array(" Computer Support","http://www.onestopwonders.com/computers&electronics/Computer_Support.htm","");
subInfo[10][2] = new Array(" Computer Hardware","http://www.onestopwonders.com/computers&electronics/ComputerHW.htm","");
subInfo[10][3] = new Array(" Computer Software","http://www.onestopwonders.com/computers&electronics/ComputerSW.htm","");
subInfo[10][4] = new Array(" Consumer Electronics","http://www.onestopwonders.com/computers&electronics/Consumer_Electronics.htm","");
subInfo[10][5] = new Array(" Peripherals","http://www.onestopwonders.com/computers&electronics/Peripherals.htm","");

subInfo[11][1] = new Array(" Children\'s Education","http://www.onestopwonders.com/education/Children.htm","");
subInfo[11][2] = new Array(" College","http://www.onestopwonders.com/education/College.htm","");
subInfo[11][3] = new Array(" Languages","http://www.onestopwonders.com/education/Languages.htm","");
subInfo[11][4] = new Array(" Professional Education","http://www.onestopwonders.com/education/Professional.htm","");

subInfo[12][1] = new Array(" Discounts","http://www.onestopwonders.com/entertainment/Discounts.htm","");
subInfo[12][2] = new Array(" Events","http://www.onestopwonders.com/entertainment/Events.htm","");
subInfo[12][3] = new Array(" Guides","http://www.onestopwonders.com/entertainment/Guides.htm","");
subInfo[12][4] = new Array(" Memorabilia","http://www.onestopwonders.com/entertainment/Memorabilia.htm","");
subInfo[12][5] = new Array(" Mobile Entertainment","http://www.onestopwonders.com/entertainment/Mobile_Entertainment.htm","");
subInfo[12][6] = new Array(" Party Goods","http://www.onestopwonders.com/entertainment/Party_Goods.htm","");

subInfo[13][1] = new Array(" Babies","http://www.onestopwonders.com/family/Babies.htm","");
subInfo[13][2] = new Array(" Children","http://www.onestopwonders.com/family/Children.htm","");
subInfo[13][3] = new Array(" Entertainment","http://www.onestopwonders.com/family/Entertainment.htm","");
subInfo[13][4] = new Array(" Teens","http://www.onestopwonders.com/family/Teens.htm","");
subInfo[13][5] = new Array(" Weddings","http://www.onestopwonders.com/family/Weddings.htm","");

subInfo[14][1] = new Array(" Banking/Trading","http://www.onestopwonders.com/financialservices/Banking_Trading.htm","");
subInfo[14][2] = new Array(" Credit Cards","http://www.onestopwonders.com/financialservices/Credit_Cards.htm","");
subInfo[14][3] = new Array(" Credit Reporting and Repair","http://www.onestopwonders.com/financialservices/Credit_Reporting&Repair.htm","");
subInfo[14][4] = new Array(" Investment","http://www.onestopwonders.com/financialservices/Investment.htm","");
subInfo[14][5] = new Array(" Mortgage Loans","http://www.onestopwonders.com/financialservices/Mortgage_Loans.htm","");
subInfo[14][6] = new Array(" Personal Loans","http://www.onestopwonders.com/financialservices/Personal_Loans.htm","");
subInfo[14][7] = new Array(" Real Estate Services","http://www.onestopwonders.com/financialservices/Real_Estate_Services.htm","");
subInfo[14][8] = new Array(" Tax Services","http://www.onestopwonders.com/financialservices/Tax_Services.htm","");

subInfo[15][1] = new Array(" Gourmet","http://www.onestopwonders.com/food&drinks/Gourmet.htm","");
subInfo[15][2] = new Array(" Groceries","http://www.onestopwonders.com/food&drinks/Groceries.htm","");
subInfo[15][3] = new Array(" Restaurants","http://www.onestopwonders.com/food&drinks/Restaurants.htm","");
subInfo[15][4] = new Array(" Wine & Spirits","http://www.onestopwonders.com/food&drinks/Wine&Spirits.htm","");

subInfo[16][1] = new Array(" Electronic Games","http://www.onestopwonders.com/games&toys/Electronic_Games.htm","");
subInfo[16][2] = new Array(" Electronic Toys","http://www.onestopwonders.com/games&toys/Electronic_Toys.htm","");
subInfo[16][3] = new Array(" Games","http://www.onestopwonders.com/games&toys/Games.htm","");
subInfo[16][4] = new Array(" Toys","http://www.onestopwonders.com/games&toys/Toys.htm","");

subInfo[17][1] = new Array(" Collectibles","http://www.onestopwonders.com/gifts&flowers/Collectibles.htm","");
subInfo[17][2] = new Array(" Flowers","http://www.onestopwonders.com/gifts&flowers/Flowers.htm","");
subInfo[17][3] = new Array(" Gifts","http://www.onestopwonders.com/gifts&flowers/Gifts.htm","");
subInfo[17][4] = new Array(" Greeting Cards","http://www.onestopwonders.com/gifts&flowers/Greeting_Cards.htm","");

subInfo[18][1] = new Array(" Equipment","http://www.onestopwonders.com/health&wellness/Equipment.htm","");
subInfo[18][2] = new Array(" Health Food ","http://www.onestopwonders.com/health&wellness/Health_Food.htm","");
subInfo[18][3] = new Array(" Nutritional Supplements","http://www.onestopwonders.com/health&wellness/Nutritional_Supplements.htm","");
subInfo[18][4] = new Array(" Pharmaceuticals","http://www.onestopwonders.com/health&wellness/Pharmaceuticals.htm","");
subInfo[18][5] = new Array(" Self Help","http://www.onestopwonders.com/health&wellness/Self_Help.htm","");
subInfo[18][6] = new Array(" Vision Care ","http://www.onestopwonders.com/health&wellness/Vision_Care.htm","");
subInfo[18][7] = new Array(" Weight Loss ","http://www.onestopwonders.com/health&wellness/Weight_Loss.htm","");
subInfo[18][8] = new Array(" Wellness","http://www.onestopwonders.com/health&wellness/Wellness.htm","");

subInfo[19][1] = new Array(" Bed & Bath","http://www.onestopwonders.com/home&garden/Bed&Bath.htm","");
subInfo[19][2] = new Array(" Construction","http://www.onestopwonders.com/home&garden/Construction.htm","");
subInfo[19][3] = new Array(" Furniture","http://www.onestopwonders.com/home&garden/Furniture.htm","");
subInfo[19][4] = new Array(" Garden","http://www.onestopwonders.com/home&garden/Garden.htm","");
subInfo[19][5] = new Array(" Home Appliances","http://www.onestopwonders.com/home&garden/Home_Appliances.htm","");
subInfo[19][6] = new Array(" Kitchen","http://www.onestopwonders.com/home&garden/Kitchen.htm","");
subInfo[19][7] = new Array(" Pets","http://www.onestopwonders.com/home&garden/Pets.htm","");
subInfo[19][8] = new Array(" Real Estate","http://www.onestopwonders.com/home&garden/Real_Estate.htm","");
subInfo[19][9] = new Array(" Utilities","http://www.onestopwonders.com/home&garden/Utilities.htm","");

subInfo[20][1] = new Array(" Commercial Insurance","http://www.onestopwonders.com/insurance/Commercial.htm","");
subInfo[20][2] = new Array(" Personal Insurance","http://www.onestopwonders.com/insurance/Personal_Insurance.htm","");

subInfo[21][1] = new Array(" Legal Services","http://www.onestopwonders.com/legal/Services.htm","");

subInfo[22][1] = new Array(" Business-to-Business","http://www.onestopwonders.com/marketing/Business-to-Business.htm","");
subInfo[22][2] = new Array(" Network Marketing","http://www.onestopwonders.com/marketing/Network_Marketing.htm","");

subInfo[23][1] = new Array(" Charitable Organizations","http://www.onestopwonders.com/nonprofit/Charitable_Organizations.htm","");
subInfo[23][2] = new Array(" Fundraising","http://www.onestopwonders.com/nonprofit/Fundraising.htm ","");

subInfo[24][1] = new Array(" Blogs","http://www.onestopwonders.com/onlineservices/Blogs.htm","");
subInfo[24][2] = new Array(" Broadband","http://www.onestopwonders.com/onlineservices/Broadband.htm","");
subInfo[24][3] = new Array(" Domain Registrations","http://www.onestopwonders.com/onlineservices/Domain_Registrations.htm","");
subInfo[24][4] = new Array(" Email Marketing","http://www.onestopwonders.com/onlineservices/Email_Marketing.htm","");
subInfo[24][5] = new Array(" Internet Service Providers","http://www.onestopwonders.com/onlineservices/Internet_Service_Providers.htm","");
subInfo[24][6] = new Array(" Search Engine","http://www.onestopwonders.com/onlineservices/Search_Engine.htm","");
subInfo[24][7] = new Array(" Web Design ","http://www.onestopwonders.com/onlineservices/Web_Design.htm","");
subInfo[24][8] = new Array(" Web Hosting/Servers","http://www.onestopwonders.com/onlineservices/Web_Hosting_Servers.htm","");
subInfo[24][9] = new Array(" Web Tools","http://www.onestopwonders.com/onlineservices/Web_Tools.htm","");

subInfo[25][1] = new Array(" Astrology","http://www.onestopwonders.com/recreation&leisure/Astrology.htm","");
subInfo[25][2] = new Array(" Betting/Gaming ","http://www.onestopwonders.com/recreation&leisure/Betting_Gaming.htm","");
subInfo[25][3] = new Array(" Camping and Hiking","http://www.onestopwonders.com/recreation&leisure/Camping&Hiking.htm","");
subInfo[25][4] = new Array(" Communities","http://www.onestopwonders.com/recreation&leisure/Communities.htm","");
subInfo[25][5] = new Array(" Matchmaking","http://www.onestopwonders.com/recreation&leisure/Matchmaking.htm","");
subInfo[25][6] = new Array(" Outdoors","http://www.onestopwonders.com/recreation&leisure/Outdoors.htm","");
subInfo[25][7] = new Array(" Tobacco","http://www.onestopwonders.com/recreation&leisure/Tobacco.htm","");

subInfo[26][1] = new Array(" Virtual Malls","http://www.onestopwonders.com/shops&malls/Virtual_Malls.htm","");

subInfo[27][1] = new Array(" Apparel","http://www.onestopwonders.com/sports&fitness/Apparel.htm","");
subInfo[27][2] = new Array(" Collectibles & Memorabilia","http://www.onestopwonders.com/sports&fitness/Collectibles&Memorabilia.htm","");
subInfo[27][3] = new Array(" Equipment","http://www.onestopwonders.com/sports&fitness/Equipment.htm","");
subInfo[27][4] = new Array(" Exercise & Health","http://www.onestopwonders.com/sports&fitness/Exercise&Health.htm","");
subInfo[27][5] = new Array(" Golf","http://www.onestopwonders.com/sports&fitness/Golf.htm","");
subInfo[27][6] = new Array(" Sports ","http://www.onestopwonders.com/sports&fitness/Sports.htm","");
subInfo[27][7] = new Array(" Summer Sports","http://www.onestopwonders.com/sports&fitness/Summer_Sports.htm","");
subInfo[27][8] = new Array(" Water Sports","http://www.onestopwonders.com/sports&fitness/Water_Sports.htm","");
subInfo[27][9] = new Array(" Winter Sports","http://www.onestopwonders.com/sports&fitness/Winter_Sports.htm","");

subInfo[28][1] = new Array(" Online/Wireless","http://www.onestopwonders.com/telecommunications/Online_Wireless.htm","");
subInfo[28][2] = new Array(" Phone Card Services","http://www.onestopwonders.com/telecommunications/Phone_Card_Services.htm","");
subInfo[28][3] = new Array(" Telephone Services","http://www.onestopwonders.com/telecommunications/Telephone_Services.htm","");

subInfo[29][1] = new Array(" Accessories","http://www.onestopwonders.com/travel/Accessories.htm","");
subInfo[29][2] = new Array(" Air Travel","http://www.onestopwonders.com/travel/Air_Travel.htm","");
subInfo[29][3] = new Array(" Car","http://www.onestopwonders.com/travel/Car.htm","");
subInfo[29][4] = new Array(" Hotel","http://www.onestopwonders.com/travel/Hotel.htm","");
subInfo[29][5] = new Array(" Luggage","http://www.onestopwonders.com/travel/Luggage.htm","");
subInfo[29][6] = new Array(" Vacation","http://www.onestopwonders.com/travel/Vacation.htm","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 117;
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();

