// JavaScript Document

Menu = new Array();
// Menu[n-esimo]= creaVoceMenu('nome voce')
Menu[0]= creaVoceMenu('Home');
Menu[1]= creaVoceMenu('Profilo aziendale');
Menu[2]= creaVoceMenu('Prodotti');
Menu[3]= creaVoceMenu('Servizi');
Menu[4]= creaVoceMenu('Formazione');
Menu[5]= creaVoceMenu('Area clienti');
Menu[6]= creaVoceMenu('Opportunit&agrave;');
Menu[7]= creaVoceMenu('Come contattarci');
Menu[8]= creaVoceMenu('Privacy');

function creaVoceMenu(nome){
voceMenu=new Object()
voceMenu.Nome=nome;
voceMenu.Check=false;
voceMenu.Selected='<font color=#FF3300><strong>'+ nome+'</strong></font>';
return voceMenu;
}

function startUp(){
	intestaPagina();
	Select(0);
}


function intestaPagina(){
document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> \n<html> \n\n<head> \n<title>Untitled Document</title> \n<meta http\-equiv\=\"Content\-Type\" content=\"text\/html; charset\=iso\-8859\-1\"> \n<link href=\"CSS\/LeftMenu.css\" rel=\"stylesheet\" type=\"text\/css\"> \n<script language\=\"JavaScript\" type\=\"text\/javascript\" src\=\"Javascript\/Menu.js\"> \n</script> \n<\/head>\n\n")
document.write("<body link=\"#FFFFFF\" vlink=\"#000099\" background=\"Img/BgGrey.jpg\">\n")
document.write("<div align=\"left\">\n\n");
}


function chiudiPagina(){
  document.write("</div>\n");
  document.write("</body>\n\n</html>\n");
  document.close();
}


function loadHomeFrames(){		
	parent.mainFrame.location.href="DetFrames/HomeDetail.htm";
	parent.topFrame1.location.href="LFrames/HomeLFrame.htm";
	Select(0);
	return false}
function loadProfileFrames(){		
	parent.mainFrame.location.href="DetFrames/ProfileDetail.htm";
	parent.topFrame1.location.href="LFrames/ProfileLFrame.htm";
	Select(1);
	return false}
function loadProductsFrames(){		
	parent.mainFrame.location.href="DetFrames/ProductsDetail.htm";
	parent.topFrame1.location.href="LFrames/ProductsLFrame.htm";
	Select(2);
	return false}
function loadServiziFrames(){		
	parent.mainFrame.location.href="DetFrames/ServiziDetail.htm";
	parent.topFrame1.location.href="LFrames/ServiziLFrame.htm";
	Select(3);
	return false}
function loadFormazioneFrames(){		
	parent.mainFrame.location.href="DetFrames/FormazioneDetail.htm";
	parent.topFrame1.location.href="LFrames/FormazioneLFrame.htm";
	Select(4);
	return false}
function loadClientiFrames(){		
	parent.mainFrame.location.href="DetFrames/ClientiDetail.htm";
	parent.topFrame1.location.href="LFrames/ClientiLFrame.htm";
	Select(5);
	return false}
function loadOpportunitaFrames(){		
	parent.mainFrame.location.href="DetFrames/OpportunitaDetail.htm";
	parent.topFrame1.location.href="LFrames/OpportunitaLFrame.htm";
	Select(6);
	return false}
function loadContattaFrames(){		
	parent.mainFrame.location.href="DetFrames/Contatta.htm";
	parent.topFrame1.location.href="LFrames/ContattaLFrame.htm";
	Select(7);
	return false}
function loadPrivacyFrames(){		
	parent.mainFrame.location.href="DetFrames/PrivacyDetail.htm";
	parent.topFrame1.location.href="LFrames/PrivacyLFrame.htm";
	Select(8);
	return false}



function Select(num)
{
  for (var i=0; Menu[i]; i++)
    Menu[i].Check=false;
  Menu[num].Check=true;
  
  document.clear();
  
  intestaPagina();
  
  if(Menu[0].Check)
    document.write("<a id=\"home\" href=\"javascript:void loadHomeFrames()\">" +Menu[0].Selected+ "</a> <br> \n");
  else
	document.write("<a id=\"home\" href=\"javascript:void loadHomeFrames()\">" +Menu[0].Nome+ "</a> <br> \n");
  if(Menu[1].Check)
    document.write("<a id=\"profile\" href=\"javascript: void loadProfileFrames()\">" +Menu[1].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"profile\" href=\"javascript: void loadProfileFrames()\">" +Menu[1].Nome+ "</a><br> \n");
  if(Menu[2].Check)
    document.write("<a id=\"products\" href=\"javascript:void loadProductsFrames()\">" +Menu[2].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"products\" href=\"javascript:void loadProductsFrames()\">" +Menu[2].Nome+ "</a><br> \n");
  if(Menu[3].Check)
    document.write("<a id=\"servizi\" href=\"javascript:void loadServiziFrames()\">" +Menu[3].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"servizi\" href=\"javascript:void loadServiziFrames()\">" +Menu[3].Nome+ "</a><br> \n");
  if(Menu[4].Check)
    document.write("<a id=\"formazione\" href=\"javascript:void loadFormazioneFrames()\">" +Menu[4].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"formazione\" href=\"javascript:void loadFormazioneFrames()\">" +Menu[4].Nome+ "</a><br> \n");
  if(Menu[5].Check)
    document.write("<a id=\"clienti\" href=\"javascript:void loadClientiFrames()\">"+Menu[5].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"clienti\" href=\"javascript:void loadClientiFrames()\">"+Menu[5].Nome+ "</a><br> \n");
  if(Menu[6].Check)
    document.write("<a id=\"opportunita\" href=\"javascript:void loadOpportunitaFrames()\">" +Menu[6].Selected+ "</a><br>\n");
  else
    document.write("<a id=\"oportunita\" href=\"javascript:void loadOpportunitaFrames()\">" +Menu[6].Nome+ "</a><br>\n");
  if(Menu[7].Check)
    document.write("<a id=\"contactUs\" href=\"javascript: void loadContattaFrames()\">" +Menu[7].Selected+ "</a><br> \n");
  else
    document.write("<a id=\"contactUs\" href=\"javascript: void loadContattaFrames()\">" +Menu[7].Nome+ "</a><br> \n");
  if(Menu[8].Check)
    document.write("<a id=\"privacy\" href=\"javascript:void loadPrivacyFrames()\">" +Menu[8].Selected+ "</a><br>\n");
  else
    document.write("<a id=\"privacy\" href=\"javascript:void loadPrivacyFrames()\">" +Menu[8].Nome+ "</a><br>\n");

	chiudiPagina();
}
