
function load_intro_flash() {
	MM_checkPlugin('Shockwave Flash','','',false);
	return document.MM_returnValue
}

window.onload = load_intro_flash;

var noflash = '<div class="noflash">';
noflash += 'WELCOME! You need the Flash Player version 8 or higher installed in ';
noflash += 'your browser to view many aspects of the Vectors Journal. ';
noflash += 'You can <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">upgrade or install to correct version of the Flash ';
noflash += 'Player here.</a><br /><br />';
noflash += 'To continue without flash, <a href="issues/">bypass and enter here.</a><br /><br />';
noflash += 'Please report problems to <a href="mailto:usc.vectors@gmail.com">usc.vectors@gmail.com</a>';
noflash += '</div>';

var hasflash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="790" height="350">';
hasflash += '<param name="allowScriptAccess" value="sameDomain" />';
hasflash += '<param name="movie" value="vectorSplash.swf" />';
hasflash += '<param name="quality" value="high" />';
hasflash += '<param name="bgcolor" value="#ffffff" />';
hasflash += '<embed src="vectorSplash.swf" width="790" height="350" quality="high" bgcolor="#ffffff" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
hasflash += '</object>';

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0

  if (document.getElementById("intro_flash").innerHTML = '&nbsp;') {

    var version=false;
		var flashversion=0;
    var ok=false; document.MM_returnValue = false;

    with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
      ok=(plugins && plugins[plgIn]);
  		if (ok) {
  			y = plugins[plgIn].description;
  			//flashversion = y.charAt(y.indexOf('.')-1);
  			flashversion = y;
  		}

    } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
      if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) {
  		  ok=window.MM_flash;
		  try {
            oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash.8');");
          } catch(err) {
            oFlash = false;
          }
          if (oFlash) {
            var flashversion = "8";
          } else {
            try {
              oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash.9');");
            } catch(err) {
              oFlash = false;
            }
            if (oFlash) {
              var flashversion = "9";
            } else {
              try {
                oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash.10');");
              } catch(err) {
                oFlash = false;
              }
              if (oFlash) {
                var flashversion = "10";
              }
            }
          }
  		}
  	}

		// no flash plugin
		if (flashversion == 0) {
		  document.getElementById("intro_flash").innerHTML = noflash;
		}
		// old flash version
        else if (flashversion.indexOf("8")==-1 && flashversion.indexOf("9")==-1 && flashversion.indexOf("10")==-1) {
  		  document.getElementById("intro_flash").innerHTML = noflash;
     	}
		// has correct flash version
  	    else {
          document.getElementById("intro_flash").innerHTML = hasflash;
  	    }

  }

}
