// JavaScript Document

$(document).ready(function() {
//  soundManagerInit();
  //soundManager.url = './swf/'; 
  //soundManager.altURL = '/swf/'; 
  //soundManager.useHTML5Audio = true;


  //soundManager.useFlashBlock = false;
	//soundManager.debugMode = true;

	jQuery('#slider-offerte').jcarousel({
    	wrap: 'circular',
		scroll: 3,
		auto: 3
    });
						   
	var h1 = $('#content-wrap h1');
	Cufon.replace(h1, { fontFamily: 'BorisBlackBloxx' });
	
	/*
	$.get('sound/sound_1.mp3');
	$.get('sound/sound_2.mp3');
	$.get('sound/sound_3.mp3');
	$.get('sound/sound_4.mp3');
	
	if( ! $.browser.msie){
	var audioSound_1 = document.getElementById('sound_1');
	audioSound_1.load();
	var audioSound_2 = document.getElementById('sound_2');
	audioSound_2.load();
	var audioSound_3 = document.getElementById('sound_3');
	audioSound_3.load();
	var audioSound_4 = document.getElementById('sound_4');
	audioSound_4.load();
	}
	*/
	
	$("#menu li").mouseenter(function(){
	var pulsante = $(this).children('a');
	var suono = pulsante.attr('rel');
  document.getElementById('iframe_sound').contentWindow.playSound(suono);

//alert(p);
  //p.playSound(suono);	
	//alert(suono);
	//soundManager.play(suono);	
	//soundManager.play("mySound","http://www.bruseganpianoforti.com/audio/do.mp3");
	/*
	if($.browser.msie && $.browser.version < 9){
		$('#bgsound_' + suono).attr('src','sound/' + suono + '.mp3');
		//playSound(suono);
	}else{
		var audioSound = document.getElementById(suono);
		audioSound.currentTime = 0.3;
		audioSound.play();
	}
	*/
	var vel = 180;
	
	pulsante.stop()
		.animate({"margin-top": "+40px"}, vel,function(){  	
			pulsante.animate({"margin-top": "0px"}, vel);
		});
	});
	
});
