// JavaScript document
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function thisMovie(movieName) {
	if(navigator.appName.indexOf("MS") != -1) {
		return window[movieName];
	} else {
		return document.getElementById(movieName);
	}
}

function sendEvent(typ,prm) {
	thisMovie("mediaplayer").sendEvent(typ,prm);
}

function loadFile(file,title,link,id,image,author,captions,category,start,type) {
	thisMovie("mediaplayer").loadFile(file,title,link,id,image,author,captions,category,start,type);
}

function hide_flash_a() {
	MM_changeProp('fader','','style.visibility','visible','DIV');
	MM_changeProp('flash','','style.visibility','hidden','DIV');
}

function hide_flash() {
	setTimeout("sendEvent('stop')", 500);
	setTimeout("hide_flash_a()", 500);
}

function show_flash() {
	MM_changeProp('fader','','style.visibility','hidden','DIV');
	MM_changeProp('flash','','style.visibility','visible','DIV');
	setTimeout("loadFile('auraton.flv', 'TV4U Auraton Intro Movie')", 100);
	setTimeout("sendEvent('next')", 100);
}

var ads = new Array(
	'piast.flv',
	'dziennik.flv'
	);

function showad(id) {
	MM_changeProp('fader','','style.visibility','hidden','DIV');
	MM_changeProp('flash','','style.visibility','visible','DIV');
	setTimeout("loadFile('"+ ads[id] +"', 'TV4U Auraton Advertisement')", 100);
	setTimeout("sendEvent('next',0)", 100);
}

function getUpdate(typ,pr1,pr2) {
	if(typ == "state")
	{
		if(Math.round(pr1)==3)
			hide_flash();
	};
};

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}