<!-- Hide the script from old browsers...

// Swaps an image's source file for a new one.
// e.g. <IMG ... onMouseOver="swapImage(this, 'on.gif')" onMouseOut="swapImage(this, 'off.gif')"
function swapImage(img, newImagePath)
{
	if (img != null)
	{
		img.src = newImagePath;
	}
}

// Navigates the current window to the given URL.
function nav(url)
{
	if (url != null)
	{
		window.location.href = url;
	} 
}

// Navigates the current window to the given URL, appending
// the value of the selected OPTION of the SELECT control 
// to the URL.
// 
// Useful for navigating to another page when the user 
// makes a new selection in a drop-down or list.
function navViaSelect(url, select)
{
	if (url != null && select != null)
	{
		var selectedValue = select[select.selectedIndex].value;
		
		if (selectedValue != null && selectedValue != '')
		{
			window.location.href = url + selectedValue;
		}
	}
}

// Clears the form given.
function clearForm(form)
{
	var elem;
	
	for (i = 0; i < form.elements.length; i++)
	{
		elem = form.elements(i);
		
		if (elem.type == 'text' || elem.type == 'textarea')
		{
			elem.value = '';
		}
		
		if (elem.type == 'select-one')
		{
			elem.selectedIndex = 0;
		}
		
		if (elem.type == 'radio' || elem.type == 'checkbox')
		{
			if (elem.checked == true)
			{
				elem.checked = false;
			}
		}
	}
}

// Ensures images are downloaded to the client browser.
// 
// Useful for rollover images, for example:
// 		<BODY onload="preloadImages('images/rollover1.gif', 'images/rollover2.gif')">
function preloadImages()
{
//  var doc = document;
//  
//  if (document.images)
//  {
//	 if (!document.preloadedImages)
//	 {
//  		document.preloadedImages = new Array();
// 		
//    	var i;
//    	var j = document.preloadedImages.length;
//    	var args = preloadImages.arguments;
//    	
//    	for(i = 0; i < args.length; i++)
//    	{
//    		if (args[i].indexOf("#")!= 0)
//    		{
//   			document.preloadedImages[j] = new Image;
//    			document.preloadedImages[j++].src = args[i];
//    		}
//    	}
//    }
//   }
}

function convertCurrency(targetCurrencyCode, amount) 
{
	if (targetCurrencyCode != '')
	{
		window.open('http://custom.marketwatch.com/custom/ft-com/currencyResult-pop.asp?FTsite=FTCOM&howmany=' + amount +  '&currfrom=126268&currto=' + targetCurrencyCode, 'Currency', 'width=480, height=400')
	}
}

// ... End hiding. -->