// ---------------------------------------------------------
// | Internet Explorer ActiveX Update Workaround |
// | Last Updated: March 1, 2006 |
// | By: Joseph Reiter - www.josephreiter.com |
// | |
// | This script is simplified from Microsoft's suggested |
// | solutions. There is no license associated with its |
// | use. Feel free to use it as you like. |
// |-------------------------------------------------------|
// | *** ABSTRACT *** |
// | This script is a workaround to an update in Microsoft |
// | Internet Explorer that prevents automatic interaction |
// | with ActiveX controls from a web page. The update to |
// | Internet Explorer forces the user to click on the |
// | control to "activate" it before it can be interacted |
// | with. The Internet Explorer update was made by the |
// | vendor in response to a patent infringement lawsuit |
// | that encompasses ActiveX controls. |
// | |
// | This script is also compatible with web browsers that |
// | do not support "getElementById" in JavaScript. |
// |-------------------------------------------------------|
// | *** USAGE *** |
// | The workaround is implemented in three parts: |
// | |
// | 1) This script is linked to in the header of the |
// | web page. |
// | |
// | 2) A <div> tag is created with an id attribute: |
// | <div id="UniqueDivID"></div> |
// | |
// | 3) A script is embedded after (or inside) the <div> |
// | tag that calls the function WorkaroundEmbed |
// | (below) with the <div> tag ID (from Step 2 |
// | above) and the code to embed the active content |
// | passed as parameters as follows: |
// | WorkaroundEmbed('UniqueDivID','<embed...'); |
// |-------------------------------------------------------|
// | *** MORE INFORMATION *** |
// | More information can be found on the vendor's web |
// | site at the following location: |
// | |
// | - http://support.microsoft.com/kb/912945 |
// ---------------------------------------------------------


function WorkaroundEmbed(DivTag, CodeToInsert) {

if (document.getElementById) {

// This browser supports 'getElementByID'
var WorkaroundHTML = document.getElementById(DivTag);
WorkaroundHTML.innerHTML = CodeToInsert;

} else {

// This browser is older and does not
// support 'getElementByID'
document.write(CodeToInsert);

}

}