Javascript doesn't work in newer Mozillas...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cat

    Javascript doesn't work in newer Mozillas...

    Greetings,

    I have an old javascript effect that was running on some of my
    sites for quite long, working fine in Netscape (up to 4.75) and
    IE. It still works in the newer IEs, but not in the new Mozillas,
    neither Firebird nor Firefox (and not in Netscape 7.something).

    What is wrong with it? I'm no javascript expert, I just got it
    from the net years ago, I don't even know where from. There is
    no source url given in it to look up. I've added the code below.

    I have exactly the same situation with two other scripts - they
    worked for years and suddenly they seem to be 'expired' for Mozilla.
    I think it's the same problem with all, so I hope if someone gives
    me a helping hand with this one I might fiddle out the other two
    as well.

    Sorry for the long babble, and thanks to anyone who has the patience
    to look over it,

    Cat



    <BODY BGCOLOR="#00000 0" ONLOAD="fly()">

    <SCRIPT LANGUAGE="JavaS cript">
    <!-- Begin
    SmallStars = 27;
    LargeStars = 3;
    SmallYpos = new Array();
    SmallXpos = new Array();
    LargeYpos = new Array();
    LargeXpos = new Array();
    Smallspeed= new Array();
    Largespeed= new Array();
    ns=(document.la yers)?1:0;
    if (ns) {
    for (i = 0; i < SmallStars; i++) {
    document.write( "<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#EEDBD B'
    CLIP='0,0,1,1'> </LAYER>");
    }
    for (i = 0; i < LargeStars; i++) {
    document.write( "<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF 0'
    CLIP='0,0,2,2'> </LAYER>");
    }
    }
    else {
    document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
    document.write( '<div style="position :relative">');
    for (i = 0; i < SmallStars; i++) {
    document.write( '<div id="si"
    style="position :absolute;top:0 ;left:0;width:1 px;height:1px;b ackground:#ffff f0;font-size:1px"></div>');
    }
    document.write( '</div>');
    document.write( '</div>');
    document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
    document.write( '<div style="position :relative">');
    for (i = 0; i < LargeStars; i++) {
    document.write( '<div id="li"
    style="position :absolute;top:0 ;left:0;width:2 px;height:2px;b ackground:#ffff ff;font-size:2px"></div>');
    }
    document.write( '</div>');
    document.write( '</div>');
    }
    WinHeight =
    (document.layer s)?window.inner Height:window.d ocument.body.cl ientHeight;
    WinWidth =
    (document.layer s)?window.inner Width:window.do cument.body.cli entWidth;
    for (i = 0; i < SmallStars; i++) {
    SmallYpos[i] = Math.round(Math .random() * WinHeight);
    SmallXpos[i] = Math.round(Math .random() * WinWidth);
    Smallspeed[i]= Math.random() * 5 + 1;
    }
    for (i = 0; i < LargeStars; i++) {
    LargeYpos[i] = Math.round(Math .random() * WinHeight);
    LargeXpos[i] = Math.round(Math .random() * WinWidth);
    Largespeed[i] = Math.random() * 10 + 5;
    }
    function fly() {
    var WinHeight =
    (document.layer s)?window.inner Height:window.d ocument.body.cl ientHeight;
    var WinWidth =
    (document.layer s)?window.inner Width:window.do cument.body.cli entWidth;
    var hscrll =
    (document.layer s)?window.pageY Offset:document .body.scrollTop ;
    var wscrll =
    (document.layer s)?window.pageX Offset:document .body.scrollLef t;
    for (i = 0; i < LargeStars; i++) {
    LargeXpos[i] -= Largespeed[i];
    if (LargeXpos[i] < -10) {
    LargeXpos[i] = WinWidth;
    LargeYpos[i] = Math.round(Math .random() * WinHeight);
    Largespeed[i] = Math.random() * 10 + 5;
    }
    if (ns) {
    document.layers['ln'+i].left = LargeXpos[i];
    document.layers['ln'+i].top = LargeYpos[i] + hscrll;
    }
    else {
    li[i].style.pixelLef t = LargeXpos[i];
    li[i].style.pixelTop = LargeYpos[i] + hscrll;
    }
    }
    for (i = 0; i < SmallStars; i++) {
    SmallXpos[i] -= Smallspeed[i];
    if (SmallXpos[i] < -10) {
    SmallXpos[i] = WinWidth;
    SmallYpos[i] = Math.round(Math .random()*WinHe ight);
    Smallspeed[i] = Math.random() * 5 + 1;
    }
    if (ns) {
    document.layers['sn'+i].left = SmallXpos[i];
    document.layers['sn'+i].top = SmallYpos[i]+hscrll;
    }
    else {
    si[i].style.pixelLef t = SmallXpos[i];
    si[i].style.pixelTop = SmallYpos[i]+hscrll;
    }
    }
    setTimeout('fly ()', 10);
    }
    // End -->


    </SCRIPT>
  • Robert

    #2
    Re: Javascript doesn't work in newer Mozillas...

    In article <41F11353.58AAB BFA@steppe.mn>, Cat <cat@steppe.m n> wrote:
    [color=blue]
    > Greetings,
    >
    > I have an old javascript effect that was running on some of my
    > sites for quite long, working fine in Netscape (up to 4.75) and
    > IE. It still works in the newer IEs, but not in the new Mozillas,
    > neither Firebird nor Firefox (and not in Netscape 7.something).[/color]

    This script contains the Netscape 4.x layer tag. This tag was dropped
    from the Gekco base browsers. Netscape 6.x, firefox, etc. This is the
    reason for the failure.

    Rbert

    Comment

    • Richard

      #3
      Re: Javascript doesn't work in newer Mozillas...

      On Fri, 21 Jan 2005 15:36:03 +0100 Cat wrote:
      [color=blue]
      > Greetings,[/color]
      [color=blue]
      > I have an old javascript effect that was running on some of my
      > sites for quite long, working fine in Netscape (up to 4.75) and
      > IE. It still works in the newer IEs, but not in the new Mozillas,
      > neither Firebird nor Firefox (and not in Netscape 7.something).[/color]

      Maybe due to the ancient ways of doing things.

      document.write( '</div>');
      document.write( '</div>');
      document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
      document.write( '<div style="position :relative">');


      Convert all of this stuff into css.
      <div> should come before </div> not as you show it.

      in css it would look like
      div.sample { position:absolu te; top:0px; left;0px; }

      <div class="sample"> text</div>

      You might want to brush up on existing acceptable JS conventions.
      Then tweak your script accordingly.


      Comment

      • Spats30

        #4
        Re: Javascript doesn't work in newer Mozillas...

        Couple of things: almost no-one is supporting NS 4.x vesions anymore.
        It's usage is nominal, anymore, so remove it.

        Then what is happening in your script is that the logic checks for old
        NS versions (document.layer s), if found, then use these specific old NS
        properties, else assume IE and use proprietary IE properties. Newer NS
        and Firefox browsers follow the ECMA standards better and don't support
        either set of proprietary properties used in your script.

        What you should do is search for a whole new script, or go through
        manually, and replace anything with document.layers with new code
        supported by NS 6+. It would take a long time to be more specific for
        this post, but followup on your own and you'll learn a lot along the
        way.



        Cat wrote:[color=blue]
        > Greetings,
        >
        > I have an old javascript effect that was running on some of my
        > sites for quite long, working fine in Netscape (up to 4.75) and
        > IE. It still works in the newer IEs, but not in the new Mozillas,
        > neither Firebird nor Firefox (and not in Netscape 7.something).
        >
        > What is wrong with it? I'm no javascript expert, I just got it
        > from the net years ago, I don't even know where from. There is
        > no source url given in it to look up. I've added the code below.
        >
        > I have exactly the same situation with two other scripts - they
        > worked for years and suddenly they seem to be 'expired' for Mozilla.
        > I think it's the same problem with all, so I hope if someone gives
        > me a helping hand with this one I might fiddle out the other two
        > as well.
        >
        > Sorry for the long babble, and thanks to anyone who has the patience
        > to look over it,
        >
        > Cat
        >
        >
        >
        > <BODY BGCOLOR="#00000 0" ONLOAD="fly()">
        >
        > <SCRIPT LANGUAGE="JavaS cript">
        > <!-- Begin
        > SmallStars = 27;
        > LargeStars = 3;
        > SmallYpos = new Array();
        > SmallXpos = new Array();
        > LargeYpos = new Array();
        > LargeXpos = new Array();
        > Smallspeed= new Array();
        > Largespeed= new Array();
        > ns=(document.la yers)?1:0;
        > if (ns) {
        > for (i = 0; i < SmallStars; i++) {
        > document.write( "<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#EEDBD B'
        > CLIP='0,0,1,1'> </LAYER>");
        > }
        > for (i = 0; i < LargeStars; i++) {
        > document.write( "<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF 0'
        > CLIP='0,0,2,2'> </LAYER>");
        > }
        > }
        > else {
        > document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
        > document.write( '<div style="position :relative">');
        > for (i = 0; i < SmallStars; i++) {
        > document.write( '<div id="si"
        >[/color]
        style="position :absolute;top:0 ;left:0;width:1 px;height:1px;b ackground:#ffff f0;font-size:1px"></div>');[color=blue]
        > }
        > document.write( '</div>');
        > document.write( '</div>');
        > document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
        > document.write( '<div style="position :relative">');
        > for (i = 0; i < LargeStars; i++) {
        > document.write( '<div id="li"
        >[/color]
        style="position :absolute;top:0 ;left:0;width:2 px;height:2px;b ackground:#ffff ff;font-size:2px"></div>');[color=blue]
        > }
        > document.write( '</div>');
        > document.write( '</div>');
        > }
        > WinHeight =
        >[/color]
        (document.layer s)?window.inner Height:window.d ocument.body.cl ientHeight;[color=blue]
        > WinWidth =
        > (document.layer s)?window.inner Width:window.do cument.body.cli entWidth;
        > for (i = 0; i < SmallStars; i++) {
        > SmallYpos[i] = Math.round(Math .random() * WinHeight);
        > SmallXpos[i] = Math.round(Math .random() * WinWidth);
        > Smallspeed[i]= Math.random() * 5 + 1;
        > }
        > for (i = 0; i < LargeStars; i++) {
        > LargeYpos[i] = Math.round(Math .random() * WinHeight);
        > LargeXpos[i] = Math.round(Math .random() * WinWidth);
        > Largespeed[i] = Math.random() * 10 + 5;
        > }
        > function fly() {
        > var WinHeight =
        >[/color]
        (document.layer s)?window.inner Height:window.d ocument.body.cl ientHeight;[color=blue]
        > var WinWidth =
        > (document.layer s)?window.inner Width:window.do cument.body.cli entWidth;
        > var hscrll =
        > (document.layer s)?window.pageY Offset:document .body.scrollTop ;
        > var wscrll =
        > (document.layer s)?window.pageX Offset:document .body.scrollLef t;
        > for (i = 0; i < LargeStars; i++) {
        > LargeXpos[i] -= Largespeed[i];
        > if (LargeXpos[i] < -10) {
        > LargeXpos[i] = WinWidth;
        > LargeYpos[i] = Math.round(Math .random() * WinHeight);
        > Largespeed[i] = Math.random() * 10 + 5;
        > }
        > if (ns) {
        > document.layers['ln'+i].left = LargeXpos[i];
        > document.layers['ln'+i].top = LargeYpos[i] + hscrll;
        > }
        > else {
        > li[i].style.pixelLef t = LargeXpos[i];
        > li[i].style.pixelTop = LargeYpos[i] + hscrll;
        > }
        > }
        > for (i = 0; i < SmallStars; i++) {
        > SmallXpos[i] -= Smallspeed[i];
        > if (SmallXpos[i] < -10) {
        > SmallXpos[i] = WinWidth;
        > SmallYpos[i] = Math.round(Math .random()*WinHe ight);
        > Smallspeed[i] = Math.random() * 5 + 1;
        > }
        > if (ns) {
        > document.layers['sn'+i].left = SmallXpos[i];
        > document.layers['sn'+i].top = SmallYpos[i]+hscrll;
        > }
        > else {
        > si[i].style.pixelLef t = SmallXpos[i];
        > si[i].style.pixelTop = SmallYpos[i]+hscrll;
        > }
        > }
        > setTimeout('fly ()', 10);
        > }
        > // End -->
        >
        >
        > </SCRIPT>[/color]

        Comment

        • Lee

          #5
          Re: Javascript doesn't work in newer Mozillas...

          Robert said:[color=blue]
          >
          >In article <41F11353.58AAB BFA@steppe.mn>, Cat <cat@steppe.m n> wrote:
          >[color=green]
          >> Greetings,
          >>
          >> I have an old javascript effect that was running on some of my
          >> sites for quite long, working fine in Netscape (up to 4.75) and
          >> IE. It still works in the newer IEs, but not in the new Mozillas,
          >> neither Firebird nor Firefox (and not in Netscape 7.something).[/color]
          >
          >This script contains the Netscape 4.x layer tag. This tag was dropped
          >from the Gekco base browsers. Netscape 6.x, firefox, etc. This is the
          >reason for the failure.[/color]

          Since there is no document.layers object, it doesn't detect modern
          Netscape as being Netscape at all, and so it never writes the LAYER
          tags. It writes the IE code, instead.

          However, even the IE code is garbage. It creates multiple <div>
          tags with the same ID and then refers to them as elements of a
          global array by the name of that ID tag.

          It's pretty sad that IE tolerates this garbage.

          You would be better off find new code. This sort of thing should be
          available.

          Comment

          • RobB

            #6
            Re: Javascript doesn't work in newer Mozillas...

            Lee wrote:[color=blue]
            > Robert said:[color=green]
            > >
            > >In article <41F11353.58AAB BFA@steppe.mn>, Cat <cat@steppe.m n> wrote:
            > >[color=darkred]
            > >> Greetings,
            > >>
            > >> I have an old javascript effect that was running on some of my
            > >> sites for quite long, working fine in Netscape (up to 4.75) and
            > >> IE. It still works in the newer IEs, but not in the new Mozillas,
            > >> neither Firebird nor Firefox (and not in Netscape 7.something).[/color]
            > >
            > >This script contains the Netscape 4.x layer tag. This tag was[/color][/color]
            dropped[color=blue][color=green]
            > >from the Gekco base browsers. Netscape 6.x, firefox, etc. This is[/color][/color]
            the[color=blue][color=green]
            > >reason for the failure.[/color]
            >
            > Since there is no document.layers object, it doesn't detect modern
            > Netscape as being Netscape at all, and so it never writes the LAYER
            > tags. It writes the IE code, instead.
            >
            > However, even the IE code is garbage. It creates multiple <div>
            > tags with the same ID and then refers to them as elements of a
            > global array by the name of that ID tag.
            >
            > It's pretty sad that IE tolerates this garbage.
            >
            > You would be better off find new code. This sort of thing should be
            > available.[/color]

            Lee pretty much covered it ('garbage')...i n addition, the script is
            written in such a way as to optimize differences in animation
            efficiencies between (some) browsers, making any sort of uniform
            timebase a kludge at best. style.pixelLeft/Top are IE-only. In any
            event...dumped the LAYERS, cleaned it up a bit. Whatever.

            <html>
            <head>
            <title>untitled </title>
            </head>
            <body bgcolor="#00000 0"
            onresize="windo w.location.relo ad()"
            onload="setInte rval('fly()', window.createPo pup?80:1);"><!-- a little
            speed equalization -->
            <script type="text/javascript">

            var SmallStars = 27;
            var LargeStars = 3;
            var SmallYpos = [];
            var SmallXpos = [];
            var LargeYpos = [];
            var LargeXpos = [];
            var Smallspeed = [];
            var Largespeed = [];
            document.write(
            '<div style="position :absolute;top:0 px;left:0px;">' ,
            '<div style="position :relative;">'
            );
            for (i = 0; i < SmallStars; i++) {
            document.write(
            '<div id="si' + i + '" ',
            'style="positio n:absolute;top: 0;left:0;',
            'width:1px;heig ht:1px;backgrou nd:#fff;',
            'font-size:1px;"></div>'
            );
            }
            document.write(
            '</div>','</div>',
            '<div style="position :absolute;top:0 ;left:0;">',
            '<div style="position :relative;">'
            );
            for (i = 0; i < LargeStars; i++) {
            document.write(
            '<div id="li' + i + '" ',
            'style="positio n:absolute;top: 0;left:0;',
            'width:2px;heig ht:2px;backgrou nd:#fff;',
            'font-size:2px;"></div>'
            );
            }
            document.write( '</div>','</div>');
            WinHeight = ('undefined' != typeof window.innerHei ght)?
            window.innerHei ght : document.body.c lientHeight;
            WinWidth = ('undefined' != typeof window.innerWid th)?
            window.innerWid th-5 : document.body.c lientWidth-5;
            for (i = 0; i < SmallStars; i++) {
            SmallYpos[i] = Math.round(Math .random() * WinHeight);
            SmallXpos[i] = Math.round(Math .random() * WinWidth);
            Smallspeed[i]= Math.random() * 5 + 1;
            }
            for (i = 0; i < LargeStars; i++) {
            LargeYpos[i] = Math.round(Math .random() * WinHeight);
            LargeXpos[i] = Math.round(Math .random() * WinWidth);
            Largespeed[i] = Math.random() * 10 + 5;
            }

            function fly() {
            var hscrll = ('undefined' != typeof window.pageYOff set)?
            window.pageYOff set : document.body.s crollTop;
            var wscrll = ('undefined' != typeof window.pageXOff set)?
            window.pageXOff set : document.body.s crollLeft;
            for (i = 0; i < LargeStars; i++) {
            LargeXpos[i] -= Largespeed[i];
            if (LargeXpos[i] < -10) {
            LargeXpos[i] = WinWidth;
            LargeYpos[i] = Math.round(Math .random() * WinHeight);
            Largespeed[i] = Math.random() * 10 + 5;
            }
            }
            i = 0;
            while (li = document.getEle mentById('li' + i)) {
            li.style.left = LargeXpos[i] + 'px';
            li.style.top = LargeYpos[i++] + hscrll + 'px';
            }
            for (i = 0; i < SmallStars; i++) {
            SmallXpos[i] -= Smallspeed[i];
            if (SmallXpos[i] < -10) {
            SmallXpos[i] = WinWidth;
            SmallYpos[i] = Math.round(Math .random()*WinHe ight);
            Smallspeed[i] = Math.random() * 5 + 1;
            }
            }
            i = 0;
            while (si = document.getEle mentById('si' + i)) {
            si.style.left = SmallXpos[i] + 'px';
            si.style.top = SmallYpos[i++] + hscrll + 'px';
            }
            }

            </script>
            </body>
            </html>

            Comment

            • Randy Webb

              #7
              Re: Javascript doesn't work in newer Mozillas...

              Richard wrote:[color=blue]
              > On Fri, 21 Jan 2005 15:36:03 +0100 Cat wrote:
              >
              >[color=green]
              >>Greetings,[/color]
              >
              >[color=green]
              >>I have an old javascript effect that was running on some of my
              >>sites for quite long, working fine in Netscape (up to 4.75) and
              >>IE. It still works in the newer IEs, but not in the new Mozillas,
              >>neither Firebird nor Firefox (and not in Netscape 7.something).[/color]
              >
              >
              > Maybe due to the ancient ways of doing things.
              >
              > document.write( '</div>');
              > document.write( '</div>');
              > document.write( '<div style="position :absolute;top:0 px;left:0px">') ;
              > document.write( '<div style="position :relative">');
              >
              >
              > Convert all of this stuff into css.
              > <div> should come before </div> not as you show it.[/color]

              To the OP: Ignore the above advice. If Richard had bothered to *read*
              the code, he would have noticed that it does indeed have them in the
              correct order. It's typical of his hairbrained replies.

              --
              Randy
              comp.lang.javas cript FAQ - http://jibbering.com/faq

              Comment

              • RobB

                #8
                Re: Javascript doesn't work in newer Mozillas...


                (snip)

                OK, cleaned this up a bit. Beware of lunatic line breaking courtesy of
                googlegroups (turn on error reporting and look for unterminated
                strings).

                <html>
                <head>
                <title>untitled </title>
                </head>
                <body style="backgrou nd:#000;"
                onresize="windo w.location.relo ad()"
                onload="if(docu ment.getElement ById)setInterva l('fly()', 40)">
                <script type="text/javascript">

                var SmallStars = 27;
                var LargeStars = 3;
                var SmallYpos = [];
                var SmallXpos = [];
                var LargeYpos = [];
                var LargeXpos = [];
                var Smallspeed = [];
                var Largespeed = [];
                document.write(
                '<div style="position :absolute;top:0 px;left:0px;">' ,
                '<div style="position :relative;">'
                );
                for (i = 0; i < SmallStars; i++) {
                document.write(
                '<div id="si' + i + '" ',
                'style="positio n:absolute;top: 0;left:0;',
                'width:1px;heig ht:1px;backgrou nd:#fff;',
                'font-size:1px;"></div>'
                );
                }
                document.write(
                '</div>','</div>',
                '<div style="position :absolute;top:0 ;left:0;">',
                '<div style="position :relative;">'
                );
                for (i = 0; i < LargeStars; i++) {
                document.write(
                '<div id="li' + i + '" ',
                'style="positio n:absolute;top: 0;left:0;',
                'width:2px;heig ht:2px;backgrou nd:#fff;',
                'font-size:2px;"></div>'
                );
                }
                document.write( '</div>','</div>');
                WinHeight = ('undefined' != typeof window.innerHei ght)?
                window.innerHei ght : document.body.c lientHeight;
                WinWidth = ('undefined' != typeof window.innerWid th)?
                window.innerWid th-5 : document.body.c lientWidth-5;
                for (i = 0; i < SmallStars; i++) {
                SmallYpos[i] = Math.round(Math .random() * WinHeight);
                SmallXpos[i] = Math.round(Math .random() * WinWidth);
                Smallspeed[i]= Math.random() * 5 + 1;
                }
                for (i = 0; i < LargeStars; i++) {
                LargeYpos[i] = Math.round(Math .random() * WinHeight);
                LargeXpos[i] = Math.round(Math .random() * WinWidth);
                Largespeed[i] = Math.random() * 10 + 5;
                }

                function fly() {
                var hscrll = ('undefined' != typeof window.pageYOff set)?
                window.pageYOff set : document.body.s crollTop;
                var wscrll = ('undefined' != typeof window.pageXOff set)?
                window.pageXOff set : document.body.s crollLeft;
                for (i = 0; i < LargeStars; i++) {
                LargeXpos[i] -= Largespeed[i];
                if (LargeXpos[i] < -10) {
                LargeXpos[i] = WinWidth;
                LargeYpos[i] = Math.round(Math .random() * WinHeight);
                Largespeed[i] = Math.random() * 10 + 5;
                }
                }
                i = 0;
                while (li = document.getEle mentById('li' + i)) {
                li.style.left = LargeXpos[i] + 'px';
                li.style.top = LargeYpos[i++] + hscrll + 'px';
                }
                for (i = 0; i < SmallStars; i++) {
                SmallXpos[i] -= Smallspeed[i];
                if (SmallXpos[i] < -10) {
                SmallXpos[i] = WinWidth;
                SmallYpos[i] = Math.round(Math .random()*WinHe ight);
                Smallspeed[i] = Math.random() * 5 + 1;
                }
                }
                i = 0;
                while (si = document.getEle mentById('si' + i)) {
                si.style.left = SmallXpos[i] + 'px';
                si.style.top = SmallYpos[i++] + hscrll + 'px';
                }
                }

                </script>
                </body>
                </html>

                Comment

                • Cat

                  #9
                  Re: Javascript doesn't work in newer Mozillas...

                  Hi,

                  thank you so very much for this, it works like a charm now.
                  I read the newsgroups in my old Netscape 4.8 still, so I don't
                  have problems with the linebreaks.

                  I will go through it and see where you made changes, hopefully
                  I learn something from it. For some reason, Javascript, like
                  cgi, comes terribly hard to me, even though I love to use it.
                  Maybe because it has something to do with logic, that's just not
                  my world (I'm a former painter that started out as a designer,
                  still longing for the brushes..;)

                  Thanks again,

                  Cat



                  RobB wrote:[color=blue]
                  >
                  > (snip)
                  >
                  > OK, cleaned this up a bit. Beware of lunatic line breaking courtesy of
                  > googlegroups (turn on error reporting and look for unterminated
                  > strings).
                  >
                  > <html>
                  > <head>
                  > <title>untitled </title>
                  > </head>
                  > <body style="backgrou nd:#000;"
                  > onresize="windo w.location.relo ad()"
                  > onload="if(docu ment.getElement ById)setInterva l('fly()', 40)">
                  > <script type="text/javascript">
                  >
                  > var SmallStars = 27;
                  > var LargeStars = 3;
                  > var SmallYpos = [];
                  > var SmallXpos = [];
                  > var LargeYpos = [];
                  > var LargeXpos = [];
                  > var Smallspeed = [];
                  > var Largespeed = [];
                  > document.write(
                  > '<div style="position :absolute;top:0 px;left:0px;">' ,
                  > '<div style="position :relative;">'
                  > );
                  > for (i = 0; i < SmallStars; i++) {
                  > document.write(
                  > '<div id="si' + i + '" ',
                  > 'style="positio n:absolute;top: 0;left:0;',
                  > 'width:1px;heig ht:1px;backgrou nd:#fff;',
                  > 'font-size:1px;"></div>'
                  > );
                  > }
                  > document.write(
                  > '</div>','</div>',
                  > '<div style="position :absolute;top:0 ;left:0;">',
                  > '<div style="position :relative;">'
                  > );
                  > for (i = 0; i < LargeStars; i++) {
                  > document.write(
                  > '<div id="li' + i + '" ',
                  > 'style="positio n:absolute;top: 0;left:0;',
                  > 'width:2px;heig ht:2px;backgrou nd:#fff;',
                  > 'font-size:2px;"></div>'
                  > );
                  > }
                  > document.write( '</div>','</div>');
                  > WinHeight = ('undefined' != typeof window.innerHei ght)?
                  > window.innerHei ght : document.body.c lientHeight;
                  > WinWidth = ('undefined' != typeof window.innerWid th)?
                  > window.innerWid th-5 : document.body.c lientWidth-5;
                  > for (i = 0; i < SmallStars; i++) {
                  > SmallYpos[i] = Math.round(Math .random() * WinHeight);
                  > SmallXpos[i] = Math.round(Math .random() * WinWidth);
                  > Smallspeed[i]= Math.random() * 5 + 1;
                  > }
                  > for (i = 0; i < LargeStars; i++) {
                  > LargeYpos[i] = Math.round(Math .random() * WinHeight);
                  > LargeXpos[i] = Math.round(Math .random() * WinWidth);
                  > Largespeed[i] = Math.random() * 10 + 5;
                  > }
                  >
                  > function fly() {
                  > var hscrll = ('undefined' != typeof window.pageYOff set)?
                  > window.pageYOff set : document.body.s crollTop;
                  > var wscrll = ('undefined' != typeof window.pageXOff set)?
                  > window.pageXOff set : document.body.s crollLeft;
                  > for (i = 0; i < LargeStars; i++) {
                  > LargeXpos[i] -= Largespeed[i];
                  > if (LargeXpos[i] < -10) {
                  > LargeXpos[i] = WinWidth;
                  > LargeYpos[i] = Math.round(Math .random() * WinHeight);
                  > Largespeed[i] = Math.random() * 10 + 5;
                  > }
                  > }
                  > i = 0;
                  > while (li = document.getEle mentById('li' + i)) {
                  > li.style.left = LargeXpos[i] + 'px';
                  > li.style.top = LargeYpos[i++] + hscrll + 'px';
                  > }
                  > for (i = 0; i < SmallStars; i++) {
                  > SmallXpos[i] -= Smallspeed[i];
                  > if (SmallXpos[i] < -10) {
                  > SmallXpos[i] = WinWidth;
                  > SmallYpos[i] = Math.round(Math .random()*WinHe ight);
                  > Smallspeed[i] = Math.random() * 5 + 1;
                  > }
                  > }
                  > i = 0;
                  > while (si = document.getEle mentById('si' + i)) {
                  > si.style.left = SmallXpos[i] + 'px';
                  > si.style.top = SmallYpos[i++] + hscrll + 'px';
                  > }
                  > }
                  >
                  > </script>
                  > </body>
                  > </html>[/color]

                  Comment

                  Working...