if(navigator.userAgent.indexOf("MSIE")>0){ // alert(navigator.userAgent+"ho scritto qui"); function swap_bgie(){ // alert(navigator.userAgent+"ho scritto qui"); var randnum=Math.round(Math.random()*6)+1; if(randnum==controlpos){ var randnum=Math.round(Math.random()*6)+1; } var controlpos=randnum; //document.getElementById('search').setAttribute("style","background:url('/portale/images/photo_"+randnum+".jpg') no-repeat center"); document.getElementById('schermo').innerHTML=""; //document.getElementById('schermo').value=randnum; t=setTimeout("swap_bgie()",10000); } swap_bgie(); }else{ // alert(navigator.userAgent+"ho scritto qui"); var t; var controlpos; function swap_bg(){ var randnum=Math.round(Math.random()*6)+1; if(randnum==controlpos){ var randnum=Math.round(Math.random()*6)+1; } var controlpos=randnum; //alert(randnum); fade_bg(0); //document.getElementById('search').setAttribute("style","background:none"); document.getElementById('search').setAttribute("style","background:url('/portale/images/photo_"+randnum+".jpg') no-repeat center"); //document.getElementById('schermo').innerHTML=""; // document.getElementById('schermo').value=randnum; t=setTimeout("swap_bg()",10000); } function fade_bg(amt) { if(amt <= 100) { setFade_bg(amt); amt += 10; setTimeout("fade_bg("+amt+")", 5); } } function setFade_bg(amt) { obj = document.getElementById("search"); amt = (amt == 100)?99.999:amt; // IE obj.style.filter = "alpha(opacity:"+amt+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = amt/100; // Mozilla and Firefox obj.style.MozOpacity = amt/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = amt/100; } swap_bg(); }