var layerX = "";
var styleX = "";

function initMenu(){

	if (navigator.appName == 'Netscape'){
		layerX = 'document.layers';
		styleX = '';
		}
	    else{
	    	layerX = 'document.all';
	    	styleX = '.style';
	}
	preLoad();
	eval(layerX + '["bottoni"]' + styleX + '.visibility="visible"');
}

function preLoad(){
	butInfo = new Image();
	butInfoOn= new Image();
	butResearch= new Image();
	butResearchOn= new Image();
	butTeaching= new Image();
	butTeachingOn= new Image();
	butCurrent_Projects= new Image();
	butCurrent_ProjectsOn= new Image();
	butPublications= new Image();
	butPublicationsOn= new Image();

	butInfo.src = "images/butInfo.gif";
	butInfoOn.src = "images/butInfoOn.gif";
	butResearch.src = "images/Research_TradButton.gif";
	butResearchOn.src= "images/Research_TradButtonOn.gif";
	butTeaching.src = "images/Teaching_TradButton.gif";
	butTeachingOn.src = "images/Teaching_TradButtonOn.gif";
	butCurrent_Projects.src = "images/Current_Projects_TradButton.gif";
	butCurrent_ProjectsOn.src = "images/Current_Projects_TradButtonOn.gif";
	butPublications.src  = "images/Publications_TradButton.gif";
	butPublicationsOn.src = "images/Publications_TradButtonOn.gif";
}

function cambia(ImageName,ImageFile){
    ImageName.src = ImageFile;
  }
function CambiaTestata(x){
	var itemMenu1= new Array('Info','Research','Teaching','Current Projects','Links','Publications','Curriculum_Vitae');
	top.Testata.document.getElementById("IntestazionePagina").innerHTML=itemMenu1[x];
	top.s=x

}
function CambiaTestatina(x){
	if (navigator.appName == "Microsoft Internet Explorer")
			top.Content.Testata1.M2.style.visibility=x;
		else{
			var d = d = document.getElementById("M2");
			d.setAttribute("visibility", "visible");
		}

	}
function inizio(){
	top.Content.location.href='Home.html';
	top.s=0;
	}
function loadTestata(){
	CambiaTestata(top.s);
	}

function loadPublications(){
	CambiaTestata(5);
	top.Content.Content1.location.href='blank.html';
	}

function listframes(){
	for (i = 0; i<top.frames.length;i++){
		document.write(top.frames[i].name+'<br>');
		for (j=0; j<top.frames[i].frames.length;j++)
			document.write('--'+top.frames[i].frames[j].name+'<br>');
		}
	document.write(top.Content.Testata1.document.M2.visibility);
	document.write(parent.Testata1.document.M2.visibility);
	}

function show_props(obj,obj_name){
	var result="";
	for (var i in obj){
		document.write(obj_name+'.'+i+'='+obj[i]+'<br>');
		document.write('<br><br>');
	}
	return true;
	}


