Newsgroup: it.comp.lang.javascript
Titolo: EMERGENZA .... MAP !!!

<center>"+finalmessage+"</center></div>");
        if(ns) document.write("<layer id=\"mesg\" class=\"mesg\"
visibility=\"hidden\"><center>"+finalmessage+"</center></layer>");
}
var msgCol=0;
function stop_flying()
{
        if(ie){
                document.all.mesg.style.visibility="visible";
document.all.mesg.style.color="rgb("+String(msgCol)+","+String(msgCol)+","+S
tring(msgCol)+")";
              }
        if(ns){
setTimeout("document.layers['mesg'].visibility='visible'",1000);
                return;
              }
        msgCol+=10;
        if(msgCol<256) setTimeout("stop_flying()",10);
        else return;
}
function fly_txt(dataID)
{
        this.objID = dataID;
        var screen_x = screen.width;
        var screen_y = screen.height;
        var window_x = 0.9*screen_x;
        var window_y = 0.6*screen_y;
        var x;
        x=0.6*Math.random();
        if(x>0.3) x+=0.4;
        this.start_x = Math.round(window_x*x);
        this.start_y = Math.round(window_y*Math.random());
        if(x>0.3) x=0.3*Math.random();
        else x=0.7+0.3*Math.random();
        this.stop_x = Math.round(window_x*x);
        this.stop_y = Math.round(window_y*Math.random());
        this.slope = (this.stop_y - this.start_y)/(this.stop_x -
this.start_x);
        this.speed = Math.round(Math.random()*2)+4;
        if(ns) this.speed-=2;
        this.steps =
Math.round(Math.abs(this.start_x-this.stop_x)/this.speed);
        this.curCol = 0;
        this.curI = 0;
        this.timerID = 0;
        if(ie) this.objStyle =
eval("document.all(\""+this.objID+"\").style");
        if(ns) this.objStyle = eval("document.layers[\""+this.objID+"\"]");
        var tmp = (parseInt(dataID.substring(3))-1)%noOfFlyers;
        if(ie) {
                this.color=blkCol[tmp];
                this.objStyle.fontFamily=blkFont[tmp];
                this.objStyle.fontSize=blkSize[tmp]+"pt";
this.objStyle.fontStyle=(parseInt(blkIt[tmp])?"italic":"normal");
}
        this.Animate = animate_fly;
}
function animate_fly()
{
ie){ 
                this.objStyle.pixelLeft = this.start_x+this.curI;
                this.objStyle.pixelTop = (this.slope*this.curI) + this.start_y;
                }
        if(ns){
                this.objStyle.left = this.start_x+this.curI;
                this.objStyle.top = (this.slope*this.curI) + this.start_y;
                }
        this.objStyle.visibility="visible";
        if(this.stop_x>this.start_x) this.curI+=this.speed;
        else this.curI-=this.speed;
        if(ie){
        var tmp;
        switch(this.color){
 
                case "white":
                tmp=String("rgb("+String(this.curCol)+","+String(this.curCol)+","+String(this.curCol)+")");
                break;
 
                case "red":
                tmp=String("rgb("+String(this.curCol)+",0,0)");
                break;
 
                case "blue":
                tmp=String("rgb(0,0,"+String(this.curCol)+")");
                break;
                case "green":
                tmp=String("rgb(0,"+String(this.curCol)+",0)");
                break;
                default:
                }
        this.objStyle.color=tmp;
        if(this.steps>50){
        if(Math.abs(this.curI/this.speed)<25) this.curCol+=10;
        if(Math.abs(this.curI/this.speed)>(this.steps-25)) this.curCol-=5;
 
        }
        }
        if(Math.abs(this.start_x+this.curI-this.stop_x)<=this.speed) {
                clearInterval(this.timerID);
                this.timerID=0;
                this.objStyle.visibility="hidden";
                var end=0;
                for(var i=1; i<
=noOfFlyers; i++)
                        if(fly[i].timerID) end=1;
                if(!end)
                        if(msgI<noOfMsgs) start_flying(msgI++);
                        else stop_flying();
        }
}
var fly = new Array(11);
function start_flying(msgIndex)
{
        if(err) return;
        for(var s=1; s<=noOfFlyers; s++)
        {
                fly[s] = new
fly_txt("fly"+String((msgIndex-1)*noOfFlyers+s));
        }
        for(s=1;s<=noOfFlyers;s++)
        {
                var cmd = "fly["+s+"].Animate()";
                fly[s].timerID = setInterval(cmd,10);
        }
}
function handleErr(errMsg)
{
        alert(errMsg);
        err=1;
        return false;
}
file://-->
</script>
<style type="text/css">
<!--
.fly1
{position:absolute;font-family:arial;font-size:22pt;font-weight:bold;color:w
hite;}
.fly2
{position:absolute;font-family:timesroman;font-size:24pt;font-weight:bold;co
lor:white;}
.fly3
{position:absolute;font-family:gothic;font-size:26pt;font-weight:bold;color:
white;}
.fly4
{position:absolute;font-family:arial;font-size:28pt;font-weight:bold;color:w
hite;}
.fly5
{position:absolute;font-family:courier;font-size:29pt;font-weight:bold;color
:white;}
.fly6
{position:absolute;font-family:arial;font-size:22pt;font-weight:bold;color:w
hite;}
.fly7
{position:absolute;font-family:timesroman;font-size:20pt;font-weight:bold;co
lor:white;}
.fly8
{position:absolute;font-family:gothic;font-size:22pt;font-weight:bold;color:
white;}
.fly9
{position:absolute;font-family:arial;font-size:24pt;font-weight:bold;color:w
hite;}
.fly10
{position:absolute;font-family:courier;font-size:25pt;font-weight:bold;color
:white;}
.mesg {position:relative;color:white;font-family:arial;}
-->
</style><style type="text/javascript">
for(var k = 1; k<=noOfFlyers; k++){
        document.classes["fly"+String(k)].all.color=blkCol[k-1];
        document.classes["fly"+String(k)].all.fontFamily=blkFont[k-1];
        document.classes["fly"+String(k)].all.fontSize=blkSize[k-1]+"pt";
document.classes["fly"+String(k)].all.fontStyle=(parseInt(blkIt[k-1])?"itali
c":"normal");
}
</style></head><body bgcolor="black" text="#F1FD35" link="#11FFD5"
vlink="#11FFD5" alink="#11FFD5" onLoad="start_flying(msgI++)"><script
language = "JavaScript">
<!--
initialize();
file://-->
</script></body></html>

Usa i layer, al click devi rendere visibile layer con l'html in questione.
Occhio che i layer hanno proprieta' diverse con IE e Ne, inoltre funzionano
solo sui browser DHTML compatibili (Ie4, 5, e Ne4.x)

 wrote in message
8a5aej$ksf$1...@nslave2.tin.it...
