var player;
	var currentState;

    function playerReady(obj) {
      player = document.getElementById(obj.id);
	  player.addModelListener('TIME','timeHandler');
    };

	function seek(pos) {
	  if(player.getConfig().state == 'IDLE') {
		start = pos;
		player.addModelListener('META','metaHandler');
		player.sendEvent('PLAY');
	  } else { 
		player.sendEvent('SEEK',pos);
	  }
	};
	
	function metaHandler(obj) {
	  if(obj.duration) {
		player.removeModelListener('META','metaHandler');
		player.sendEvent('SEEK',start);
	  }
	};

	function timeHandler(obj)
	{	
		
		if (obj.position<360)
		{
			if (currentState!="c1")
			{
				document.getElementById("c1").style.backgroundColor  = "#68AF23";
				document.getElementById("c1").style.color  = "#FFFFFF";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c1";
			}
		}
		else if (obj.position<2187)
		{
			if (currentState!="c2")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#68AF23";
				document.getElementById("c2").style.color  = "#FFFFFF";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c2";
			}
		}
		else if (obj.position<4106)
		{
			if (currentState!="c3")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#68AF23";
				document.getElementById("c3").style.color  = "#FFFFFF";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c3";
			}
		}
		else if (obj.position<6230)
		{
			if (currentState!="c4")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#68AF23";
				document.getElementById("c4").style.color  = "#FFFFFF";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c4";
			}
		}
		else if (obj.position<8935)
		{
			if (currentState!="c5")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#68AF23";
				document.getElementById("c5").style.color  = "#FFFFFF";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c5";
			}
		}
		else if (obj.position<11227)
		{
			if (currentState!="c6")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#68AF23";
				document.getElementById("c6").style.color  = "#FFFFFF";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c6";
			}
		}
		else if (obj.position<12064)
		{
			if (currentState!="c7")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#68AF23";
				document.getElementById("c7").style.color  = "#FFFFFF";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c7";
			}
		}
		else if (obj.position<13081)
		{
			if (currentState!="c8")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#68AF23";
				document.getElementById("c8").style.color  = "#FFFFFF";
				document.getElementById("c9").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c9").style.color  = "#68AF23";
				currentState="c8";
			}
		}
		else 
		{
			if (currentState!="c9")
			{
				document.getElementById("c1").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c1").style.color  = "#68AF23";
				document.getElementById("c2").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c2").style.color  = "#68AF23";
				document.getElementById("c3").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c3").style.color  = "#68AF23";
				document.getElementById("c4").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c4").style.color  = "#68AF23";
				document.getElementById("c5").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c5").style.color  = "#68AF23";
				document.getElementById("c6").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c6").style.color  = "#68AF23";
				document.getElementById("c7").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c7").style.color  = "#68AF23";
				document.getElementById("c8").style.backgroundColor  = "#FFFFFF";
				document.getElementById("c8").style.color  = "#68AF23";
				document.getElementById("c9").style.backgroundColor  = "#68AF23";
				document.getElementById("c9").style.color  = "#FFFFFF";
				currentState="c9";
			}
		}
		
	};

