mexu = new Array();
mexu[1] = new Array();
mexu[2] = new Array();
mexu[3] = new Array();
mexu[4] = new Array();
mexu[5] = new Array();
mexu[6] = new Array();
mexu[7] = new Array();
mexu[8] = new Array();
mexu[9] = new Array();
mexu[10] = new Array();
mexu[11] = new Array();


mexu[1][1] = new Array("My Page","http://www.hoofpic.co.uk/index.php?page=my_hoofpic","");
mexu[1][2] = new Array("My Horses","http://www.hoofpic.co.uk/index.php?page=horses&section=edit","");
mexu[1][3] = new Array("My Account","http://www.hoofpic.co.uk/index.php?page=account&section=settings","");
mexu[1][4] = new Array("My Photos","http://www.hoofpic.co.uk/index.php?page=photos&section=edit","");
mexu[1][5] = new Array("My Friends","http://www.hoofpic.co.uk/index.php?page=mynetwork&section=browse","");
mexu[1][6] = new Array("My Ignores","http://www.hoofpic.co.uk/index.php?page=ignores","");
mexu[1][7] = new Array("My Invitations","http://www.hoofpic.co.uk/index.php?page=invite","");
mexu[1][8] = new Array("My Bulletins","http://www.hoofpic.co.uk/index.php?page=bulletins&section=manage","");
mexu[1][9] = new Array("My Membership","http://www.hoofpic.co.uk/index.php?page=billing","");
mexu[1][10] = new Array("My Mailbox","http://www.hoofpic.co.uk/index.php?page=mailbox&section=inbox","");
mexu[1][11] = new Array("My IM Contacts","javascript:HS_LaunchIM()","");

mexu[2][1] = new Array("Blogs Home","http://www.hoofpic.co.uk/index.php?page=blogs","");
mexu[2][2] = new Array("Browse Blogs","http://www.hoofpic.co.uk/index.php?page=blogs&section=all","");
mexu[2][3] = new Array("Create Blog","http://www.hoofpic.co.uk/index.php?page=blogs&section=create","");
mexu[2][4] = new Array("My Blogs","http://www.hoofpic.co.uk/index.php?page=blogs&section=manage","");

mexu[3][1] = new Array("Classifieds Home","http://www.hoofpic.co.uk/index.php?page=classifieds","");
mexu[3][2] = new Array("Browse Classifieds","http://www.hoofpic.co.uk/index.php?page=classifieds&section=browse","");
mexu[3][3] = new Array("Create Classifieds","http://www.hoofpic.co.uk/index.php?page=classifieds&section=create","");
mexu[3][4] = new Array("My Classifieds","http://www.hoofpic.co.uk/index.php?page=classifieds&section=manage","");

mexu[4][1] = new Array("Events Home","http://www.hoofpic.co.uk/index.php?page=events","");
mexu[4][2] = new Array("Browse Events","http://www.hoofpic.co.uk/index.php?page=events&section=browse","");
mexu[4][3] = new Array("Create Event","http://www.hoofpic.co.uk/index.php?page=events&section=create","");
mexu[4][4] = new Array("My Events","http://www.hoofpic.co.uk/index.php?page=events&section=manage","");
mexu[4][5] = new Array("Attending Events","http://www.hoofpic.co.uk/index.php?page=events&section=attending","");

mexu[5][1] = new Array("Clubs Home","http://www.hoofpic.co.uk/index.php?page=clubs","");
mexu[5][2] = new Array("Browse Clubs","http://www.hoofpic.co.uk/index.php?page=clubs&section=browse","");
mexu[5][3] = new Array("Create Club","http://www.hoofpic.co.uk/index.php?page=clubs&section=create","");
mexu[5][4] = new Array("My Clubs","http://www.hoofpic.co.uk/index.php?page=clubs&section=manage","");
mexu[5][5] = new Array("My Club Membership","http://www.hoofpic.co.uk/index.php?page=clubs&section=membership","");

mexu[8][1] = new Array("Videos Home","http://www.hoofpic.co.uk/index.php?page=videos","");
mexu[8][3] = new Array("My Videos","http://www.hoofpic.co.uk/index.php?page=videos&section=manage","");
mexu[8][2] = new Array("Upload","http://www.hoofpic.co.uk/index.php?page=videos&section=upload_general","");
mexu[8][4] = new Array("My Favorites","http://www.hoofpic.co.uk/index.php?page=videos&section=fav_manage","");
mexu[8][5] = new Array("My Playlists","http://www.hoofpic.co.uk/index.php?page=videos&section=playlists","");
mexu[8][6] = new Array("My Subscriptions","http://www.hoofpic.co.uk/index.php?page=videos&section=subscriptions","");

mexu[7][1] = new Array("Members","http://www.hoofpic.co.uk/index.php?page=search&section=members","");
mexu[7][2] = new Array("Advanced","http://www.hoofpic.co.uk/index.php?page=search&section=advanced","");
mexu[7][3] = new Array("Blogs","http://www.hoofpic.co.uk/index.php?page=search&section=blogs","");
mexu[7][4] = new Array("Events","http://www.hoofpic.co.uk/index.php?page=search&section=events","");
mexu[7][5] = new Array("Classifieds","http://www.hoofpic.co.uk/index.php?page=search&section=classifieds","");
mexu[7][6] = new Array("Clubs","http://www.hoofpic.co.uk/index.php?page=search&section=clubs","");
mexu[7][7] = new Array("Saved Search","http://www.hoofpic.co.uk/index.php?page=search&section=saved","");


mexu[10][1] = new Array("Browse Polls","http://www.hoofpic.co.uk/index.php?page=polls","");
mexu[10][2] = new Array("Create Poll","http://www.hoofpic.co.uk/index.php?page=polls&section=create","");
mexu[10][3] = new Array("My Polls","http://www.hoofpic.co.uk/index.php?page=polls&section=manage","");


var xSubOffset = 0;
var ySubOffset = 34;



var overSub = false;
var delay = 0;
totalButtons = 11;

for ( x=0; x<totalButtons; x++) {
	if ( mexu[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" style="z-index:999;" ');
		document.write('onMouseOver="overSub=true;');
		document.write('"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',20);');
		document.write('">');
		document.write('<ul>');
		for ( k=0; k<mexu[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + mexu[x+1][k+1][1] + '" ');
			document.write('target="' + mexu[x+1][k+1][2] + '">');
			document.write( mexu[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}
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;
	} 
} 
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;
	}
}




function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;	el.style.top = y;
}
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}

