/* Embedding of Flash-Content */


//   dimensions
var swfWidth  = 1100;
var swfHeight = 780;

// vars
var flashvars = {};

// params
var params = {};
params.allowfullscreen = "true";
params.wmode = "opaque";
params.bgcolor = "#ffffff";
params.allowScriptAccess = "sameDomain";

// attributes
var attributes = {};
attributes.id = "flashContent";
attributes.name = "flashContent";

swfobject.embedSWF("Main.swf", "content", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

if (swfobject.hasFlashPlayerVersion("9"))
{
    swfobject.addDomLoadEvent(createFullBrowserFlash);
}

//---------  Functions ----------------//

// VIEWPORT-SIZE
function getViewportSize()
{

    var size        = [0, 0];
    
    var cond1   = (typeof window.innerWidth != "undefined");
    var cond2a  = (typeof document.documentElement != "undefined");
    var cond2b  = (typeof document.documentElement.clientWidth != "undefined");
    var cond2c  = (document.documentElement.clientWidth != 0);
  
    switch(true)
    {
        case cond1:
            size = [window.innerWidth, window.innerHeight];
            break;
        
        case cond2a && cond2b && cond2c:
            size = [document.documentElement.clientWidth, document.documentElement.clientHeight];
            break;
        
        default:
            var body = document.getElementById("body");
            size =  [body[0].clientWidth, body[0].clientHeight];
            break;
    }

    return size;
}


// FULL-BROWSER
function createFullBrowserFlash()
{
    var paramStr = "margin:0; padding:0; width:100%; height:100%; min-width:" + swfWidth + "px; min-height:" +swfHeight + "px;";
    swfobject.createCSS("#container", paramStr);
    window.onresize(); 
}

window.onresize = function()
{
    var el = document.getElementById("container");
	var size = getViewportSize();

    el.style.width = size[0] < swfWidth ? swfWidth +"px" : "100%";
	el.style.height = size[1] < swfHeight ? swfHeight +"px" : "100%";
}
	
// FOCUS
function setupSWFObjectFocus()
{
	var swf = document.getElementById("content");
	swf.focus();
}







