flash_installed = 0;

if( navigator.mimeTypes.length ) {
  if( navigator.mimeTypes["application/x-shockwave-flash"] ) flash_installed = 1;
}
else if( window.ActiveXObject ) {
  for( x = 1; x <= 20; x++ ) {
    try {
      flash_test = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
      if( flash_test ) flash_installed = 1;
    }
    catch(e){}
  }
}

cookie_expire = new Date();
cookie_expire.setDate( cookie_expire.getDate() + ( flash_installed ? -7 : 1 ));
document.cookie = "no_flash=1;expires=" + cookie_expire.toGMTString() + ";path=/";