// 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)
	{	
	    if(prm=="0")
	    {
	        document.getElementById("img1").src="/images/btn_1.gif";
	        document.getElementById("img2").src="/images/btn_2_up.gif";
	        document.getElementById("img3").src="/images/btn_3_up.gif";
	        document.getElementById("img4").src="/images/btn_4_up.gif";
	        document.getElementById("img5").src="/images/btn_5_up.gif";
	    }
	    if(prm=="1")
	    {
	        document.getElementById("img1").src="/images/btn_1_up.gif";
	        document.getElementById("img2").src="/images/btn_2.gif";	        
	        document.getElementById("img3").src="/images/btn_3_up.gif";
	        document.getElementById("img4").src="/images/btn_4_up.gif";
	        document.getElementById("img5").src="/images/btn_5_up.gif";
	    }
	    if(prm=="2")
	    {
	        document.getElementById("img1").src="/images/btn_1_up.gif";
	        document.getElementById("img2").src="/images/btn_2_up.gif";	        
	        document.getElementById("img3").src="/images/btn_3.gif";
	        document.getElementById("img4").src="/images/btn_4_up.gif";
	        document.getElementById("img5").src="/images/btn_5_up.gif";
	    }
	    if(prm=="3")
	    {
	        document.getElementById("img1").src="/images/btn_1_up.gif";
	        document.getElementById("img2").src="/images/btn_2_up.gif";	        
	        document.getElementById("img3").src="/images/btn_3_up.gif";
	        document.getElementById("img4").src="/images/btn_4.gif";
	        document.getElementById("img5").src="/images/btn_5_up.gif";
	    }
	    if(prm=="4")
	    {
	        document.getElementById("img1").src="/images/btn_1_up.gif";
	        document.getElementById("img2").src="/images/btn_2_up.gif";	        
	        document.getElementById("img3").src="/images/btn_3_up.gif";
	        document.getElementById("img4").src="/images/btn_4_up.gif";
	        document.getElementById("img5").src="/images/btn_5.gif";
	    }
	    thisMovie("mpl").sendEvent(typ,prm);	    
	};
	function getUpdate(typ,pr1,pr2,pid) {
		if(typ == "time") { currentPosition = pr1; }
		else if(typ == "volume") { currentVolume = pr1; }
		else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
		var id = document.getElementById(typ);
		id.innerHTML = typ+ ": "+Math.round(pr1);
		pr2 == undefined ? null: id.innerHTML += ", "+Math.round(pr2);
		if(pid != "null") {
			document.getElementById("pid").innerHTML = "(received from the player with id <i>"+pid+"</i>)";
		}
	};

	// These functions are caught by the feeder object of the player.
	function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
	function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
	function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
	function getItemData(idx) {
	  if(document.getElementById("mpl")!="undefined")
	  {
	  	var obj = thisMovie("mpl").itemData(idx);
		var nodes = "";
		var x = 0;
		for(var i in obj) { 
			nodes += "<li>"+i+": "+obj[i]+"</li>";
			
			if(x == 5)
			document.getElementById("ttl").innerHTML = obj[i];
		    if(x == 4)//haha, i made the caption work.
		    document.getElementById("cap").innerHTML = obj[i];
			
			x++;
		}
		}
		//alert(nodes);
		//document.getElementById("data").innerHTML = nodes;
		
	};

	// This is a javascript handler for the player and is always needed.
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	};
function toggle()
{
sendEvent('playpause');
if(document.getElementById("playpause").innerHTML == "play")
document.getElementById("playpause").innerHTML = "pause";
else
document.getElementById("playpause").innerHTML = "play";
}
function fll(w,h)
{

	
var s2 = new SWFObject("/imagerotator.swf","mpl",w,h,"7");
	s2.addVariable("file","/getplaylistInterior.aspx");
	s2.addVariable("transition","fade");
	s2.addVariable("shuffle","false");
	//s2.AddVariable("showicons","true");
	//s2.addVariable("shownavigation","true");
	s2.addVariable("enablejs","true");
	//s2.addVariable("id","mpl");
	s2.addVariable("javascriptid","mpl");
	//s2.addVariable("overstretch","true");
	s2.addParam("AllowScriptAccess","always");	
	s2.addVariable("width",w);
	s2.addVariable("height",h);
	s2.write("player2");
	mpl = document.getElementById('mpl'); 
}