﻿	// some variables to save
	var currentPosition;
	var currentVolume;
	var currentItem;

	// these functions are caught by the JavascriptView object of the player.
	function sendEvent(typ,prm) { thisMovie("mpl").sendEvent(typ,prm); };
	function getUpdate(typ,pr1,pr2) {
		if(typ == "time") { currentPosition = pr1; }
  		else if(typ == "volume") { currentVolume = pr1; }
		else if(typ == "item") { currentItem = pr1; }

	};


function changeVmode(channel) {

if (document.theForm.vscale1[0].checked) {scaleparams = "fit";  }
else if (document.theForm.vscale1[1].checked) { scaleparams = "false"; }
else if (scaleparams == "") { scaleparams = "fit"; }

if (channel == "") { channel = "1"; }

var vmodew = document.getElementById('vmodew').value;

if (vmodew == "160") { vmodeh = "120"; }
  else if (vmodew == "240") { vmodeh = "180"; }
  else if (vmodew == "320") { vmodeh = "240"; }
  else if (vmodew == "480") { vmodeh = "384"; }
  else if (vmodew == "640") { vmodeh = "480"; }
  else if (vmodew == "800") { vmodeh = "600"; }

var s2 = new SWFObject("inc/mediaplayer.swf","mpl",vmodew,vmodeh,"9,0,124");
	s2.addParam("allowscriptaccess","always");
	s2.addParam("allowfullscreen","true");
	s2.addParam("wmode", "opaque");
	s2.addVariable("overstretch",scaleparams);
	s2.addVariable("file","inc/playlist-livet1.php?channel="+channel);
	s2.addVariable("displayheight",vmodeh);
	s2.addVariable("displaywidth",vmodew);
  s2.addVariable("height",vmodeh);
  s2.addVariable("width",vmodew);
  s2.addVariable("searchbar","false");
  s2.addVariable("logo","img/logo.png");
	s2.addVariable("backcolor","0x000000");
	s2.addVariable("frontcolor","0xCCCCCC");
	s2.addVariable("lightcolor","0x996600");
	s2.addVariable("callback","analytics");
	s2.addVariable("repeat","list");
	s2.addVariable("shuffle","false");
	s2.addVariable("deblocking","true");
	s2.addVariable("smoothing","true");
	s2.addVariable("bufferlength","3");
	s2.addVariable("volume","50");
	s2.addVariable("usekeys","false");
	s2.addVariable("shownavigation","true");
	s2.addVariable("linkfromdisplay","true");
  s2.addVariable("linktarget","_self");
	s2.addVariable("kenburns","false");
	s2.addVariable("showdownload","false");
	s2.addVariable("showdigits","false");
	s2.addVariable("showicons","false");
	s2.addVariable("showvolume","true");
	s2.addVariable("showstop","false");
	s2.addVariable("usecaptions","false");
	s2.addVariable("showfsbutton","true");
	s2.addVariable("enablejs","true");
  s2.addVariable("javascriptid","mpl");
  s2.addVariable("autostart","true");
	s2.write("player1");
}




	// This is a javascript handler for the player and is always needed.
  function loadRecommendation(rAuthor, rTitle, rFile)
  {
  loadFile({author:rAuthor, title:rTitle, file:rFile});
  };


  function loadFile(mpl,obj)
  {
  thisMovie(mpl).loadFile(obj);
  };
	
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	};