
  var base_background_blank_url   = "http://mythicmktg.fileburst.com/uo/uoherald/images/mw_blank.jpg";
  var current_option_num = 0;
  var next_option_num = 0;
  var main_opacity = 100;
  var secondary_opacity = 0;
  var rotation_timer;
  var fade_timer;
	var header_images = new Array();


////////////// Change Rotation HERE //////////////////////

  var rotation_millisecs = 4 * 1000 // 4 secs

	//Option 1
	header_images[header_images.length] = {
		file : "mw_2009-09_Styg.jpg",
		title : "Stygian Abyss",
		link : "http://www.uoherald.com/stygianabyss/launch/"
	};
	//Option 2
	header_images[header_images.length] = {
		file : "mw_2009-07_Mondains.jpg",
		title : "Mondain's Legacy",
		link : "http://www.uoherald.com/uoml/"
	};
	//Option 3
	header_images[header_images.length] = {
		file : "mw_2009-09_UOgamecodes.jpg",
		title : "UO Game Codes",
		link : "http://www.uogamecodes.com/"
	};


///////////////////////////////////////////////////////////


  function init()
  {
  	rotate();
  }

  function displayDefaultOption()
  {
  	var display;

  	document.write('<div id="flashColumn"><a id="main_link" href="' + header_images[0].link + '" onclick="this.blur();" target="_blank"><img id="main_image" name="main_image" src="' + image_root + header_images[0].file + '" alt="option1" title="' + header_images[0].title + '" /></a><img id="secondary_image" src="' + base_background_blank_url + '"/></div>');
  }

  /**
   * SelectOption is used when a user clicks on a miniature box below
   * the main image link window.
   */
  function selectOption(option_id)
  {
  	//Stop all timers
  	killRotate();

  	//Parse Id Num from optionId
  	id_num = option_id.substring(option_id.length-1,option_id.length);

  	//Set current option number with id casted to an int
  	current_option_num = parseInt(id_num);

  	//Set opacity levels
  	main_opacity = 100;
  	secondary_opacity = 0;

  	//Function to swap images and links of main image
  	toggleOption(id_num);

  	//Set rotation to begin again in 10 seconds
  	rotation_timer = setTimeout("rotate()",40000);
  }

  /**
   * ToggleOption swaps the image and link information of the main image
   * link window.
   */
  function toggleOption(id_num)
  {
  	var main_image_container = document.getElementById("main_image");
  	var main_link_container = document.getElementById("main_link");
  	var secondary_image_container = document.getElementById("secondary_image");

  	//Swap image, link, and title information
  	main_image_container.src = image_root + header_images[id_num].file;
  	main_image_container.title = header_images[id_num].title;
  	main_link_container.href = header_images[id_num].link;

  	//Set opacity levels
  	main_image_container.style.opacity = main_opacity / 100;
  	main_image_container.style.filter = "alpha(opacity='"+ main_opacity +"')";
  	secondary_image_container.style.opacity = secondary_opacity / 100;
  	secondary_image_container.style.filter = "alpha(opacity='"+ secondary_opacity +"')";

  }

  /**
   * Rotate is a controller function to initiate the fading rotation
   * of images and links in the main image window.
   */
  function rotate()
  {
  	//Set next option number
  	if(current_option_num >= (header_images.length - 1))
  		next_option_num = 0;
  	else
  		next_option_num = current_option_num + 1;

  	//Start image fading timer
  	rotation_timer = setTimeout("fadeImages(current_option_num, next_option_num, true)",rotation_millisecs);
  }

  /**
   * KillRotate clears all timers involved in rotating images in the main
   * image window
   */
  function killRotate()
  {
  	window.clearTimeout(rotation_timer);
  	window.clearTimeout(fade_timer);
  }

  /**
   * FadeImages performs the visual process of fading from one image to
   * the next in the main image window based on the opacity levels at
   * each recursion.
   */
  function fadeImages(prev,next,init)
  {
  	var main_container = document.getElementById("main_container");
  	var main_image = document.getElementById("main_image");
  	var secondary_image = document.getElementById("secondary_image");

  	if(init)
  	{
  		//Swap secondary image and set opacity
  		secondary_image.src = image_root+ header_images[next_option_num].file;
  		secondary_image.style.opacity = secondary_opacity / 100;
  		secondary_image.style.filter = "alpha(opacity='"+ secondary_opacity +"')";

  		//Ensure main image is at full opacity
  		main_image.style.opacity = main_opacity / 100;
  		main_image.style.filter = "alpha(opacity='"+ main_opacity +"')";
  	}
  	else
  	{
  		//Alter opacity values accordingly
  		secondary_opacity += 5;
  		main_opacity -= 5;
  	}

  	//Set layers to altered opacity values
  	secondary_image.style.filter = "alpha(opacity='"+ secondary_opacity +"')";
  	secondary_image.style.opacity = secondary_opacity / 100;
  	main_image.style.filter = "alpha(opacity='"+ main_opacity +"')";
  	main_image.style.opacity = main_opacity / 100;

  	if(main_opacity > 0)
  	{
  		//Recurse if main_image isn't completely faded out yet
  		fade_timer = setTimeout("fadeImages(current_option_num, next_option_num, false)",25);
  	}
  	else
  	{
  		//Stop fade timer
  		window.clearTimeout(fade_timer);

  		//Update current option index
  		current_option_num = next_option_num;

  		//Reset opacity levels
  		main_opacity = 100;
  		secondary_opacity = 0;

  		//Flip main_image with whats seen in the secondary_image
  		toggleOption(next_option_num);

  		//Continue rotation
  		rotate();
  	}
  }

  init();

