

// Embedding of Flash-Content //

// 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";

var tmpH = isIE9() ? getProperVPforIE() : "100%";


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

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

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

function getProperVPforIE()
{
   var tmpHeight = 780; 
   var size = getViewportSize(); 
   
   if (size[1] > 780) 
   {
       tmpHeight =  size[1];
   }
    
    return tmpHeight;
}


// CHECK IE9
function isIE9()
{
    var flag = false;
    if (navigator.appVersion.indexOf("MSIE") != -1)
    {
        flag = parseFloat(navigator.appVersion.split("MSIE")[1])== 9 ? true : false;
    }

    return flag ;
}

// VIEWPORT-SIZE
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;
}


// FULL-BROWSER
function createFullBrowserFlash() {

    swfobject.createCSS("#container", "margin:0; padding:0; width:100%; height:100%; min-width:1100px; min-height:780px;");
    window.onresize();
}

window.onresize = function() {

	var el = document.getElementById("container");
	var size = getViewportSize();
 	var tmpH = isIE9() ? getProperVPforIE(): "100%";

    el.style.width = size[0] < 1000 ? "1100px" : "100%";
	el.style.height = size[1] < 780 ? "780px"  :tmpH;  
	};

// FOCUS
function setupSWFObjectFocus()
{
	var swf = document.getElementById("content");
	swf.focus();
	//onkeydown = swf.focus();
}







