/*
 *   Menu per AGI Venezia
 */
 

function costruisciMenu(tabellaBase){
 var colBtnOn = 'blue';
 var colBtnOff = 'white';
 var colSfondo = 'white';
 
 ItemMenu = new Array();
 ItemMenu[1] = new Array("HOME PAGE","Home Page del Sito","Associazione Giovani Ingegneri Venezia","index.html",1);
 ItemMenu[2] = new Array("CHI SIAMO","Informazioni sulla Associazione","Associazione Giovani Ingegneri Venezia","chisiamo.html",1);
 ItemMenu[3] = new Array("LO STATUTO","Lo statuto della Associazione","Associazione Giovani Ingegneri Venezia","statuto.html",1);
 ItemMenu[4] = new Array("DOVE SIAMO","Come raggiungerci...","Associazione Giovani Ingegneri Venezia","dovesiamo.html",1);
 ItemMenu[5] = new Array("ASSOCIARSI","Come aderire alla Nostra proposta","Associazione Giovani Ingegneri Venezia","assoc.html",1);
 ItemMenu[6] = new Array("NOTIZIE","Notizie ed informazioni dell'ultimo minuto","Associazione Giovani Ingegneri Venezia","notizie.html",1);
 ItemMenu[7] = new Array("VERBALI","Verbali delle riunioni","Associazione Giovani Ingegneri Venezia","verbali.html",1);
 ItemMenu[8] = new Array("GALLERIA","Galleria Fotografica","Associazione Giovani Ingegneri Venezia","gallfoto.html",1);
 ItemMenu[9] = new Array("EVENTI","Eventi organizzato dalla Associazione","Associazione Giovani Ingegneri Venezia","eventi.html",1);
 ItemMenu[10] = new Array("RASSEGNA STAMPA","Dicono di Noi","Associazione Giovani Ingegneri Venezia","rassstamp.html",1);
 ItemMenu[11] = new Array("LINK","Collegamenti consigliati","Associazione Giovani Ingegneri Venezia","links.html",1);
 ItemMenu[12] = new Array("nomeBtn","Wnd_Status_On","Wnd_Status_Off","linkBtn",0);
 ItemMenu[13] = new Array("nomeBtn","Wnd_Status_On","Wnd_Status_Off","linkBtn",0);
 ItemMenu[14] = new Array("nomeBtn","Wnd_Status_On","Wnd_Status_Off","linkBtn",0);
 ItemMenu[15] = new Array("nomeBtn","Wnd_Status_On","Wnd_Status_Off","linkBtn",0);
 ItemMenu[16] = new Array("nomeBtn","Wnd_Status_On","Wnd_Status_Off","linkBtn",0);
	
 //--------------------------------------------------------------------------------------------------	
 tabellaPadre = document.getElementById(tabellaBase);
 tabellaPadre.cellPadding = 0;
 tabellaPadre.cellSpacing = 3;
 tabellaMenu  = document.createElement('tbody');

 for (i=1;i<ItemMenu.length;i++)
 {
  if (ItemMenu[i][4])
  {	
   bottonePD = document.createElement('tr');
   bottoneIN = document.createElement('td');
   bottoneIN.id = i;
   bottoneIN.width = 140;
   bottoneIN.height = 16;   
   bottoneIN.valign = "middle";
   bottoneIN.align = "center";
   bottoneIN.messaggioON  = ItemMenu[i][1];
   bottoneIN.messaggioOFF = ItemMenu[i][2];
   bottoneIN.pagina       = ItemMenu[i][3];
   bottoneIN.style.background = colBtnOff;
   bottoneIN.style.border = 'solid '+colBtnOn+ ' 1px';
   bottoneIN.style.color = colBtnOn;
   bottoneIN.style.fontSize = '10px';
   nomeBottone = document.createTextNode(ItemMenu[i][0]);
   bottoneIN.appendChild(nomeBottone);
   bottoneIN.onmouseover = function(){document.getElementById(this.id).style.background = colBtnOn;
   	                                  document.getElementById(this.id).style.color = colBtnOff;
                                      window.status = document.getElementById(this.id).messaggioON;};
   bottoneIN.onmouseout  = function(){document.getElementById(this.id).style.background = colBtnOff;
   	                                  document.getElementById(this.id).style.color = colBtnOn;
                                      window.status = document.getElementById(this.id).messaggioOFF;};
   bottoneIN.onclick     = function(){document.location = document.getElementById(this.id).pagina;};
   bottonePD.appendChild(bottoneIN);
   tabellaMenu.appendChild(bottonePD);
  }
 }
 tabellaPadre.appendChild(tabellaMenu);
}

function posizionaD(divref){
  var pgObj = document.getElementById(divref);
	posY = -1;
	if (window.innerHeight){
		posY = window.innerHeight;
		posX = window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.scrollTop){
  	posY = document.documentElement.scrollTop;
  	posX = document.documentElement.scrollLeft;
  }
  else if (document.body){
  	posY = document.body.scrollTop;
  	posX = document.body.scrollLeft;
  }
  if (posY == 0){ posY = screen.height; }
  if (posX == 0){ posX = screen.width; }

  pgObj.style.Top = Math.floor((posY-600)/2);
  pgObj.style.Left = Math.floor((posX-800)/2);
  
}


 