
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 createFullBrowserFlash() {
                window.onresize = function() {
                        var isIE = navigator.appName.indexOf("Microsoft") != -1;
                        var el = document.getElementById("container");
                        var size = getViewportSize(); 
                        
                        el.style.width = size[0] < 1180 ? "1180px" : "100%";
                        el.style.height = size[1] < 720 ? "720px" : "100%";
                        
                    };
                    window.onresize();
}	


var swfId = "pebekShell";
var flashElement;
var flashEnabled=0;



$(document).ready(function(){
    
//console.log(" ---- zvc ---- ");
//var gp = new GazellePage();
if (swfobject.hasFlashPlayerVersion("10.1.0")) {
	embedFlash();
    createFullBrowserFlash();

            
}

else {
	var gp = new GazellePage();	
}


});

function embedFlash() {
			
            //create doc
            $("#wrapper").remove();
            $("body").append("<div id='container'/>");
            $("#container").append("<div id='content'/>");
			//console.log("EMBED FLASH");
			
			var swfVersionStr = "10.1.0";
    		var xiSwfUrlStr = "expressinstall.swf";
    		var swfUrl  = "/web/swf/PebekShell.swf";
            var flashvars = {};
            flashvars.cache = "123123";
            if (swfobject.getQueryParamValue("tst") ) {
                  flashvars.tst = swfobject.getQueryParamValue("tst");
            }
            var params = {};
            
            
            params.quality = "high";
            params.bgcolor = "#ffffff";
            params.allowscriptaccess = "always";
            params.allowfullscreen = "true";
            
            
            var attributes = {};
            attributes.id = swfId;
            attributes.name = swfId;
            attributes.align = "middle";
           //swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:1180px; min-height:700px;overflow:hidden;");
            swfobject.embedSWF(
                swfUrl, "content", 
                "100%", "100%", 
                swfVersionStr, xiSwfUrlStr, 
                flashvars, params, attributes);
            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
            swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:1180px; min-height:700px;overflow:hidden;");
			swfobject.createCSS("body","overflow:auto; width:100%; height:100%");
            //onWindowResize();

}

