var siscoLayers = Array();

function getElement(id)
{
	if (document.all)
		var element = document.all[id];
	else if (document.layers)
		var element = document.layers[id];
	else if (document.getElementById)
		var element = document.getElementById(id);
	else
		return null;

	return element;
}

function hideElement(id)
{
	var element = getElement(id);

	if (element)
		element.style.visibility = 'hidden';

	return;
}

function showElement(id)
{
	var element = getElement(id);

	if (element)
		element.style.visibility = 'visible';

	return;
}

function createFlashLayer(id, flash, width, height, x, y)
{
	siscoLayers.push(id);
	
	if (typeof x == 'undefined') {
		var x = ((screen.width)/2)-(width/2);
	}
	
	if(typeof y == 'undefined') {
		var y =((screen.height)/2)-(height/2);
	}

	var text = '<div id="'+id+'" style="z-index: 6000; visibility: hidden; position: absolute; width: '+width+'px; height: height: '+height+'px; left: '+x+'px; top: '+y+'px;">';

	text += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" width="'+width+'" height="'+height+'" align="middle">';
	text += '<param name="movie" value="'+flash+'" />';
	text += '<param name="quality" value="high" />';
	text += '<embed src="'+flash+'" quality="high" width="'+width+'" height="'+height+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	text += '</object>';

	text += '</div>';
	
	document.write(text);
}

function createTransparentFlashLayer(id, flash, width, height, x, y)
{
	siscoLayers.push(id);

	if (typeof x == 'undefined' && typeof y == 'undefined')
	{
		var x = 0;
		var y = 0;
	}

	var text = '<div id="'+id+'" style="z-index: 6000; visibility: hidden; position: absolute; width: '+width+'px; height: height: '+height+'px; left: '+x+'px; top: '+y+'px;">';

	text += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" width="'+width+'" height="'+height+'" align="middle">';
	text += '<param name="movie" value="'+flash+'" />';
	text += '<param name="quality" value="high" />';
	text += '<param name="wmode" value="transparent" />';
	text += '<embed src="'+flash+'" quality="high" wmode="transparent" width="'+width+'" height="'+height+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	text += '</object>';

	text += '</div>';
	
	document.write(text);
}

function closeLayer(id)
{
	hideElement(id);

	return;
}

function showLayer(id)
{
	showElement(id);

	return;
}

function createLayers()
{
	createTransparentFlashLayer('warstwa2', 'pliki/swf/zyczenia.swf', 908, 262, 0, 340);

}

function setupLayers()
{
	getElement('warstwa2').style.left = (document.body.clientWidth - 920) / 2;

	for (var i = 0; i < siscoLayers.length; i++)
		showLayer(siscoLayers[i]);

}

if (!getElement('warstwa2'))
{
    createLayers();
    
setupLayers();
}

