
function oddcast_show(v)
{
	var o = document.getElementById('oddcast_sess').value;
	
	httpRequest('./affaires/http_getOddCast.php', 'oddcast_sess='+o+'&oddcast_show='+v, 'POST', oddcast_result);
}

function oddcast_result(obj)
{
	if (obj.readyState==4 && obj.status==200)
	{
		var txt;
		var show = document.getElementById('oddcast_show').value;
			show = show==1 ? 0 : 1;
		
		document.getElementById('oddcast_show').value = show;
		document.getElementById('oddcast_img').innerHTML = show==0 ? '<a href="javascript:oddcast_show(1)"><img src="images/src/icones16/ok.gif" alt="Pour activer l\'assistant virtuel, cliquez ici"></a>' : '<a href="javascript:oddcast_show(0)"><img src="images/src/icones16/nok.gif" alt="Pour fermer l\'assistant virtuel, cliquez ici"></a>';
		
		if( show==0 ){
			document.getElementById('oddcast_api').style.display = 'none';
			
			txt = '<div style="position:absolute; top:50px; width:250px; padding:5px; color:#fff;" align="center">';
			txt+= '<strong>Pour activer l\'assistant virtuel<br><a href="javascript:oddcast_show(1)" style="color:#fff">cliquez ici</a></strong>';
			txt+= '</div>';
		}else{
			txt = '<div style="position:absolute; top:50px; width:250px; padding:5px; color:#fff;" align="center">';
			txt+= '<strong>Votre demande est bien prise en compte.<br><br>L\'assistant virtuel sera disponible lors du prochain chargement de page.</strong>';
			txt+= '</div>';
		}
		
		document.getElementById('oddcast_txt').innerHTML = txt;
		
		if( document.getElementById('oddcast_api') ){
			document.getElementById('oddcast_api').style.display = 'none';
		}
	}
}
