// --------------> menuRow -
// array for main menu displayed as one row where itemName stands for name to be displayed,
// itemLink - link to page to be opened on click, popupId - id of DIV section to be appeared on 
// mouse over

var menuRow = new Array(); 
// clase defined in bytes.css 
var menuRowClass="byte11";

menuRow[0] =  {itemName: 'HOME', itemLink : 'index.html', popupId:''}; 
menuRow[1] =  {itemName: 'THE COMPANY', itemLink : 'about.html',popupId:'div_menuCompany'}; 
menuRow[2] =  {itemName: 'SERVICES', itemLink : 'services.html',popupId:'div_menuServices'}; 
menuRow[3] =  {itemName: 'OUR CLIENTS', itemLink : 'clients.html',popupId:''}; 
menuRow[4] =  {itemName: 'CONTACT US', itemLink : 'contact.php',popupId:''}; 

//=============================================================================================*
// --------------> menuPopup -
//array of objects, each one of them is also array, containing popup menu
//items  

var menuPopup = new Array();
// clase defined in bytes.css for popup menu's text style
var menuPopupClass="byte17";


var menuPopupAboutUs = new Array();
menuPopupAboutUs[0] = {itemName: 'About Us', itemLink : 'about.html'};
menuPopupAboutUs[1] = {itemName: 'Our Mission', itemLink : 'mission.html'};
menuPopupAboutUs[2] = {itemName: 'Our People', itemLink : 'people.html'};
menuPopupAboutUs[3] = {itemName: 'Our Values', itemLink : 'values.html'};

var menuPopupServices = new Array();
menuPopupServices[0] = {itemName: 'What We Do', itemLink : 'services.html'};
menuPopupServices[1] = {itemName: 'How We Do It', itemLink : 'methodology.html'};


menuPopup[0]=menuPopupAboutUs;
menuPopup[1]=menuPopupServices;

//array of objects, describing positions and ids of DIVs, containing popup menus
var menuPopupCoords = new Array();

menuPopupCoords[0]={ x:'160', y:'139', id:'div_menuCompany'};
menuPopupCoords[1]={ x:'320', y:'139', id:'div_menuServices'};

//HTML common blocks for popup menu

var tblmenuOpen = '<TABLE id="tbl_menuComp" cellSpacing="0" cellPadding="0" bgcolor="#5A5955" border="0">' +
				'<tr>'+
					'<td bgcolor="#D39D47"><img src="images/spacer.gif" width="1" height="1"></td>'+
					'<td bgcolor="#D39D47"><img src="images/spacer.gif" width="10" height="1"></td>'+
					'<td bgcolor="#D39D47"><img src="images/spacer.gif" width="80" height="1"></td>'+
					'<td bgcolor="#D39D47"><img src="images/spacer.gif" width="10" height="1"></td>'+
					'<td bgcolor="#D39D47"><img src="images/spacer.gif" width="1" height="1"></td>'+
				'</tr>';
var tblmenuClose = 
					'<td bgcolor="#D0C5A7" colspan="5"><img src="images/spacer.gif" width="1" height="1"></td></tr></table></div>';				
					
var tblmenuSeparator ='<tr><td bgcolor="#D39D47" colspan="4"><img src="images/spacer.gif" width="1"></td><td  bgcolor="#D0C5A7"><img src="images/spacer.gif" width="1" ></td></tr>';					

//function creates HTML code for popup menu item as a row of a table,
//using menuPopupClass, itemName and itemLink parameters
function CreatePopupItem(iPopup, iItem) 
{
 var menuBlock=menuPopup[iPopup];
   
 var itemLink=menuBlock[iItem]['itemLink'];
 var itemName=menuBlock[iItem]['itemName'];
 
 tblmenuItem = '<tr><td bgcolor="#D39D47"><img src="images/spacer.gif" width="1"></td>'+
					'<td ><img src="images/spacer.gif" width="10" ></td>'+
					'<td><A class="'+menuPopupClass+'" href="'+itemLink+'" target="_top">'+itemName+'</A></td>'+
					'<td ><img src="images/spacer.gif" width="10" ></td>'+
					'<td  bgcolor="#D0C5A7"><img src="images/spacer.gif" width="1" ></td></tr>';
					

 return tblmenuItem;
					
}					

//function creates HTML code for DIV, using menuPopupCoords array's element
//for DIV positioning and menuPopup array's element for menu building as a table
function CreatePopupBlock(iPopup) 
{
	var menuPopupBlock=menuPopup[iPopup];
	var menuPopupBlockCoords=menuPopupCoords[iPopup];
	//alert (menuPopupBlockCoords.id);
	toHTML="<div id='"+menuPopupBlockCoords.id+"' style='Z-INDEX:1; LEFT:"+menuPopupBlockCoords.x+"px; VISIBILITY:hidden; WIDTH:122px; POSITION:absolute; TOP:"+menuPopupBlockCoords.y+"px; HEIGHT:100px'>";
	
	toHTML+=tblmenuOpen;
	for (var i=0; i<menuPopupBlock.length; i++)
	{
    
		toHTML+=CreatePopupItem(iPopup, i);
		if (i<menuPopupBlock.length-1) toHTML+=tblmenuSeparator;
      
	}
	toHTML+=tblmenuClose; 
	
	return (toHTML);
 }   
 
//function creates HTML code for all popup menus  to be 
//appeared on mouse over specified row menu item. Row menu item controls
//popup menu appearence through popup menu's DIV id. 
  
function CreatePopupDivs() 
{
	
	var retVal="";
	for (var i=0; i<menuPopup.length; i++)
	    retVal+=CreatePopupBlock(i);
   
	return  retVal; 
 }     					

//HTML common blocks for row menu
var rowMenuTableOpen='	<table background="images/byteway_04_1.jpg" cellSpacing="0" cellPadding="0" width="770">';
var tagLine=
			'<tr>'+
				'<td><img src="images/spacer.gif" width="1"></td>'+
				'<td><img src="images/spacer.gif" width="229" height="39"></td>'+
				'<td class="byte8" align="right">HELPING BUSINESSES LEVERAGE THE POWER OF TECHNOLOGY</td>'+
				'<td><img src="images/spacer.gif" width="39" height="39"></td>'+
			'</tr>';
var tagLogo='<tr><td><img src="images/spacer.gif" width="1"></td>'+
				'<td><img src="images/byteway_05.jpg" width="229" height="75"></td>'+
				'<td><img src="images/byteway_06.jpg" width="501" height="75"></td>'+
				'<td><img src="images/spacer.gif" width="39"></td></tr>';
			
			
var rowMenuTableClose='</table><table background="images/byteway_grad.jpg" cellSpacing="0" cellPadding="0" width="770" ID="Table2">'+
					'<tr><td><img src="images/spacer.gif" height="50" width="770"></td></tr></table>';


//function creates HTML code for row menu as a table,
//using menuRow array,
//defining onMouseOver action for items whose popupId is not empty.

function CreateRowMenu ()
{
var retVal=rowMenuTableOpen+tagLine+tagLogo+
'<td colspan="3"><table cellSpacing="0" cellPadding="0" width="731" ID="Table1"><tr><td><img src="images/spacer.gif" width="50" height="21"></td>';
	
	for (var i=0; i<menuRow.length; i++)
	{
	    var divId=menuRow[i]['popupId'];
	    retVal+='<td><img src="images/byteway_rect.jpg">&nbsp;<a href="'+menuRow[i]['itemLink']+'" class="byte11" ';
	    if ( divId != '' )	     retVal+=' onMouseOver="expandMenu(\''+divId+'\')"';
	    retVal+= '  > '+menuRow[i]['itemName']+'</a></td>';
    }
    
    retVal+='</tr></table></td>'+rowMenuTableClose;
	return  retVal; 
}					