// Graphic rollovers
var rslt;
var loaded = false; // Declares that images have not been loaded.

function newImg(img_src){ // Creates new image objects and loads the urls imto the browser's memory cache. Called by the loadImg function.
	if (document.images){ // Checks for the existence of the images[] array (JavaScript 1.1 and higher).
		rslt = new Image(); // Creates the image object.
		rslt.src = img_src; // Assigns the image source url to the new image object.
		return rslt; // Returns the result to the loadImg funtion.
	}
}

function loadImg(){ // Passes the urls to the newImg function. Called from the <BODY> tag: <BODY ONLOAD="loadImg();">
	if (document.images){ // Checks for the existence of the images[] array (JavaScript 1.1 and higher).

		// Begin Images Sources
		var img1 = newImg("images/nav_highlights_over.gif");
		var img2 = newImg("images/nav_letter_over.gif");
		var img3 = newImg("images/nav_everyday_over.gif");
		var img4 = newImg("images/nav_performance_over.gif");
		var img5 = newImg("images/nav_operating_over.gif");
		var img6 = newImg("images/nav_kosystem_over.gif");
		var img7 = newImg("images/nav_financial_data_over.gif");
		var img8 = newImg("images/nav_board_over.gif");
		var img9 = newImg("images/nav_management_over.gif");
		var img10 = newImg("images/nav_glossary_over.gif");
		var img11 = newImg("images/nav_policy_over.gif");
		var img12 = newImg("images/nav_sharehowner_over.gif");
		var img13 = newImg("images/nav_util_downloads_over.gif");
		var img14 = newImg("images/nav_util_survey_over.gif");
		var img15 = newImg("images/nav_util_order_over.gif");
		var img16 = newImg("images/nav_arrow_left_over.gif");
		var img17 = newImg("images/nav_arrow_right_over.gif");
		// End Images Sources

		loaded = true; // Lets the swapImg funtion know the images are loaded.
	}
}

// Swap images
var swapped = false; // Declares that no images are currently swapped.
var active_extension = "_over"; // Sets the filename extension for image active states.
var restore_info = new Array(); // Holds the image object names and urls for swapped images.
function swapImg(){ // Swaps and restores single or multiple images. Called by any event handler, usually onMouseOver.
	if (document.images && loaded == true && swapped == false){ // Performs if the images[] array (JavaScript 1.1 and higher) exists and if the loadImg function has completed.
		for (var i = 0; i < swapImg.arguments.length; i++){ // Loops for each set of two arguments (image name and url) passed by the event handler.
			restore_info[i * 2] = swapImg.arguments[i]; // Assigns the image name to the restore_info[] array.
			restore_info[i * 2 + 1] = document[swapImg.arguments[i]].src; // Assigns the original url to the restore_info[] array.
			document[swapImg.arguments[i]].src = document[swapImg.arguments[i]].src.substring(0, document[swapImg.arguments[i]].src.lastIndexOf('\.')) + active_extension + document[swapImg.arguments[i]].src.substring(document[swapImg.arguments[i]].src.lastIndexOf('\.')); // Assigns the new url to the image object.
		}
	} else if (document.images && loaded == true && swapped == true){ // Restores all swapped but non-locked images to their original urls. Called by any event handler, usually onMouseOut.
		for (var i = 0; i < restore_info.length; i += 2) document[restore_info[i]].src = restore_info[i + 1]; // Assigns the original url to the image object.
		restore_info = new Array(); // Resets the saved restore information.
	}
	swapped = !swapped; // Flips the swapped flag between swap and restore functionality.
}

// Flash 6 detection
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

// Open pop-up window with specified parameters
function newWindow(filePath, winName, winProperties){
	var newWin = window.open(filePath, winName, winProperties); newWin.focus()
}
