  var pageImages = new Array();
  pageImages[0] = new Image(); pageImages[0].src = "images/ringoPeace.gif";
  pageImages[1] = new Image(); pageImages[1].src =  "images/star1.gif";
  pageImages[2] = new Image(); pageImages[2].src = "images/star2.gif";
  pageImages[3] = new Image(); pageImages[3].src = "images/star3.gif";
  pageImages[4] = new Image(); pageImages[4].src = "images/star4.gif";
  pageImages[5] = new Image(); pageImages[5].src = "images/star5.gif";
  pageImages[6] = new Image(); pageImages[6].src = "images/star6.gif";
  pageImages[7] = new Image(); pageImages[7].src = "images/home.gif";
  pageImages[8] = new Image(); pageImages[8].src = "images/biography.gif";
  pageImages[9] = new Image(); pageImages[9].src = "images/discography.gif";
  pageImages[10] = new Image(); pageImages[10].src = "images/ringoPeace10.gif";
  pageImages[11] = new Image(); pageImages[11].src = "images/ringoPeace11.gif";
  pageImages[12] = new Image(); pageImages[12].src = "images/ringoPeace12.gif";
  pageImages[13] = new Image(); pageImages[13].src = "images/ringoPeace.gif";
var i = 0;
var j;
var IntervalID;
var FadeInterval;
var TwinkleStars;
var run = "0";
var spot="1";
var origTop = ["4", "4", "38", "17","32", "0", "-7", "75", "147", "3", "4", "54", "49"];
var origLeft = ["35", "190", "353", " 49", "243", "410", "434", "78", "31", "548","68", "12", "80"];
function startFade() {
          if (i<=500) {
            setTimeout("fadeIn()", 80);
         }
}



function startTwink(spot, j){
         if(j==0){
             twinkle(spot);
        }else if (j<100) { 
        	setTimeout("twinkle('"+spot+"')", 10);
        }
    }
  
   



/* lightup() was taken from an article by John John at
    http://www.codeproject.com/jscript/opacity.asp   */
function lightup(imageobject, opa){

   imageobject.style.MozOpacity=opa/100;
	imageobject.style.opacity=opa/100;
	if (imageobject.filters) {
    imageobject.filters.alpha.opacity=opa;
	}

}


function fadeIn(speed) {
	i++;
	startFade();
	if ((navigator.appName).indexOf("Microsoft")!=-1) {

		if ( i == 1 && page == 'showring'){
 // Internet Explorer-specific code goes here
			lightup(document.images["Ringo"], 100);
		}
	} else {
		if (document.images["Ringo"] && (i<=10))  {     // Ringo fade i
			lightup(document.images["Ringo"], i*10);
		}                     // end Ringo fade in
		if ((document.getElementById('fader')) && (i<=20)) {     // background fade in
			lightup(document.getElementById('fader'), i*5);
		}                // end background fade in
	}
        if (i<26) {            //   signature animation
              t=i*3+4;
               t += "px";
              document.images["sig"].style.top = t;
         }                        // end signature animation


       
   
 }

function cloudsMove() {               //cloud group
            setTimeout("cloudsMove()", 80);

             for (e=8; e<12;e++){
             cloudr = document.images["cloud"+e];
                  if ((parseInt(cloudr.style.left) >= "750") || (parseInt(cloudr.style.top) >= "160")) {
		  cloudr.style.left = (origLeft[e]-300)+"px";
		   cloudr.style.top = (origTop[e]-100)+"px";

		   } else {
                    cloudr.style.left = parseInt(cloudr.style.left)+1 +"px"; 
		    cloudr.style.top = parseInt(cloudr.style.top)+1 +"px";
		  }
                }
          
           for (c=1; c<4;c++){
             cloud = document.images["cloud"+c];
               if( parseInt(cloud.style.left) >= "753") {
		cloud.style.left = (origLeft[c]-300)+"px";
		} else{
               cloud.style.left = parseInt(cloud.style.left)+5 +"px";
		}
            }

                  for (d=4; d<8;d++){
             cloudy = document.images["cloud"+d];
	       if ((parseInt(cloudy.style.left) >= "760")|| (parseInt(cloudy.style.top) >= "160")){
              cloudy.style.left = (origLeft[d]-300) +"px";
             cloudy.style.top = (origTop[d]-100)+"px";
		} else {
              cloudy.style.left = parseInt(cloudy.style.left)+3 +"px";
             cloudy.style.top = parseInt(cloudy.style.top)+1+"px";
                }

          }  

}

// julian's function for moving the clouds
function moveClouds(x, y, objRef, boxX, boxY)
{
	left = parseInt(objRef.style.left)+x;
	top = parseInt(objRef.style.top)+y
	if( (left + objeRef.width) < boxX)
	{
		objRef.style.left = left;
	}
	if ( (top + objRef.height) < boxY )
	{
		objRef.sytle.top = top;
	}
	
}


function twinkle(spot) {
         	if(j<100) {
      startTwink(spot, j);
}
        j++;
     // lightup(document.images[spot+"button"], i);
    if (( j==1) || !(j%20 >=1) ){
            for (n=1;n<6;n++){
                 randStar = (Math.round((Math.random()*5)+1));
                 myStar= spot + "star"+ n;
               //  this.getElementByName[myStar].src = "images/star"+randStar+".gif";
                 document.images[myStar].src = "images/star"+randStar+".gif";
            }
         
    }
      


      // IntervalID = setInterval("twinkle(spot)", 100);
    //  doit = spot + ", " + speed;
      //  setTimeout("twinkle("+doit+")", 100);
}

function endAnim(spot) {
       startTwink(spot, 100);
    //lightup(document.images[spot+"home"], 100);
   // clearInterval(IntervalID);
   
   for(n=1;n<6;n++){
       document.images[spot+"star"+n].src = "images/blank.gif";
   }
}

   var bright = new Array;  // how opaque?
   var dir = new Array;  // the direction of fading (in or out)
   cd=1;
   bright = [1,1,1,1,1,1,1];
   dir =[2,2,2,2,2,2];
function cdAnim(){
	
setTimeout("cdAnim()", 80);
	     if( bright[cd] >= 100) {
			dir[cd] = 2 ;
		} else if (bright[cd] <= 0 ) {
			dir[cd] = 1;
			if (cd >= 6) {
				cd =1;
			} else {
				cd++;
			}
		}
		if(dir[cd] ==1) {
			bright[cd] += 5;
		} else {
			bright[cd] -= 5;
		} 
		lightup(document.images["bg"+cd], bright[cd]); 

}
