function correct(){
wid=screen.width;
ht=screen.height;
document.getElementById('bgtint').style.width=wid+'px'; // set width of bgColor
document.getElementById('bgtint').style.height=ht+'px';  // set height of bgColor

document.getElementById('tright').style.left=wid+'px';  // position stability division top right
document.getElementById('bleft').style.top=ht+'px';  // position stability division bottom left
document.getElementById('bright').style.left=wid+'px';  // position stability division bottom right
document.getElementById('bright').style.top=ht+'px';  // second part of bottom right

/* The next 3 for loops adjust positions of rocket stars for screen dimensions of browser */

for(i=0;i<20;i++){
var y5=.75*screen.height;
var dx5=(screen.width)/20;
var x5=i*dx5;
document.getElementById('star5'+i).style.left=x5+'px';
document.getElementById('star5'+i).style.top=y5+'px';
                 }  // end for



for(i=0;i<20;i++){
var y6=.75*screen.height;
var dx6=(screen.width)/20;
var x6=i*dx6;
document.getElementById('star6'+i).style.left=x6+'px';
document.getElementById('star6'+i).style.top=y6+'px';
                 } 



for(i=0;i<20;i++){
var y7=.75*screen.height;
var dx7=(screen.width)/20;
var x7=i*dx7;
document.getElementById('star7'+i).style.left=x7+'px';
document.getElementById('star7'+i).style.top=y7+'px';
                 }  // end for


                         }  // end correct function

var i,ip,n=20,x=200,y=200 ; // circles
var dang=(2*Math.PI)/n;var count=0;
var rmax=50;var r=0;var count=0;

function grow(){
var ang=0 ;
for(i=0;i<n;i++){
lpos=Math.round(x + r*Math.cos(ang));
tpos=Math.round(y - r*Math.sin(ang));

document.getElementById('star'+i).style.top=tpos+'px';
document.getElementById('star'+i).style.left=lpos+'px';
ang=ang+dang
                } // end for
r=r+5;
if(r<rmax){setTimeout("grow()",100)}
else
{setTimeout("regroup()",1000)};
} // end grow

function regroup(){

x=Math.floor(screen.width*Math.random());
y=Math.floor(.5*screen.height*Math.random());

for(i=0;i<n;i++){
document.getElementById('star'+i).style.left=x+'px';
                }

for(ip=0;ip<n;ip++){
document.getElementById('star'+ip).style.top=y+'px';
                }

rmax=50 + Math.round(.1*(screen.width)*Math.random())
r=0;
count=count+1;
if(count==20){grow10()};
if(count<20){setTimeout("grow()",1000)};

                  }  // end regroup

/* rose curve */


var ia,ib,n10=40,x10=200,y10=200,count10=0
var dang10=(2*Math.PI)/n10;

var rmax10=50;var r10=0;
function grow10(){
var ang10=0 ;
for(ia=0;ia<n10;ia++){

lpos10 = (x10 + r10*Math.cos(2*ang10)*Math.cos(ang10));
tpos10 = (y10 + r10*Math.cos(2*ang10)*Math.sin(ang10));
document.getElementById('star'+ia).style.top=tpos10+'px';
document.getElementById('star'+ia).style.left=lpos10+'px';
ang10=ang10+dang10
               } // end for 
r10=r10+5;
if(r10<rmax10){setTimeout("grow10()",100)}
else
{setTimeout("regroup10()",1000)};
} // end grow

function regroup10(){

x10=Math.floor(screen.width*Math.random());
y10=Math.floor(.5*screen.height*Math.random());

for(ia=0;ia<n10;ia++){
document.getElementById('star'+ia).style.left=x10+'px'; 
                                 }

for(ib=0;ib<n10;ib++){
document.getElementById('star'+ib).style.top=y10+'px';
                }
rmax10=50 + Math.round(.1*(screen.width)*Math.random())
r10=0;count10=count10+1;

if(count10<20) 
{setTimeout("grow10()",1000)}
else
{grow9()};

                  }  // end regroup 10



var kk,ll,n9=20,x9=200,y9=200 ; //ovals
var dang9=(2*Math.PI)/n9;count9=0

var rmax9=4000 ; var r9=0; var ap9=1.5
function grow9(){
var ang9=0 ; var count9=0;
for(kk=0;kk<n9;kk++){

q9 = Math.cos(ang9);
t9 = Math.sqrt(r9/(ap9 - Math.pow(q9,2)));
lpos9 = Math.round((x9 + t9*Math.cos(ang9)));
tpos9 = Math.round((y9 + t9*Math.sin(ang9)));

document.getElementById('star'+kk).style.left=lpos9+'px';
document.getElementById('star'+kk).style.top=tpos9+'px';

ang9=ang9+dang9
                } // end for
r9=r9+200;
if(r9<rmax9){setTimeout("grow9()",100)}
else
{setTimeout("regroup9()",500)};
} // end grow

function regroup9(){

x9=Math.floor(screen.width*Math.random());
y9=Math.floor(.5*screen.height*Math.random());

for(kk=0;kk<n9;kk++){
document.getElementById('star'+kk).style.left=x9+'px'}

for(ll=0;ll<n9;ll++){
document.getElementById('star'+ll).style.top=y9+'px'};

rmax9=200 + Math.round(5*(screen.width)*Math.random());
r9=0;
ap9=1 + .9*Math.random();
count9=count9+1;
if (count9<20){setTimeout("grow9()",1000)}
else
{spiral()}
                  }  // end regroup



var m,n5=20 ;
var dang5=(2*Math.PI)/4;
var dx5=(screen.width)/n5;
var y5=.75*screen.height;

var rmax5=(Math.floor(.7*screen.height)) ;var anglim5=Math.PI - 2;

var ang5=1 + anglim5*Math.random(); var r5=0;
var flip5=Math.round((n5-1)*Math.random()) ;
x5=flip5*dx5; 

function grow5(){
lpos5=Math.round(x5 + r5*Math.cos(ang5));
tpos5=Math.round(y5 - r5*Math.sin(ang5));


document.getElementById('star5'+flip5).style.visibility="visible";

document.getElementById('star5'+flip5).style.left=lpos5+'px';

document.getElementById('star5'+flip5).style.top=tpos5+'px';

r5=r5+5;
if(r5<rmax5){setTimeout("grow5()",50)}
else
{

document.getElementById('star5'+flip5).style.visibility="hidden";

document.getElementById('star5'+flip5).style.left=x5+'px';

document.getElementById('star5'+flip5).style.top=y5+'px'

ang5=1 + anglim5*Math.random();r5=0;
flip5=Math.round((n5-1)*Math.random()) ;
x5=flip5*dx5;
setTimeout("grow5()",10)};
                } // end grow5


var n,n6=20 ;
var dang6=(2*Math.PI)/4;
var dx6=(screen.width)/n6;
var y6=.75*screen.height;

var rmax6=(Math.floor(.7*screen.height)) ;var anglim6=Math.PI - 2;

var ang6=1 + anglim6*Math.random(); var r6=0;
var flip6=Math.round((n6-1)*Math.random()) ;
x6=flip6*dx6; 

function grow6(){
lpos6=Math.round(x6 + r6*Math.cos(ang6));
tpos6=Math.round(y6 - r6*Math.sin(ang6));

document.getElementById('star6'+flip6).style.visibility="visible";

document.getElementById('star6'+flip6).style.left=lpos6+'px';

document.getElementById('star6'+flip6).style.top=tpos6+'px';

r6=r6+6;
if(r6<rmax6){setTimeout("grow6()",50)}
else
{

document.getElementById('star6'+flip6).style.visibility="hidden";

document.getElementById('star6'+flip6).style.left=x6+'px';

document.getElementById('star6'+flip6).style.top=y6+'px'

ang6=1 + anglim6*Math.random();r6=0;
flip6=Math.round((n6-1)*Math.random()) ;
x6=flip6*dx6;
setTimeout("grow6()",10)};
                } // end grow6



var ii,n7=20 ;
var dang7=(2*Math.PI)/4;
var dx7=(screen.width)/n7;
var y7=.75*screen.height;

var rmax7=(Math.floor(.7*screen.height)) ;var anglim7=Math.PI - 2;

var ang7=1 + anglim7*Math.random(); var r7=0;
var flip7=Math.round((n7-1)*Math.random()) ;
x7=flip7*dx7; 

function grow7(){
lpos7=Math.round(x7 + r7*Math.cos(ang7));
tpos7=Math.round(y7 - r7*Math.sin(ang7));

document.getElementById('star7'+flip7).style.visibility="visible";

document.getElementById('star7'+flip7).style.left=lpos7+'px';

document.getElementById('star7'+flip7).style.top=tpos7+'px';

r7=r7+7;
if(r7<rmax7){setTimeout("grow7()",50)}
else
{

document.getElementById('star7'+flip7).style.visibility="hidden";

document.getElementById('star7'+flip7).style.left=x7+'px';

document.getElementById('star7'+flip7).style.top=y7+'px'

ang7=1 + anglim7*Math.random();r7=0;
flip7=Math.round((n7-1)*Math.random()) ;
x7=flip7*dx7;
setTimeout("grow7()",10)};
                } // end grow7



/* spirals */
        var c1=.5 ;                                           // angle increments
        var z1=0 ;                                            // start angles
        var x1=239 ;                                    // spiral center x
        var y1=160 ;                                  // spiral center y
        var a1=.2 ;                                         // constant
        var to1=30 ;                                      // time delay
        var n1=40;                                      // number colored stars

var j=0, ctr=0;
function spiral(){
r1 = Math.E*Math.exp(a1*z1)
xpos1 = x1 + r1*Math.cos(z1); ypos1= y1 + r1*Math.sin(z1);

document.getElementById('star11'+j).style.left=xpos1+'px';
document.getElementById('star11'+j).style.top=ypos1+'px'
                                                              
z1=z1+c1; ctr=ctr+1;
if (ctr<n1) {setTimeout("spiral()",to1)}
else
{if(j<n1){j=j+1;z1=0;ctr=0;
setTimeout("spiral()",to1)}
x1=Math.round(screen.width*Math.random());
y1=Math.round(screen.height*Math.random())}  // end if

if(j==n1){for(k=0;k<n1;k++){
document.getElementById('star11'+k).style.visibility='hidden'
                                           }
};

}  // end spiral