/**
  * @author		Bruno Rovito 
  * @date		2007-07-25
  *
  * @projet		"ZONE-INTER"
  * 
  */

//**test calls
		//col1024_getVideoASurveiller(null,null); // no video
		//col1024_getVideoASurveiller(null,"akli20071018.flv"); // video from "plaster"
		//col1024_getVideoASurveiller(90912,null); // video from Z
	

	/**
	* site_getVideoASurveiller 
	*
	* référence:  /nouvelles/international/carte-interactive/lib/js/source/site.js 
	*
	*/
	function col1024_getVideoASurveiller(_nIdDocumentZ,_sFlvFile){ 
	
	//** vars taken from: /nouvelles/international/carte-interactive/lib/js/source/varsEtActions
	var nID_EMISSION_Z = 70;
	var sPATH_TO_DATA = "/nouvelles/international/carte-interactive/lib/data/";
	var sPATH_TO_FLV_STATIQUE="http://www.radio-canada.ca/medianet/";
	var sPATH_TO_FLV_ASURVEILLER=sPATH_TO_FLV_STATIQUE;
	
	
	
		//** if we have a video from Z (tribune hack)
			if (_nIdDocumentZ!=null){ 
				var _url = sPATH_TO_DATA + "outilZ/videoDocument.asp?idEmission=" + nID_EMISSION_Z + "&idDocument=" + _nIdDocumentZ + "&idCategorie=&isTop1=1&isJson=1" ;
				new Ajax().getData(null, _url, 2/*json*/, "html_showVideoASurveiller");
				
				/**
					@return on recevra la structure suivante: voir /nouvelles/international/carte-interactive/lib/data/outilZ/videoDocument.asp
				**/
		//** if we have a video from the "plaster" hack
			}else if ( _sFlvFile!=null ){ 
				col1024_showVideoASurveiller( null, (sPATH_TO_FLV_ASURVEILLER+_sFlvFile) );
		//** if we have NO video 
			}else{
				col1024_showVideoASurveiller(null,null);
			}
		};
	
	
	
	/**
	* html_showVideoASurveiller 
	*
	* référence:  /nouvelles/international/carte-interactive/lib/js/source/site.js 
	*
	*/
	function col1024_showVideoASurveiller(_o,_sFlvFile){ // handler for site_getVideoASurveiler()
	
	//** vars taken from: /nouvelles/international/carte-interactive/lib/js/source/varsEtActions
	var sPLAYER_TRIBUNE_16x9_SMALL = "/nouvelles/international/carte-interactive/lib/swf/playerCamera16x9_Small_avlm";
	var sSAFARI_HACK = "<span style='display:none;'>Radio-Canada.ca</span>"; // à utiliser dans des appels  innerHTML
	
	
		//** vars
			var _divId = "ASurveillerVideo";
			var _sFlv="";
		
			if ( (_o!=null) && (_sFlvFile==undefined) ){ // video from bouton "tribune" 
				_sFlv = ( (_o.sMedia != "") && (_o.sMedia.indexOf(".flv")!=-1) ) ? _o.sMedia : "";
			}else  if ( (_o==null) && (_sFlvFile!=null) ){ // video from bouton "plaster"
				_sFlv = (_sFlvFile.indexOf(".flv")!=-1) ? _sFlvFile : "";
			}
			
		//** show video OR image	
			if (_sFlv!=""){  
				document.getElementById(_divId).innerHTML = sSAFARI_HACK;
				document.getElementById(_divId).style.display="block"; 
				document.getElementById(_divId).innerHTML +='<div class="video">'+ libGlobalv1_embedSwf(null, sPLAYER_TRIBUNE_16x9_SMALL, "flv="+_sFlv+"&isPlay=0", "swfVideoASurveiller", 176, 122)+'</div>';
			}else{
				//$modifyProp("ASurveillerImage", "style.display", "block"); 
				document.getElementById("ASurveillerImage").style.display="block"; 
			}
		};
