function loadPage ( src, w, h, text)
{
    if ( !window.open(src,'player'+h,'width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no') )
    {
	var popPage = document.createElement('table');
	var tb = document.createElement('tbody');
	var tr = document.createElement('tr');
	var td = document.createElement('td');

	popPage.style.width = '100%';
	popPage.style.height = '100%';
	popPage.style.position = 'absolute';
	popPage.style.top = '0px';
	popPage.style.left = '0px';
	popPage.style.zIndex = '100';
	popPage.style.textAlign = 'center';
	popPage.setAttribute('background','images/pop_back.gif');
	popPage.id = 'popPage';

	td.setAttribute('align', 'center');
	td.setAttribute('valign', 'middle');
	var precode = "<div style='width:"+(w+2)+"px; height:26px;'><div style='width: 9px; height: 26px; background-image: url(imagens/box_bgblue_r1_c1.gif); float:left;'>&nbsp;</div><div style='width:"+(w-9-9+2)+"px; height: 26px; float:left; background-image:url(imagens/box_bgblue_r1_c2.jpg);' class='texto_header'><div style='float:left; margin-top: 4px;'>"+text+"</div><div style='float: right;'><img src='images/fechar.gif' border='0' style='cursor: pointer; margin-top: 2px;' onClick='unloadPage();'/></div></div><div style='width: 9px; height: 26px; background-image: url(imagens/box_bgblue_r1_c10.gif); background-repeat: no-repeat; background-position: right; float:right;'>&nbsp;</div></div>";
	var code = "<div style='width:"+w+"px; height:"+h+"px; background-color: #FFFFFF; background-image:url(images/loading.gif); background-repeat:no-repeat; background-position:"+((w-32)/2)+"px "+((h-32)/2)+"px; border-left: 1px solid #8888FF; border-right: 1px solid #8888FF;'>";
	code += "<iframe id='pop_box' align='center' src='' width='"+w+"' height='"+h+"' frameBorder='0' scrolling='0' style='visibility: hidden;' onLoad='this.style.visibility = \"visible\";'></iframe>";
	code += "</div>";
	var poscode = "<div style='width:"+(w+2)+"px; height:9px; font-size: 2px;'><div style='width: 9px; height: 9px; background-image: url(imagens/box_bgwhite_r6_c1.gif); float:left;'>&nbsp;</div><div style='float: left; background-image:url(imagens/box_bgwhite_r6_c2.jpg); width:"+(w-9-9+2)+"px; height: 9px;'>&nbsp;</div><div style='width: 9px; height: 9px; background-image: url(imagens/box_bgwhite_r6_c26.gif); float:right;'>&nbsp;</div></div>";
	td.innerHTML = precode + code + poscode;

	tr.appendChild(td);
	tb.appendChild(tr);
	popPage.appendChild(tb);

	window.scroll(0,0);

	document.body.appendChild(popPage);
	document.getElementById('pop_box').src = src;
    }
}

function unloadPage ()
{
	document.getElementById('pop_box').src = "about:blank";
	document.getElementById("popPage").parentNode.removeChild(document.getElementById("popPage"));
}

function positionPage()
{
	var popPage = document.getElementById("popPage");
	if (popPage)
		popPage.style.top = f_scrollTop();
}

function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

