var params = {
        base: "",
        seamlesstabbing: false,
        bgcolor: "#FFFFFF",
        allowFullScreen: true
};

var attributes = {
        id: "twente_swf",
        name: "twente_swf"
};

var args = parseURLArgs(window.location.search);
forcehtml = typeof args.forcehtml != "undefined";

if (!forcehtml)
{
  if (swfobject.hasFlashPlayerVersion("9.0.115"))
  {
    var loc = location.href;

    // if we are on the article page, forward to the Flash version
    if (loc.indexOf("/article.shtml") > 0)
    {
      var lang = args.lang ? args.lang : "NL";
      location.href = "index.shtml#/"+lang+"/_/"+args.id;
    }

    swfobject.embedSWF("Main.swf?m=" + Math.random(), "twente_content_div", "100%", "100%", "9.0.115", "js/ExpressInstall.swf", flashvars, params, attributes);
    swfobject.addDomLoadEvent(onDOMLoaded);
  }
  else
    swfobject.addDomLoadEvent(startsite);
}
else
{
  swfobject.addDomLoadEvent(startsite);
}


function getViewportSize()
{
  var size = [0, 0];
  if (typeof window.innerWidth != "undefined")
  {
          size = [window.innerWidth, window.innerHeight];
  } else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0)
  {
          size = [document.documentElement.clientWidth, document.documentElement.clientHeight];
  } else {
          size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight];
  }
  return size;
}

function onDOMLoaded()
{
  //swfobject.createCSS("html", "height: 100%; overflow-y: auto;");
  //swfobject.createCSS("body", "height: 100%;");
  //swfobject.createCSS("#container", "top:0px; left:0px; margin:0; width:100%; height:100%; min-width:1000px; min-height:610px;");
  //swfobject.createCSS("#twente_content_div", "top:0px; left:0px; margin:0; width:100%; height:100%; min-width:1000px; min-height:610px;");
  window.onresize = function()
  {
    //var el = document.getElementById("twente_content_div");
    var el = document.body;
    var size = getViewportSize();
    el.style.width = size[0] < 1000 ? "1000px" : "100%";
    el.style.height = size[1] < 610 ? "610px" : "100%";
  };
  window.onresize();

  /*
  if (window.swfmacmousewheel != null)
    swfmacmousewheel.registerObject(attributes.id);
  */
}
