//
//  iecontrol.js
//
//  This script is to remove the annoying "Click to activate and use this control"
//  warning message, which is the result of the IE patent dispute with Eolas Technology
//
//  This script was created from reference:
//  http://activecontent.blogspot.com/2006/04/rewrite-div-solution.html
//

var ie_obj_ctrl_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div style="display: none;" id="ie_obj_ctrl_id_' + ie_obj_ctrl_id + '">');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var divObject = document.getElementById("ie_obj_ctrl_id_" + ie_obj_ctrl_id++);
    var html = '' + divObject.innerHTML;
    var objParams = divObject.getElementsByTagName("param");
    html = html.replace(new RegExp('</object>','gi'), '');
    html = html.replace(new RegExp('<param.*>','gi'), '');
    for (var i = 0; i < objParams.length; i++) {
        html += '<param name="' + objParams[i].name + '" value="' + objParams[i].value + '">\n';
    }
    html += '</object>';
    
    divObject.outerHTML = html;
  }
}

function isIE(){
  var strBrwsr = navigator.userAgent.toLowerCase();
  if (((strBrwsr.indexOf("msie 6.0") > -1) || (strBrwsr.indexOf("msie 7.0") > -1)) && strBrwsr.indexOf("mac") < 0)
    return true;
  return false;
}