function colheight() { 
document.getElementById('main').style.height=document.getElementById('sidebar-left').clientHeight+"px";
}

$( function() {

  var typeBflag = false;

  $(".typeBBlock").hide(function() {
    typeBflag = true;
  });

  $("#typeB").click(function() {

    if(typeBflag) {
      $(".typeBBlock").show();
      $(".typeABlock").hide();
      typeBflag = false;
    } else {
      $(".typeBBlock").hide();
      $(".typeABlock").show();
      typeBflag = true;
    }


  });

});

function getFlash (fileId, fileName, fileWidth, fileHeight, noScript) {
  var checkForFlash = function (version){
    var flashIsInstalled = false;
    var flash;
    if(window.ActiveXObject){
      try{
        flash = new ActiveXObject(("ShockwaveFlash.ShockwaveFlash." + version));
        flashIsInstalled = true;
      }
      catch(e){
        // Throws an error if the version isn't available
      }
    }
    else if(navigator.plugins && navigator.mimeTypes.length > 0){
      flash = navigator.plugins["Shockwave Flash"];
      if(flash){
        var flashVersion = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1");
        if(flashVersion >= version){
          flashIsInstalled = true;
        }
      }
    }
    return flashIsInstalled;
  };

  var fstr;

  if(checkForFlash(8)) {
    fstr = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ fileWidth +'" height="'+ fileHeight +'" id="'+ fileId +'" align="center">'
      + '<param name="allowScriptAccess" value="sameDomain" />'
      + '<param name="movie" value="/files/'+ fileName +'.swf" />'
      + '<param name="quality" value="high" />'
      + '<param name="wmode" value="transparent" />'
      + '<embed src="/img/'+ fileName +'.swf" quality="high" width="'+ fileWidth +'" height="'+ fileHeight +'" name="'+ fileId +'" align="center" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
      + '</object>';
  } else {
    fstr = noScript;
  }
  document.write(fstr);
}
