//This function is here to get rid of the activation click that IE requires for flash embeded objects
function writeFlash(html){
	document.write(html);
}

function hasFlash(){
	var agt = navigator.userAgent.toLowerCase();
  var ie  = (agt.indexOf("msie") != -1);
  var ns  = (navigator.appName.indexOf("Netscape") != -1);
  var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
  var mac = (agt.indexOf("mac")!=-1);
  var flash = false;

  if(ie && win){
    flash = detectIE();
  }
  if(ns || !win){
    flash = detectNS();
  }
  
  return flash;
}

function detectIE() { 
  result = false; 
  document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.1"))</SCRIPT>\n'); 
  if (result){
    return true; 
  }else{ 
    return false;
  }
}

function detectNS() { 
  var nse = '';
  for (var i=0;i<navigator.mimeTypes.length;i++){
    nse += navigator.mimeTypes[i].type.toLowerCase();
  }
   
  var n = false; 
  if (nse.indexOf('application/x-shockwave-flash') != -1){ 
    if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin != null){ 
      n = true; 
    }
  }
  return n; 
}