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

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_espanol = new Array("button1up_espanol.gif","button2up_espanol.gif","button3up_espanol.gif","button4up_espanol.gif","button5up_espanol.gif","button6up_espanol.gif","button7up_espanol.gif","button8up_espanol.gif");

overSources_espanol = new Array("button1over_espanol.gif","button2over_espanol.gif","button3over_espanol.gif","button4over_espanol.gif","button5over_espanol.gif","button6over_espanol.gif","button7over_espanol.gif","button8over_espanol.gif");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_espanol = new Array();
subInfo_espanol[1] = new Array();
subInfo_espanol[2] = new Array();
subInfo_espanol[3] = new Array();
subInfo_espanol[4] = new Array();
subInfo_espanol[5] = new Array();
subInfo_espanol[6] = new Array();
subInfo_espanol[7] = new Array();
subInfo_espanol[8] = new Array();


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





subInfo_espanol[6][1] = new Array("Satélite","mapa1.html","");
subInfo_espanol[6][2] = new Array("Carretera","mapa2.html","");




//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_espanol = 0;
var ySubOffset_espanol = 20;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_espanol = false;
var delay_espanol = 1000;
totalButtons_espanol = upSources_espanol.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_espanol; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_espanol[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_espanol">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_espanol" class="dropmenu_espanol" ');
		document.write('onMouseOver="overSub_espanol=true;');
		document.write('setOverImg_espanol(\'' + (x+1) + '\',\'_espanol\');"');
		document.write('onMouseOut="overSub_espanol=false;');
		document.write('setTimeout(\'hideSubMenu_espanol(\\\'submenu' + (x+1) + '_espanol\\\')\',delay_espanol);');
		document.write('setOutImg_espanol(\'' + (x+1) + '\',\'_espanol\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_espanol[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_espanol[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_espanol[x+1][k+1][2] + '">');
			document.write( subInfo_espanol[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_espanol() {
	for ( x=0; x<totalButtons_espanol; x++ ) {
		buttonUp_espanol = new Image();
		buttonUp_espanol.src = buttonFolder_espanol + upSources_espanol[x];
		buttonOver_espanol = new Image();
		buttonOver_espanol.src = buttonFolder_espanol + overSources_espanol[x];
	}
}

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

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



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

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

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_espanol(subID, buttonID) {
	hideAllSubMenus_espanol();
	butX = getRealLeft_espanol(buttonID);
	butY = getRealTop_espanol(buttonID);
	moveObjectTo_espanol(subID,butX+xSubOffset_espanol, butY+ySubOffset_espanol);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_espanol() {
	for ( x=0; x<totalButtons_espanol; x++) {
		moveObjectTo_espanol("submenu" + (x+1) + "_espanol",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_espanol(subID) {
	if ( overSub_espanol == false ) {
		moveObjectTo_espanol(subID,-500, -500);
	}
}



//preload_espanol();

