function setFlashSize(flash_container_id, flashWidth, flashHeight) {
  var size = [0,0];
  
  if( typeof( window.innerWidth ) == 'number') {
    size = [window.innerWidth, window.innerHeight];
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    size = [document.documentElement.clientWidth, document.documentElement.clientHeight];
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    size = [document.body.clientWidth, document.body.clientHeight];
  }
  
  window.onresize = function() {
    document.getElementById(flash_container_id).style.minWidth = flashWidth+"px";
    document.getElementById(flash_container_id).style.minHeight = flashHeight+"px";
    document.getElementById(flash_container_id).style.width = size[0] < flashWidth ? flashWidth+"px" : "100%";
    document.getElementById(flash_container_id).style.height = size[1] < flashHeight ? flashHeight+"px" : "100%";
  };
  
  window.onload = function(){
    window.onresize();
  }
}


function load_flash() {
  var body = document.getElement('body');
  body.addClass('hasJS');

  var params = {
    'quality': 'best',
    'allowFullScreen': 'true',
    'allowScriptAccess': 'always',
    'play': 'true',
    'loop': 'false',
    'menu': 'false',
    'allownetworking': 'all'
  };
  
  var flashvars = {
    'page_type': page_type,
    'foreign_key': foreign_key,
    'original_url': window.location
  };
  
  var attributes = {
    'id': 'flash_content',
    'align': 'middle'
  }
  
  swfobject.embedSWF('/flash/armando.swf', 'content', '100%', '100%', '9.0.0', '/flash/expressInstall.swf', flashvars, params, attributes);
  
  setFlashSize('flash_content', 1050,700);
}

