function secondAppear() {
$('myBox').setOpacity(0);
$('myBox').setStyle({visibility: 'visible'});
new Effect.Opacity(
   'myBox', { 
      from: 0.0, 
      to: 1.0,
      duration: 3.5
   }
);
}

function firstAppear() {
$('myBox1').setOpacity(0);
$('myBox1').setStyle({visibility: 'visible'});
new Effect.Opacity(
   'myBox1', { 
      from: 0.0, 
      to: 1.0,
      duration: 0.4
   }
);
}
function beginFades(){
	firstAppear();
    var t=setTimeout("secondAppear()",500);
}

	var theImages = new Array()
	theImages[0] = 'images/BH_Home_1.jpg'
	theImages[1] = 'images/BH_Home_2.jpg'
	theImages[2] = 'images/BH_Home_3.jpg'
	theImages[3] = 'images/BH_Home_4.jpg'


	var j = 0
	var p = theImages.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
	   preBuffer[i] = new Image()
	   preBuffer[i].src = theImages[i]
	}
	var whichImage = Math.round(Math.random()*(p-1));
	var whichBG = whichImage+1;
	function showImage(){
		document.write('<img src="images/Home_Texture_'+whichBG+'.jpg" class="bg" id="myBox1" style="visibility:hidden;" >');
	document.write('<img src="'+theImages[whichImage]+'" class="bg" id="myBox" style="visibility:hidden;" >');
	}
