var mid = 337058;
var fWidth = 640;
var fHeight = 380;
var ast = 'yes';
var targetDiv = '';
var isGlorius = 'no';
var background = '000000';

var hostName = 'http://wp.tv';


function resizeWPtvPlayerIframe(midToResize, newWidth, newHeight) {
	document.getElementById("WPtvPlayer_"+midToResize).width = newWidth;
	document.getElementById("WPtvPlayer_"+midToResize).height = newHeight;
}


function insertIframe() {
	
	var browserUrl = window.location.href;
	if (fHeight < 410) fHeight = 410;
	var fSrc = hostName+'/outer_player.html';
	fSrc += '?mid='+mid+'&height='+fHeight+'&width='+fWidth;
	fSrc += '&autostart='+ast;
	fSrc += '&isGlorius='+isGlorius+'&background='+background;
	fSrc += '&wptvurl='+browserUrl.substr(7).replace(/\?/gi, '&').replace(/&/gi, '&__');
	menuKey = 'canal';
	menuVal = 'Wiadomosci';
	
	if (((menuKey!='') && (menuKey!='error')) && ((menuVal!='') && (menuVal!='error')))
		fSrc += "&wptv"+menuKey+"="+menuVal;
	
	var html = '';
	
	if (targetDiv != '')
		html += '	<div id="'+targetDiv+'">'+"\n";
	
	html += '		<iframe id="WPtvPlayer_'+mid+'" width="'+fWidth+'" height="'+fHeight+'" scrolling="no" frameborder="0" src="'+fSrc+'">'+"\n";
	html += '			Twoja przeglądarka nie pozwala na użycie pływających ramek.'+"\n";
	html += '		</iframe>'+"\n";
	
	if (targetDiv != '')
		html += '	</div>'+"\n";
	
	document.writeln(html);
}


insertIframe();

