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

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_english = new Array("button1up_english.gif","button2up_english.gif","button3up_english.gif","button4up_english.gif","button5up_english.gif","button6up_english.gif","button7up_english.gif");

overSources_english = new Array("button1over_english.gif","button2over_english.gif","button3over_english.gif","button4over_english.gif","button5over_english.gif","button6over_english.gif","button7over_english.gif");

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


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





subInfo_english[6][1] = new Array("Satellite","mapa1_e.html","");
subInfo_english[6][2] = new Array("Highway","mapa2_e.html","");



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



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_english = false;
var delay_english = 1000;
totalButtons_english = upSources_english.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_english; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_english[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_english">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_english" class="dropmenu_english" ');
		document.write('onMouseOver="overSub_english=true;');
		document.write('setOverImg_english(\'' + (x+1) + '\',\'_english\');"');
		document.write('onMouseOut="overSub_english=false;');
		document.write('setTimeout(\'hideSubMenu_english(\\\'submenu' + (x+1) + '_english\\\')\',delay_english);');
		document.write('setOutImg_english(\'' + (x+1) + '\',\'_english\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_english[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_english[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_english[x+1][k+1][2] + '">');
			document.write( subInfo_english[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_english() {
	for ( x=0; x<totalButtons_english; x++ ) {
		buttonUp_english = new Image();
		buttonUp_english.src = buttonFolder_english + upSources_english[x];
		buttonOver_english = new Image();
		buttonOver_english.src = buttonFolder_english + overSources_english[x];
	}
}

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

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



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

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

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_english(subID, buttonID) {
	hideAllSubMenus_english();
	butX = getRealLeft_english(buttonID);
	butY = getRealTop_english(buttonID);
	moveObjectTo_english(subID,butX+xSubOffset_english, butY+ySubOffset_english);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_english() {
	for ( x=0; x<totalButtons_english; x++) {
		moveObjectTo_english("submenu" + (x+1) + "_english",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_english(subID) {
	if ( overSub_english == false ) {
		moveObjectTo_english(subID,-500, -500);
	}
}



//preload_english();


