var lt_ie7 = false;
if (navigator.appVersion.indexOf("MSIE") !=-1 ) {
	temp = navigator.appVersion.split("MSIE")
	if (parseFloat(temp[1]) < 7)
		lt_ie7 = true;
}

function showPhoto(src, orientation)
{
	var agt = navigator.userAgent.toLowerCase();
	if (lt_ie7)
		scroll(0,0);
	var background = document.createElement('div');
	background.setAttribute('style', 'display:none');
	background.setAttribute('id', 'dlgLightBoxBg');
	background.onclick = hidePopup;
	document.body.appendChild(background);
	var lightbox = document.createElement('div');
	lightbox.setAttribute('style', 'display:none');
	lightbox.setAttribute('id', 'dlgLightBox');
	lightbox.setAttribute('className', 'lb_image');
	lightbox.setAttribute('class', 'lb_image');
	var dlgTopBar = document.createElement('div');
	dlgTopBar.setAttribute('id', 'dlgLightBoxTop');
	dlgTopBar.setAttribute('className', 'lb_image_top');
	dlgTopBar.setAttribute('class', 'lb_image_top');
		var dlgTitle = document.createElement('span');
		dlgTitle.appendChild(document.createTextNode('-'));
	dlgTopBar.appendChild(dlgTitle);
	lightbox.appendChild(dlgTopBar);
	var dlgContent = document.createElement('div');
		var link = document.createElement('a');
		link.setAttribute('href', 'javascript:hidePopup()');
			var image = document.createElement('img');
			if (orientation) {
				image.setAttribute('className', 'image_y');
				image.setAttribute('class', 'image_y');
			} else {
				image.setAttribute('className', 'image_x');
				image.setAttribute('class', 'image_x');
			}
			image.setAttribute('src', src);
		link.appendChild(image);
	dlgContent.appendChild(link);
	lightbox.appendChild(dlgContent);
	var dlgBtns = document.createElement('div');
	dlgBtns.setAttribute('id', 'buttons');
		var dlgClose = document.createElement('a');
		dlgClose.setAttribute('id', 'closebtn');
		dlgClose.setAttribute('href', 'javascript:hidePopup()');
		dlgClose.appendChild(document.createTextNode('Close'));
		dlgBtns.appendChild(dlgClose);
	lightbox.appendChild(dlgBtns);
	document.body.appendChild(lightbox);
}

function showTesti(title, content, author)
{
	if (lt_ie7)
		scroll(0,0);
	var background = document.createElement('div');
	background.setAttribute('style', 'display:none');
	background.setAttribute('id', 'dlgLightBoxBg');
	background.onclick = hidePopup;
	document.body.appendChild(background);
	var lightbox = document.createElement('div');
	lightbox.setAttribute('style', 'display:none');
	lightbox.setAttribute('id', 'dlgLightBox');
	lightbox.setAttribute('className', 'lb_testi');
	lightbox.setAttribute('class', 'lb_testi');
	var dlgTopBar = document.createElement('div');
	dlgTopBar.setAttribute('id', 'dlgLightBoxTop');
	dlgTopBar.setAttribute('className', 'lb_testi_top');
	dlgTopBar.setAttribute('class', 'lb_testi_top');
		var dlgTitle = document.createElement('span');
		dlgTitle.appendChild(document.createTextNode('- ' + title + ' -'));
	dlgTopBar.appendChild(dlgTitle);
	lightbox.appendChild(dlgTopBar);
	var dlgContent = document.createElement('p');
	dlgContent.innerHTML = content;
	lightbox.appendChild(dlgContent);
	var dlgAuthor = document.createElement('em');
	dlgAuthor.appendChild(document.createTextNode(author));
	lightbox.appendChild(dlgAuthor);
	var dlgBtns = document.createElement('div');
	dlgBtns.setAttribute('id', 'buttons');
		var dlgClose = document.createElement('a');
		dlgClose.setAttribute('id', 'closebtn');
		dlgClose.setAttribute('href', 'javascript:hidePopup()');
		dlgClose.appendChild(document.createTextNode('Close'));
		dlgBtns.appendChild(dlgClose);
	lightbox.appendChild(dlgBtns);
	document.body.appendChild(lightbox);
}

function hidePopup()
{
	var div = document.getElementById('dlgLightBox');
	div.parentNode.removeChild(div);
	div = document.getElementById('dlgLightBoxBg');
	div.parentNode.removeChild(div);
}
