var _xscale = 16;
var _yscale = 58;

var webBOX_window_left =  327;
var webBOX_window_top =  270;
function ShowFlashWindow(show,src,sizex,sizey, isbg)
{
    if(isbg)
	{
		var background = show + '_overlay';
		var o_background = document.getElementById(background);
		o_background.style.visibility = "visible";
		o_background.style.display = "block";

	}
	var o_window = document.getElementById(show);
	
	var screenwidth = screen.width;
	var screenheight = screen.height;

	// nowa pozycja okna
	var n_new_position_x = 0;
	var n_new_position_y = 0;
	
	var n_width = (sizex + _xscale);
	var n_height = (sizey + _yscale);
	
    if(screenwidth > n_width){
    	n_new_position_x = ((screenwidth - sizex)/ 2);
    }
    if(screenheight > n_height){
    	n_new_position_y = _yscale;
    }
	
	o_window.style.visibility = "visible";
	o_window.style.display = "block";
	o_window.style.width = n_width+"px";
	o_window.style.height = n_height+20+"px";

	o_window.style.marginLeft = n_new_position_x + "px";
	o_window.style.marginTop = n_new_position_y + "px";

	var c_iframeCode = '<div id="webBOX_title"><div id="webBOX_ajaxWindowTitle"></div><div id="webBOX_closeAjaxWindow"><a class="webBOX_closeAjaxWindow" title="Close" id="webBOX_closeWindowButton" href="#" onClick="javascript:closeFlashWindow(\'' + show + '\',' + isbg + ')">Zamknij prezentację</a></div></div><iframe scrolling="no" frameborder="0" style="width: ' + n_width + 'px; height: ' + n_height + 'px;" id="webBOX_iframeContent" src="' + src + '" hspace="0"> </iframe>';
//	var c_iframeCode = '<iframe frameborder="0" style="width: ' + sizex + 'px; height: ' + sizey + 'px;" name="TB_iframeContent642" id="TB_iframeContent" src="' + src + '" hspace="0"> </iframe>';
	
	o_window.innerHTML = c_iframeCode;

	if(isbg)
	{
		var background = show + '_overlay';
		var o_background = document.getElementById(background);
		o_background.style.visibility = "visible";
		o_background.style.display = "block";

	}

}

function closeFlashWindow(show,isbg)
{

	var o_window = document.getElementById(show);
	var c_iframeCode = '';
	
	
	
	o_window.innerHTML = c_iframeCode;
	
	o_window.style.visibility = "hidden";
	o_window.style.display = "none";
	o_window.style.marginLeft = "0px";
	o_window.style.marginTop = "0px";
	
	if(isbg)
	{
		var background = show + '_overlay';
		var o_background = document.getElementById(background);
		o_background.style.visibility = "hidden";
		o_background.style.display = "none";
		document.body.style.overflowY = "auto";
	}
}