/*
activateActiveX
---------------
Purpose:  Dynamically replace 'object' elements that will be affected by the new security
		 feature in IE6/IE7 that requires a user to click certain types of elements
		  to activate them before use.

Usage:  Include this file in the <head></head> section of your html document using the following...
		<script language="JScript" type="text/jscript" src="activateObject_onload.js"></script>
*/
// When the page loads:
window.onload = function(){
  if (document.getElementsByTagName) {
    // Get all the tags of type object in the page.
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        // Get the HTML content of each object tag
        // and replace it with itself.
        objs[i].outerHTML = objs[i].outerHTML;
      }
	  var embeds = document.getElementsByTagName("embed");
	  for (i=0; i<embeds.length; i++) {
        // Get the HTML content of each embed tag
        // and replace it with itself.
        embeds[i].outerHTML = embeds[i].outerHTML;
      }
   }
}
// When the page unloads:
window.onunload = function() {
  if (document.getElementsByTagName) {
    //Get all the tags of type object in the page.
    var objs = document.getElementsByTagName("object");
    for (i=0; i<objs.length; i++) {
      // Clear out the HTML content of each object tag
      // to prevent an IE memory leak issue.
      objs[i].outerHTML = "";
    }
	var embeds = document.getElementsByTagName("embed");
	  for (i=0; i<embeds.length; i++) {
        embeds[i].outerHTML = "";
      }
  }
}
