function fly()
{
var altezza=300000
var bassacc=7000;
var fluido=7;
var ora=0
var veloc=0

while ((altezza>0) & (fluido>0)) 
    {var esito=confirm("Hours of flight=" + ora + "\n Fractalus distance= " + altezza + " km \n Shuttle 64 current speed= " + veloc + " km per hour \n \n Do you wish to give the spaceship a high speed acceleration? \n \n Press OK to set acceleration lever to HIGH \n Press CANCEL to set it to LOW");
     if (esito==0)  
         {var dist=Math.round(Math.random()*bassacc);
         }          
     else {var dist=(7000+Math.round(Math.random()*bassacc));  
         };
       veloc=(veloc+dist);
       altezza=altezza-veloc; 
       if (altezza<0) {altezza=0} 
       fluido=fluido-1;
       ora=ora+1} 
alert('Hours of flight=' + ora + '\n Fractalus distance= ' + altezza + ' km \n Shuttle 64 current speed= ' + veloc + '\n'); 
if (altezza==0) {alert('CRASH!! Just as Shuttle 64 experiences a tremendous impact with the fractalian surface, you feel someone patting on your shoulder, open your eyes and *phew!* realize you have been daydreaming... - So, are you ready to pilot Shuttle 64? - the commander of the paladin space center asks you... ')}
else {while ((altezza>0) && (veloc>0))
{alert('Shuttle 64 starting to decelerate \n \n Hours of flight=' + ora + '\n Fractalus distance= ' + altezza + ' km \n Shuttle 64 current speed= ' + veloc + ' km per hour \n'); 
var dist=(5000+Math.round(Math.random()*5000));
       altezza=altezza-veloc; 
       veloc=(veloc-dist);
       if (veloc<0) {veloc=0};
       if (altezza<0) {altezza=0};
       fluido=fluido-1;
       ora=ora+1}
if ((veloc==0) && (altezza>0)) {alert ('OH, NO!!! LOST IN SPACE!! \n \n Hours of flight=' + ora + '\n Fractalus distance= ' + altezza + ' km \n Shuttle 64 current speed= ' + veloc + ' km per hour \n \n Just as you begin to shudder at the thought of remaining stuck for months in space, in vain waiting for aid, you feel someone patting on your shoulder, open your eyes and *phew!* realize you have been daydreaming... - So, are you ready to pilot Shuttle 64? - the commander of the paladin space center asks you...  ')}
else {alert('IMPACT! \n \n Hours of flight=' + ora + '\n Fractalus distance= ' + altezza + ' km \n Shuttle 64 current speed= ' + veloc + ' km per hour \n'); 
if (veloc>20000) {alert('CRASH!! Just as Shuttle 64 experiences a tremendous impact with the fractalian surface, you feel someone patting on your shoulder, open your eyes and *phew!* realize you have been daydreaming... - So, are you ready to pilot Shuttle 64? - the commander of the paladin space center asks you...')} 
else {alert('CONGRATULATIONS!!! You have made it safely to Fractalus!!! \n '); document.location="bazaar/fracmoon.htm"}; 
}}}
