onloadFunctions.push(function() {
	
	//Find all of the tables on the page
	var tables = document.getElementsByTagName('table');
	for (var i = 0; i < tables.length; ++i)
	{
		//Find all text boxes that utlise the focus and blur behaviours
		filterChildElements(tables[i], 'input', function(elem)
		{
			//Check each element to determine if it is the cart quantity field
			if (elemHasClass(elem, 'cart_quantity'))
			{
				//Attach the behaviours
				attach(elem, 'focus', function() { focusField(this, 'QTY'); });
				attach(elem, 'blur',  function() { blurField(this,  'QTY'); });
			}
			
		}, true);
	}
	
});

//Function by Alex to open the XE currency converter
function CurrencyPopup(QueryString)
{
	CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=190,width=620');
	CurrencyWindow.focus();
	CurrencyWindow.location.href = 'http://www.xe.net/ecc/input.cgi?Template=sw&From=AUD&'+QueryString;
}

