popupbar = false;
popupmain = false;
popupnow = false;

function aWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function show(uri) {
	if (!document.createElement) { return; }
	if (document.getElementById) {
			var popupmain = document.getElementById('popupWindow');
			var iframeElement = document.createElement('iframe');
			iframeElement.setAttribute('src', uri);
			iframeElement.setAttribute('frameborder', '1');
			iframeElement.setAttribute('width', '668');
			iframeElement.setAttribute('height', '450');
			iframeElement.setAttribute('id', 'MainWindow');
			popupmain.appendChild(iframeElement);
			popupmain.style.visibility = "visible";

			var popupbar = document.getElementById('popupBar');
			var popupElement = document.createElement('a');
			popupElement.setAttribute('href', 'javascript:hidewin();');
			popupElement.setAttribute('onclick', 'hidewin();');
			popupElement.setAttribute('onkeypress', 'hidewin()');
			popupElement.setAttribute('onmouseup', 'hidewin()');
			var closeimg = document.createElement('img');
			closeimg.setAttribute('src', '/artists/image/button-close.gif');
			popupElement.appendChild(closeimg);
			popupbar.appendChild(popupElement);
			popupbar.style.visibility = "visible";
	}
}

function showbio(uri) {

	if (!document.createElement) { return; }	// function check
	if (popupnow) { return; }	// popup is available

	var ua = navigator.userAgent;
	var ey = 0;
	var popupposition = document.getElementById('lineupimg');

	if (document.getElementById) {
			var popupmain = document.getElementById('popupWindow');
			var iframeElement = document.createElement('iframe');
			iframeElement.setAttribute('src', uri);
			iframeElement.setAttribute('frameborder', '1');
			iframeElement.setAttribute('width', '668');
			iframeElement.setAttribute('height', '365');
			iframeElement.setAttribute('id', 'MainWindow');
			popupmain.appendChild(iframeElement);
			popupmain.style.visibility = "visible";

			var popupbar = document.getElementById('popupBar');
			var popupElement = document.createElement('a');
			popupElement.setAttribute('href', 'javascript:hidewin();');
			popupElement.setAttribute('onclick', 'hidewin();');
			popupElement.setAttribute('onkeypress', 'hidewin()');
			popupElement.setAttribute('onmouseup', 'hidewin()');
			var closeimg = document.createElement('img');
			closeimg.setAttribute('src', '/artists/image/button-close.gif');
			popupElement.appendChild(closeimg);
			popupbar.appendChild(popupElement);
			popupbar.style.visibility = "visible";
		popupnow = true;
	}
}

function hidewin() {
	top.popupnow = false;
	if (parent.document.getElementById('popupBar')) {
		var closeBar = parent.document.getElementById('popupBar');
	} else {
		var closeBar = document.getElementById('popupBar');
	}
	closeBar.style.visibility = "hidden";
	closeBar.removeChild(closeBar.lastChild);
	closeBar = false;

	if (parent.document.getElementById('popupWindow')) {
		var closeWin = parent.document.getElementById('popupWindow');
	} else {
		var closeWin = document.getElementById('popupWindow');
	}
	closeWin.style.visibility = "hidden";
	closeWin.removeChild(closeWin.lastChild);
	closeWin = false;
}
