var player    =  null;
var playlist  =  null;

function playerReady(obj) {
	player = document.getElementById(obj['id']);
	addListeners();
};

function addListeners(){
	playlist = player.getPlaylist();
	if((playlist !== null) && (playlist !== undefined)){
	  player.addModelListener('STATE', 'stateMonitor');
	} else {
	  setTimeout("addListeners();", 100);
	}
};

function stateMonitor(obj){
	if(obj.newstate == 'COMPLETED'){
		$("#player_alt").hide();
		$("#pflow").show();	
	} 
};

function goster(){
		$(".cover").stop().animate({top:'350px'},{queue:false,duration:160});
		$(".cover").show();
		kapat_interval();
}		
function kapat(){
		$(".cover").hide();			
		$(".cover").stop().animate({top:'410px'},{queue:false,duration:160});
		goster_interval();
}
function goster_interval(){
	<!-- gösterim arasi süre ms cinsinden -->
	setTimeout("goster()", 25000);
}
function kapat_interval(){
	<!-- gösterim süresi ms cinsinden -->		
	setTimeout("kapat()", 20000);
}

onLoadFunctionList = new Array();
function performOnLoadFunctions(){
	for (var i in onLoadFunctionList){
		onLoadFunctionList[i]();
	}
}

if (top.location != location) { top.location.href = document.location.href; }	