
function addLoadEvent(func) {
	var oldOnload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			if (oldOnload) {
				oldOnload();
			}
			func();
		};
	}
}

//Menu Colour Animation Code
//====================================
$(function () {
	menuFade();
});

function menuFade() {
	var $links = $('#home_menu li');
	var duration = 2000;
	var delay = 300;
	var i = 0;

	// Make all links white.
	$links.css('color', '#FFF');

	// Animate greyness of link.
	var animate = function () {

		// Animate color of link from white to grey.
		$links.eq(i).animate({
			color: '#A3A2A2'
		}, duration);

		// Increment index as to prepare for next link to be animated.
		i++;

		// If we haven't already animated all links, animate the next.
		if (i < $links.length) {

			// Delay for {delay} milliseconds before we animate the next link.
			setTimeout(function () {
				animate();
			}, delay);
		}
	}

	// Begin animation.
	animate();
}
//====================================

//==========Flash Embed===============

function embedFlashObject(url, width, height) {
	var html = 
		'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '">' +
			'<param name="allowScriptAccess" value="sameDomain" />' +
			'<param name="movie" value="../flash/' + url + '" />' +
			'<param name="quality" value="high" />' +
			'<param name="bgcolor" value="#FFF" />' +
			'<param name="wmode" value="transparent" />' +
			'<embed src="../flash/' + url + '" quality="high" wmode="transparent" bgcolor="#FFF" width="' + width + '" height="' + height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
		'</object>';
	document.write(html);
}
