
// Change Image Function
function change_image(image)
{
	// Compatability Check
	if(document.images)
	{
		// Wait and then loop
		setTimeout("change_image(document.images.random_image)", 15000);
		
		// Fade Out Current Image
		FadeOut(random_image);
		
		// Fade In New Image after delay
		setTimeout("FadeIn(random_image,image_counter);",3000);
	
		// Reset counter if we have no images left, else increament counter
		if(image_counter + 1 == image_array.length)
		{
			image_counter = 0; // Reset Counter
		}
		else image_counter++; // Increament Counter
	}
}

// Fade Out Given Image
function FadeOut(image) 
{
  // Check Browser Compatable
  if (document.all) 
  {
    // Set no transparacy
	image.opacity = 100; 
	
	// Fade Out Image
    setOpacity(image.name, -5, 100);
  }
}

// Fade In Given Image
function FadeIn(image,image_counter) 
{
  // Check Browser Compatable
  if (document.all) 
  {
    // Set New Image SRC (ie change image)
	image.src = image_array[image_counter].src;
	
	// Set New Image at Full Transparancy
	image.opacity = 0;
	
	// Fade In New Image
    setOpacity(image.name, 3, 100);
  }
}

// Set Image Opacity (ie Transparancy)
function setOpacity(imageName, step, delay) 
{
  // Declare Image
  var image = document.images[imageName];
  
  // Prepare Images New Opacity
  image.opacity += step;
  
  // If Browser Supports.. Reduce Image Opacity by given amount/step
  if (document.all) image.style.filter = 'alpha(opacity = ' + image.opacity + ')'; 
  
  // If Image not yet fully transparent/non transparent then loop after given delay
  if (step > 0 && image.opacity < 100 || step < 0 && image.opacity > 0)
  {
   	setTimeout('setOpacity("' + image.name + '",' + step + ', ' + delay + ')', delay);
  }	
}

// Set White Bullet Point On MouseOut 
function bp_mouseout(bp) 
{
  if (document.images) document [bp].src = 'images/bullet_transparent.gif';
} 
 
// Set Grey Bullet Point On MouseOver
function bp_mouseover(bp) 
{
  if (document.images) document [bp].src = 'images/bullet.gif';  
} 
