/* Stack Overflow
* http://stackoverflow.com/questions/175951/how-do-i-stop-chrome-from-yellowing-my-sites-input-boxes
*/
function fixchromeyellow()
{
	if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
	{
		$$('input["input:-webkit-autofill"]').each(function(el)
		{
			el.clone().inject(el,"after");
			el.destroy();
		});
	}
}
window.setTimeout(fixchromeyellow, 500);

/* IE Fix for Navigation menu - 7 and below */
sfHover = function() 
{
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) 
	{
		sfEls[i].onmouseover=function() 
		{
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() 
		{
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/*
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
$(window).load(function(){
    $('input:-webkit-autofill').each(function(){
        var text = $(this).val();
        var name = $(this).attr('name');
        $(this).after(this.outerHTML).remove();
        $('input[name=' + name + ']').val(text);
    });
});}
*/

/**
* Set display of page element
* s[-1,0,1] = hide,toggle display,show
* Borrowed from phpBB3's forum_fn.js
*/
function dE(n, s)
{
	var e = document.getElementById(n);

	if (!s)
	{
		s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
	}
	e.style.display = (s == 1) ? 'block' : 'none';
}
