/*** SET BUTTONS' FILENAMES HERE ***/
upSources_Barcelona1 = new Array("HomeUp.png","PropertiesUp.png","ActivityUp.png","Services.png","TravelUp.png","FrenchInfoUp.png","AdvertiseUp.png","ContactUsUp.png");
overSources_Barcelona1 = new Array("HomeOver.png","PropertiesOver.png","ActivityOver.png","ServicesOver.png","TravelOver.png","FrenchInfoOver.png","AdvertiseOver.png","ContactUsOver.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_Barcelona1 = new Array();
subInfo_Barcelona1[1] = new Array();
subInfo_Barcelona1[2] = new Array();
subInfo_Barcelona1[3] = new Array();
subInfo_Barcelona1[4] = new Array();
subInfo_Barcelona1[5] = new Array();
subInfo_Barcelona1[6] = new Array();
subInfo_Barcelona1[7] = new Array();
subInfo_Barcelona1[8] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo_Barcelona1[2][1] = new Array("Holiday Rentals","../quicksearch.asp","_self");
subInfo_Barcelona1[2][2] = new Array("Property For Sale","../For-Sale/Property-For-Sale.asp","_self");
subInfo_Barcelona1[2][3] = new Array("Bed and Breakfast","../search-Bed-and-Breakfast.asp","_self");
subInfo_Barcelona1[2][4] = new Array("Long Term Rentals","../Search-LongTerm.asp","_self");

subInfo_Barcelona1[3][1] = new Array("Skiing","../Activity/Skiing.asp","_self");
subInfo_Barcelona1[3][2] = new Array("Canoeing","../Activity/Canoeing.asp","_self");
subInfo_Barcelona1[3][3] = new Array("Golf","../Activity/Golf.asp","_self");
subInfo_Barcelona1[3][4] = new Array("Walking","../Activity/Walking.asp","_self");
subInfo_Barcelona1[3][5] = new Array("Fishing","../Activity/Fishing.asp","_self");
subInfo_Barcelona1[3][6] = new Array("Mountain Biking","../Activity/Mountain-biking.asp","_self");
subInfo_Barcelona1[3][7] = new Array("Wine Tasting","../Activity/Wine-tasting.asp","_self");
subInfo_Barcelona1[3][8] = new Array("Painting","../Activity/Painting.asp","_self");
subInfo_Barcelona1[3][9] = new Array("Language courses","../Activity/Language.asp","_self");
subInfo_Barcelona1[3][10]= new Array("MotorCycling","../Activity/Motorcycling.asp","_self");
subInfo_Barcelona1[3][11]= new Array("Cycling","../Activity/Cycling.asp","_self");
subInfo_Barcelona1[3][12]= new Array("Horse Riding","../Activity/Horse-Riding.asp","_self");

subInfo_Barcelona1[4][1] = new Array("Translation","../Services/Translation.asp","_self");
subInfo_Barcelona1[4][2] = new Array("Property Purchasing","../Services/Property-Purchasing.asp","_self");
subInfo_Barcelona1[4][3] = new Array("Property Maintenance","../Services/Property-Maintenance.asp","_self");
subInfo_Barcelona1[4][4] = new Array("Man and Van Hire","../Services/Man-and-van-hire.asp","_self");
subInfo_Barcelona1[4][5] = new Array("Computer support","../Services/PC-support.asp","_self");

subInfo_Barcelona1[6][1] = new Array("Holiday Checklist","../holidaychecklist.asp","_self");
subInfo_Barcelona1[6][2] = new Array("Currency Convertor","http://www.oanda.com","Info");
subInfo_Barcelona1[6][3] = new Array("French Holidays","../Frenchholidayinformation.asp","_self");
subInfo_Barcelona1[6][4] = new Array("French Language","../Frenchlanguage.asp","_self");




/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_Barcelona1 = "../images/buttons/";


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_Barcelona1 = 120;
var ySubOffset_Barcelona1 = 0;

//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_Barcelona1 = false;
var delay_Barcelona1 = 1000;
totalButtons_Barcelona1 = upSources_Barcelona1.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_Barcelona1; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_Barcelona1[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_Barcelona1=true;"');
		document.write('onMouseOut="overSub_Barcelona1=false;');
		document.write('setTimeout(\'hideSubMenu_Barcelona1(\\\'submenu' + (x+1) + '\\\')\',delay_Barcelona1);">');

		document.write('<ul>');
		for ( k=0; k<subInfo_Barcelona1[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_Barcelona1[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_Barcelona1[x+1][k+1][2] + '">');
			document.write( subInfo_Barcelona1[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}



// PRELOAD MAIN MENU BUTTON IMAGES
for ( x=0; x<totalButtons_Barcelona1; x++ ) {
	buttonUp_Barcelona1 = new Image();
	buttonUp_Barcelona1.src = buttonFolder_Barcelona1 + upSources_Barcelona1[x];
	buttonOver_Barcelona1 = new Image();
	buttonOver_Barcelona1.src = buttonFolder_Barcelona1 + overSources_Barcelona1[x];
}




//*** MAIN MENU FUNCTIONS ***//
// SET MOUSEOVER BUTTON
function setOverImg_Barcelona1(But) {
	document.getElementById('button' + But).src = buttonFolder_Barcelona1 + overSources_Barcelona1[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_Barcelona1(But) {
	document.getElementById('button' + But).src = buttonFolder_Barcelona1 + upSources_Barcelona1[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_Barcelona1(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_Barcelona1(id) { 
	var el = getElement_Barcelona1(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_Barcelona1(id) {
	var el = getElement_Barcelona1(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_Barcelona1(objectID,x,y) {
	var el = getElement_Barcelona1(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_Barcelona1(subID, buttonID) {
	hideAllSubMenus_Barcelona1();
	butX = getRealLeft_Barcelona1(buttonID);
	butY = getRealTop_Barcelona1(buttonID);
	moveObjectTo_Barcelona1(subID,butX+xSubOffset_Barcelona1, butY+ySubOffset_Barcelona1);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_Barcelona1() {
	for ( x=0; x<totalButtons_Barcelona1; x++) {
		moveObjectTo_Barcelona1("submenu" + (x+1),-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_Barcelona1(subID) {
	if ( overSub_Barcelona1 == false ) {
		moveObjectTo_Barcelona1(subID,-500, -500);
	}
}

