Flash Detection with SWFObject to use with Modernizr

To add flash detection to your HTML tag as with Modernizr, include SWFObject and then add this function to the top of your page:

function hasFlash()
{
	if(swfobject.hasFlashPlayerVersion("1"))
	{
		$('html').addClass('hasflash');
	}
	else
	{
		$('html').addClass('noflash');
	}
}