<!--
/*
ten sam odtwarzacz co odtwarzacz.js (np. na film.wp.pl), z usunietym oskorkowaniem
dla wina&ie oraz okrojonym paskiem przyciskow
*/

if(typeof endClick == 'undefined'){
	var endClick = "#";
}
var isWin = false;
var isIE = false;
var isWMP_GET6 = false;
var isWMP_GET7 = false;
var netAPI = false;
//

function getFlashString(swfUrl, id, width, height, wMode, flashVars, destId) {
	WP.flash.embed(swfUrl, width, height, flashVars, {wmode:''+wMode, quality:'high', allowscriptaccess:"always", allowfullscreen:"true"},id,destId);
}

//Wstawienie player'a FLV
function addFlvPlayer() {
	//setPlayerMode(flvHeight);
	getFlashString( "player.swf", "flvPlayer", flvWidth, flvHeight, "transparent", '_bitrateRTMP='+ bitrateRTMP + '&_labelAdv=true&_img='+ imgUrl + '&_autostart=true&_movie='+ wmpSrc +'&_volume=1&_smooth=true&_endClickTarget=_self&_endClick='+endClick,"vpFilm");
}

var WMP6_Obj = '';
	WMP6_Obj += '<object id=MPlayer ';
	WMP6_Obj += 'classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
	WMP6_Obj += 'codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
	WMP6_Obj += 'standby="Loading Microsoft Windows Media Player components..." ';
	WMP6_Obj += 'type="application/x-oleobject" width="480" height="308">';
	WMP6_Obj += ' <param name="FileName" value="'+wmpSrc+'" />';
	WMP6_Obj += ' <param name="enableContextMenu" value="false" />';
	WMP6_Obj += ' <param name="DisplaySize" value="0" />';
	WMP6_Obj += ' <param name="ShowStatusBar" value="1" />';
	if(autostart == true){
		WMP6_Obj += ' <param name="AutoStart" value="true" />';
	} else {
		WMP6_Obj += ' <param name="AutoStart" value="false" />';
	}
	WMP6_Obj += ' <param name="ShowControls" value="1" />';
	WMP6_Obj += ' <param name="autoRewind" value="true" /> ';
	WMP6_Obj += '</object>';

//
var WMP7_Obj = '';
	WMP7_Obj += '<object id=MPlayer ';
	WMP7_Obj += ' classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
	WMP7_Obj += ' standby="Loading Microsoft Windows Media Player components..."';
	WMP7_Obj += ' type="application/x-oleobject" width="480" height="308">';
	WMP7_Obj += '  <param name="url" value="'+wmpSrc+'" />';
	WMP7_Obj += '  <param name="enableContextMenu" value="false" />';
	WMP6_Obj += ' <param name="ShowStatusBar" value="1" />';
	if(autostart == true){
		WMP7_Obj += '  <param name="AutoStart" value="true" />';
	} else {
		WMP7_Obj += '  <param name="AutoStart" value="false" />';
	}
	WMP7_Obj += '  <param name="ShowControls" value="1" />';
	WMP7_Obj += '  <param name="uiMode" value="mini" />';
	WMP7_Obj += '  <param name="autoRewind" value="true" /> ';
	WMP7_Obj += ' <param name="DisplaySize" value="0" />';
	WMP7_Obj += '</object>';
//	
var WMP_Emb = '';
	WMP_Emb += '<object classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 type="application/x-oleobject" id="MPlayer" height="338" width="445">';
	if(autostart == true){
		WMP_Emb += '  <param name="AutoStart" value="true" />';
	} else {
		WMP_Emb += '  <param name="AutoStart" value="false" />';
	}
	WMP_Emb += ' <param name="DisplaySize" value="0">';
	WMP_Emb += ' <param name="EnableContextMenu" value="0">';
	WMP_Emb += ' <param name="EnablePositionControls" value="0">';
	WMP_Emb += ' <param name="EnableFullScreenControls" value="0">';
	WMP_Emb += ' <param name="EnableTracker" value="1">';
	WMP_Emb += ' <param name="Filename" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="URL" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="src" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="Rate" value="1">';
	WMP_Emb += ' <param name="ShowCaptioning" value="0">';
	WMP_Emb += ' <param name="ShowControls" value="1">';
	WMP_Emb += ' <param name="ShowAudioControls" value="1">';
	WMP_Emb += ' <param name="ShowDisplay" value="0">';
	WMP_Emb += ' <param name="ShowGotoBar" value="0">';
	WMP_Emb += ' <param name="ShowPositionControls" value="1">';
	WMP_Emb += ' <param name="ShowStatusBar" value="1">';
	WMP_Emb += ' <param name="ShowTracker" value="1">';
	WMP_Emb += ' <param name="Volume" value="50">';
	WMP_Emb += ' <embed type="application/x-mplayer2"';
	WMP_Emb += ' pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
	WMP_Emb += ' filename="'+wmpSrc+'"';
	WMP_Emb += ' src="'+wmpSrc+'"';
	WMP_Emb += ' name=MPlayer';
	WMP_Emb += ' enableContextMenu=0';
	WMP_Emb += ' showcontrols=1';
	WMP_Emb += ' autorewind=1';
	if(autostart == true){
		WMP_Emb += ' autostart=1';
	} else {
		WMP_Emb += ' autostart=0';
	}
	WMP_Emb += ' displaysize=0';
	WMP_Emb += ' showstatusbar=1';
	WMP_Emb += ' width=480';
	WMP_Emb += ' height=308>';
	WMP_Emb += '</embed>';
	WMP_Emb += '</object>';
//
function videoPlayerMode(n) {
	if (n == 1) {
		document.getElementById('vpFilm').style.height=advPlayerHeight + 'px';
		document.getElementById('vpFilm').style.overflow='visible';
		document.getElementById('vpWM').style.display='';
	} else if (n == 0) {
		document.getElementById('vpFilm').style.height='330px';
		document.getElementById('vpFilm').style.overflow='visible';
		document.getElementById('vpWM').style.display='';
	}
}
// Detekcja

var uAgt = navigator.userAgent.toLowerCase();
isIE = (uAgt.indexOf("msie") != -1) && (uAgt.indexOf("opera") == -1 && (navigator.appName.indexOf("Microsoft Internet Explorer") != -1));
isWin = navigator.platform.indexOf("Win") != -1;

	var pWMP = (navigator.mimeTypes && navigator.mimeTypes["application/x-mplayer2"]) ? navigator.mimeTypes["application/x-mplayer2"].enabledPlugin : 0;
	if (pWMP) {
		isWMP_GET6 = true;
	}
//
function addWmvPlayer() {
	if(isWin && isIE){
		if(isWMP_GET7){
			//
			videoPlayerMode(0);
			document.getElementById('vpFilm').innerHTML = WMP7_Obj;
		} else {
			//
			document.getElementById('vpFilm').innerHTML = WMP6_Obj;
		}
	} else if(isWMP_GET6) {
		//
		setTimeout("document.getElementById('vpFilm').innerHTML = WMP_Emb;", 500);
		//
		videoPlayerMode(0);
	} else {
		//Tylko link do pliku
		document.getElementById('vpFilm').innerHTML = getVideoFileTxt;
		//
		videoPlayerMode(0);
	}
}

/**
* Reklama FLV
*/
function onAdvPlayerLoaded(bytesTotal)
{
}

function onAdvPlayerFinished(streamTime)
{
	document.getElementById('vpFilm').innerHTML = '';
	addPlayer();

}

//Wybranie rodzaju player'a
function addPlayer() {
	if (wmpSrc.indexOf(".flv")==(wmpSrc.length-4)) {
		addFlvPlayer();
	} else {
		addWmvPlayer();
	}
}

/**
* init
* description: onload called method
*/
function init()
{
	// Czy jest Flash [getFlashVersion() - funkcja systemu reklamowego]
	isFLP = ( 8 >= 8 ) ? true : false;
	
	// Uaktywnienie komunikacji WMP <-> FLASH
	//initNetAPI();
	
	if(isFLP && isAdv && advPlayerMovieUrl!='')
	{
		
				var fVars = "aWidth="+advPlayerWidth+
					"&aHeight="+advPlayerHeight+
					"&aMovieUrl="+advPlayerMovieUrl+
					"&aAutoStart="+advPlayerAutoStart+
					"&aVolume="+advPlayerVolume+
					"&aBgColor="+advPlayerBgColor+
					"&aBgAlpha="+advPlayerBgAlpha+
					"&aClickUrl="+advPlayerClickUrl+
					"&aWindowType="+advPlayerWindowType+
					"&aScaleMode="+advPlayerScaleMode+
					"&aBuffBgColor="+advPlayerBuffBgColor+
					"&aBuffBgAlpha="+advPlayerBuffBgAlpha+
					"&aBuffFontColor="+advPlayerBuffFontColor+
					"&amp;aBuffAlign="+advPlayerBuffAlign;
		
		videoPlayerMode(1);
		getFlashString("advFlvPlayer.swf", "advPlayer", advPlayerWidth, 297, "transparent", fVars, "vpFilm");
		
		
	} else {
		addPlayer();
		
	}

}

if(window.onload==null){window.onload=init;} else {var REF_F=window.onload;window.onload=function() {if(window.REF_F) REF_F();init();};};

-->






