var div_letak = document.getElementById('letak');
var image = new Array;


// NACTENI LETAKU
function readImage()
{
	image['close'] = new Image();
	image['close'].src = '../images/close.gif';

	image['leaflet'] = new Image();
	image['leaflet'].src = '../images/'+leaflet_img;
}


// SAMOTNY LETAK A TLACITKO CLOSE
function visibleLeaflet()
{
	readImage();

	// letak
	leaflet = document.createElement('letak');
	leaflet.style.width  = leaflet_width;
	//leaflet.style.height = leaflet_height;
	leaflet.style.height = leaflet_height + 80;

	// tlacitko
	new_button = document.createElement('img');
	new_button.setAttribute('src', image['close'].src);
	new_button.setAttribute('alt', 'Zavøít?');
	new_button.setAttribute('title', 'Zavøít?');
	new_button.setAttribute('width', 21);
	new_button.setAttribute('height', 21);

	if (is_ie) new_button.onclick = hiddenLeaflet;
	else new_button.setAttribute('onclick', 'hiddenLeaflet()');

	new_button.style.position   = 'absolute';
	new_button.style.marginLeft = (leaflet_width - 21) + 'px';

	// obrazek
	new_img = document.createElement('img');
	new_img.setAttribute('src', image['leaflet'].src);
	new_img.setAttribute('alt', leaflet_alt);
	new_img.setAttribute('title', leaflet_alt);
	new_img.setAttribute('width', leaflet_width);
	new_img.setAttribute('height', leaflet_height);

	// zviditelneni letaku
	div_letak.style.display = 'block';
	div_letak.style.left    = Math.round((screen.width - leaflet_width) / 2) + 'px';
	div_letak.appendChild(new_button);
	div_letak.appendChild(new_img);
}


// ZAVRENI LETAKU
function hiddenLeaflet()
{
	div_letak.style.display = 'none';
}

if (viewLeaflet) visibleLeaflet()

