var currentBg = -1; var currentNoise = 1; var currentLogo = 1; var firstUrl = "fundraising"; var currentUrl = firstUrl.split(".")[0]; var currentLang = "ita"; var playerStatus = "play"; var backgroundTimer = 6400; var noiseTimer = 1300; var logoTimer = 75; var isNoise = true; $(document).ready(function(){ $("#noi-image").hide(); var global_lp = 0; var global_ready = 0; /* $("#jquery_jplayer").jPlayer({ solution: "flash,html", ready: function () { $(this).jPlayer("setMedia", { mp3: '/mp3/l01_missmess.mp3' }).jPlayer("play"); } }); */ $("#player-switch").live('click',function(){ if(playerStatus=="stopped"){ $("#jquery_jplayer").jPlayer("play"); playerStatus = "play"; $("#player-switch img").attr("src","../img/stop.png"); }else{ $("#jquery_jplayer").jPlayer("stop"); playerStatus = "stopped"; $("#player-switch img").attr("src","../img/play.png"); } }); // QueryLoader.selectorPreload = "body"; // QueryLoader.init(); setTimeout("swapBackground()", noiseTimer); setTimeout("swapLogo()", logoTimer); /* $(".menu-links").live('click',function(){ var targetUrl = $(this).attr('href').split(".")[0]; if(currentUrl!=targetUrl){ currentUrl = targetUrl; $.ajax({ url: "pagine/"+targetUrl+".php?lang="+currentLang, context: document.body, success: function(data){ $("#content").fadeOut(1000, function(){ $("#content").html(data).slideDown(); }); } }); } return false; });*/ $(".lang-switch").live('click',function(){ var targetLang = $(this).attr('rel'); if(currentLang!=targetLang){ currentLang = targetLang; $.ajax({ url: "pagine/menu.php?lang="+targetLang, context: document.body, success: function(data){ $("#menu ul").fadeOut(1000, function(){ $("#menu ul").html(data).fadeIn(); }); } }); $.ajax({ url: "pagine/"+currentUrl+".php?lang="+targetLang, context: document.body, success: function(data){ $("#content").fadeOut(1000, function(){ $("#content").html(data).slideDown(); }); } }); } return false; }); $(".noi-lista li[rel!='']").live('mouseenter',function(){ var noiBack = $(this).attr("rel"); $("#noi-image").attr("src",noiBack); $("#background-image").fadeOut(); $("#noi-image").fadeIn(); }); $(".noi-lista li[rel!='']").live('mouseleave',function(){ $("#noi-image").fadeOut(); $("#background-image").fadeIn(); }); $(".fade").live('mouseenter',function(){ $(this).fadeTo("slow", 0.6); }); $(".fade").live('mouseleave',function(){ $(this).fadeTo("slow", 1.0); }); }); var nSfondi = 10; var arraySfondi = new Array("/pictures/sfondi/original/totale_1.gif","/pictures/sfondi/original/totale_5.gif","/pictures/sfondi/original/totale_6.gif","/pictures/sfondi/original/totale_7.gif","/pictures/sfondi/original/totale_9.gif","/pictures/sfondi/original/totale_12.gif","/pictures/sfondi/original/totale_14.gif","/pictures/sfondi/original/totale_17.gif","/pictures/sfondi/original/totale_19.gif","/pictures/sfondi/original/totale_20.gif"); function swapBackground(){ if(isNoise){ isNoise = false; currentBg++; if(currentBg>nSfondi-1) currentBg = 0; $("#background-image").attr("src",arraySfondi[currentBg]); setTimeout("swapBackground()", backgroundTimer); }else{ isNoise = true; currentNoise++; if(currentNoise>3) currentNoise = 1; $("#background-image").attr("src","/img/noise-"+currentNoise+".gif"); setTimeout("swapBackground()", noiseTimer); } } function swapLogo(){ currentLogo++; if(currentLogo>4) currentLogo = 1; $("#logo-image").attr("src","/img/logo/"+currentLogo+".png"); setTimeout("swapLogo()", logoTimer); }