/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_Shopping = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_Shopping = new Array("button1up_Shopping.png","button2up_Shopping.png","button3up_Shopping.png","button4up_Shopping.png","button5up_Shopping.png");

overSources_Shopping = new Array("button1over_Shopping.png","button2over_Shopping.png","button3over_Shopping.png","button4over_Shopping.png","button5over_Shopping.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_Shopping = new Array();
subInfo_Shopping[1] = new Array();
subInfo_Shopping[2] = new Array();
subInfo_Shopping[3] = new Array();
subInfo_Shopping[4] = new Array();
subInfo_Shopping[5] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_Shopping[1][1] = new Array("Baseball","Baseball Albums.html","_self");
subInfo_Shopping[1][2] = new Array("Other Sports","Sports Albums.html","_self");
subInfo_Shopping[1][3] = new Array("Misc.","Supplies.html","_self");

subInfo_Shopping[2][1] = new Array("Baseball","Paper.html","_self");
subInfo_Shopping[2][2] = new Array("Other Sports","Paper.html","_self");
subInfo_Shopping[2][3] = new Array("Misc.","Supplies.html","_self");

subInfo_Shopping[3][1] = new Array("Baseball","Supplies.html","_self");
subInfo_Shopping[3][2] = new Array("Other Sports","Supplies.html","_self");
subInfo_Shopping[3][3] = new Array("Misc.","Supplies.html","_self");




//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_Shopping = 121;
var ySubOffset_Shopping = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_Shopping = false;
var delay_Shopping = 1000;
totalButtons_Shopping = upSources_Shopping.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_Shopping; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_Shopping[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_Shopping">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_Shopping" class="dropmenu_Shopping" ');
		document.write('onMouseOver="overSub_Shopping=true;');
		document.write('setOverImg_Shopping(\'' + (x+1) + '\',\'_Shopping\');"');
		document.write('onMouseOut="overSub_Shopping=false;');
		document.write('setTimeout(\'hideSubMenu_Shopping(\\\'submenu' + (x+1) + '_Shopping\\\')\',delay_Shopping);');
		document.write('setOutImg_Shopping(\'' + (x+1) + '\',\'_Shopping\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_Shopping[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_Shopping[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_Shopping[x+1][k+1][2] + '">');
			document.write( subInfo_Shopping[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_Shopping() {
	for ( x=0; x<totalButtons_Shopping; x++ ) {
		buttonUp_Shopping = new Image();
		buttonUp_Shopping.src = buttonFolder_Shopping + upSources_Shopping[x];
		buttonOver_Shopping = new Image();
		buttonOver_Shopping.src = buttonFolder_Shopping + overSources_Shopping[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_Shopping(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_Shopping + overSources_Shopping[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_Shopping(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_Shopping + upSources_Shopping[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_Shopping(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_Shopping(id) { 
	var el = getElement_Shopping(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_Shopping(id) {
	var el = getElement_Shopping(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_Shopping(objectID,x,y) {
	var el = getElement_Shopping(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_Shopping(subID, buttonID) {
	hideAllSubMenus_Shopping();
	butX = getRealLeft_Shopping(buttonID);
	butY = getRealTop_Shopping(buttonID);
	moveObjectTo_Shopping(subID,butX+xSubOffset_Shopping, butY+ySubOffset_Shopping);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_Shopping() {
	for ( x=0; x<totalButtons_Shopping; x++) {
		moveObjectTo_Shopping("submenu" + (x+1) + "_Shopping",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_Shopping(subID) {
	if ( overSub_Shopping == false ) {
		moveObjectTo_Shopping(subID,-500, -500);
	}
}



//preload_Shopping();

