
var now;
function premi(obj,i){
	now = i;
	obj.style.background="#ddd";
	var file;
	if(i== 0)file="sol2"; else
	if(i== 1)file="la2"; else
	if(i== 2)file="si2"; else
	if(i== 3)file="do1"; else
	if(i== 4)file="re1"; else
	if(i== 5)file="mi1"; else
	if(i== 6)file="fa1"; else
	if(i== 7)file="sol1"; else
	if(i== 8)file="la1"; else
	if(i== 9)file="si1";	 
	playSound(file+".mid");
	//document.embeds[i].play();
}
function lascia(obj){
	obj.style.background="#fff";
	//document.embeds[now].stop();
}


//////////////////////// sound ////////////////////////////////////////////////////////////////////
var player; 
var plugin; 
var hasActiveX = false;
function playSound(src){
	if(player){
		player.URL = "http://www.liciarossi.com/sound/"+src;//"sound/"+src;
		player.controls.play();
	} else if(plugin){
		plugin.innerHTML='<embed type="application/x-mplayer2" src="http://www.liciarossi.com/sound/"'+src+'" width="1" height="1" showcontrols="0" autostart="1" loop=false playcount="1"></embed>';
	}
}
function testSound(){
	try{ 
		if(window.ActiveXObject){
			hasActiveX = true;
			player = new ActiveXObject("WMPlayer.OCX.7"); 
  	} else if (window.GeckoActiveXObject){
		hasActiveX = true;
		player = new GeckoActiveXObject("WMPlayer.OCX.7");
  	}  
	} catch(oError) { }
	try  {
		if(navigator.mimeTypes){
			plugin = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin; 
		} 
	}catch (oError) { }
}