window.onload = function() {
	var tags = document.getElementById("menu").getElementsByTagName("img");
	for (var i = 0; i <  tags.length  ; i++) {
		tags[i].onmouseover = function() {
			thisId = this.id;
			Hilite(thisId, true);
		}
		tags[i].onmouseout = function() {
			thisId = this.id;
			Hilite(thisId, false);
		}
	}	
}

function mail(address, subject) {
	var strSubject = "";
	if (subject) {
		strSubject = "?subject=" + subject
	}
	window.location = "mailto:" + address + "@pbmek.it" + strSubject;
}
// Preload + Rollover Script
var source = "img/";
var rollSuffix = "_on";
var ext = ".jpg";

// Preload
function preload(name, n) {	
	img[n] = new Image();
	img[n].src = source + name + rollSuffix + ext;
}
var img = new Array();
menuItems = new Array;
menuItems[0] = "menu_azienda";
menuItems[1] = "menu_qualita";
menuItems[2] = "menu_news";
menuItems[3] = "menu_job";
menuItems[4] = "menu_links";
for (n=0; n<menuItems.length; n++) {
	preload(menuItems[n], n);
}
// Rollover
function Hilite(name, over) {
	//if(window.document.images) {
		if (over) {
			document.getElementById(name).src = source + name + rollSuffix + ext;
		} else {
			document.getElementById(name).src = source + name + ext;
		}	
	//}
}