function fnMenu(whichID, whichIMG){

	document.getElementById(whichID).src = "/Assets/Images/" + whichIMG + ".gif";
	
}

function fnPopupWindow(URL, w, h, toggle){

	var x = screen.width / 2 - (w / 2);
	var y = screen.height / 2 - (h / 2);
	
	window.open(URL, "WinOpen", "menubar=no,toolbar=no,location=no,status=no,scrollbars=" + toggle + ",width=" + w + ",height=" + h + ",left=" + x + ",top=" + y);

}

function fnHomePromoLink()
{
	if(!document.getElementById('id-Promo'))
	{
		// if the required element does not exist then return the function.
		return;
	}
	
	// if JavaScript is disabled then the core functionality (i.e. clicking the link) will still exist.
	var storePromo = document.getElementById('id-Promo');
	var storePromoLink = storePromo.getElementsByTagName('a');
	for(var i=0; i<storePromoLink.length; i++)
	{
		storePromoLink[i].onclick = function(){ fnPopupWindow('/Promo.html','760','658','no'); return false; };
	}
}

// ADD EVENT FUNCTION

	function fnAddEvent(obj, evType, fn, useCapture)
	{
		
		if (obj.addEventListener)
		// Gecko browsers (Mozilla / Firefox)
		{
			obj.addEventListener(evType, fn, useCapture);
			return true;
		}
		else if (obj.attachEvent)
		// Internet Explorer 5+
		{
			var r = obj.attachEvent('on' + evType, fn);
			return r;
		}
		else
		{
			// This sets the event handler for NS4 & IE5/Mac.
			elm['on' + evType] = fn;
		}
	
	}
