var fashion_flash = 0;

function startIeFix(){
  if(isIEorOpera()){
    document.write('<div style="display: none;" id="fashion_flash_' + fashion_flash + '">');
  }
}

function endIeFix(){
  if(isIEorOpera()){
    document.write('</div>');
    var theObject = document.getElementById("fashion_flash_" + fashion_flash++);
    if(theObject.firstChild.data && (typeof(theObject.firstchild)) == 'object'){
      theObject.firstChild.removeAttribute('data');
    }
    var theParams = theObject.getElementsByTagName("param");
    var theParamsLength = theParams.length;
    for (var j = 0; j < theParamsLength; j++) {
      if(theParams[j].name.toLowerCase() == 'flashvars'){
        var theFlashVars = theParams[j].value;
      }
    }
    var theInnnerHTML = theObject.innerHTML;
    var re = /<param name="FlashVars" value="">/ig;
    theInnnerHTML = theInnnerHTML.replace(re, "<param name='FlashVars' value='" + theFlashVars + "'>");
    theObject.outerHTML = theInnnerHTML;
  }
}

function isIEorOpera(){
  var strBrwsr = navigator.userAgent.toLowerCase();
  // test for Opera 9 or later
  if(strBrwsr.indexOf("opera")!=-1) {
	if (parseInt(strBrwsr.charAt(strBrwsr.indexOf("opera")+6))>=9) return true;
  }
  // test for Internet Explorer 6 or later on Windows
  if (strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
	if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5))>=6) return true;
  }
  return false;
}

