
var arregloMedias = new Array(10);
var altoReproductor;
var anchoReproductor;

function generarVideoJS(video, divHTML, tipoReproduccion, ancho , alto ,urlImagen) {
    
    if(ancho)
	{
	    anchoReproductor = ancho;
	}
	if(alto)
	{
	    altoReproductor = alto;
	}
	
    if (tipoReproduccion == 'audio' && !ancho && !alto) {
        alto = 20;
        altoVideo = 20;
    }else {
        altoVideo = alto + 20;
	}
	
	var playlistArray;
    playlistArray = new Array();
    playlistArray[0] = "";
    playlistArray[1] = "";
    
    if (tipoReproduccion == 'audio')
       var s3 = new SWFObject("/reproductores/audio/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,anchoReproductor,24,"7");    
    else
      var s3 = new SWFObject("/reproductores/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,anchoReproductor,altoVideo,"7");
      /*var s3 = new SWFObject("http://www.citytv.com.co/media/swfplayercustom/citytv.swf", tipoReproduccion + '_' + divHTML ,anchoReproductor,altoVideo,"7");*/
       
       
       
    if(tipoReproduccion == 'audio')   {
       s3.addParam("allowfullscreen","false");   
       
    }   
	s3.addParam("swLiveConnect","true");
	s3.addVariable("width",ancho);	
   	s3.addVariable("height",alto);
   	s3.addVariable("displaywidth" , ancho);
	s3.addVariable("displayheight" , alto);
	s3.addVariable("file", video);
	s3.addParam("wmode","transparent"); 
  	  
	if(tipoReproduccion == 'video'){
	
	  s3.addParam("allowfullscreen","true");
	  s3.addVariable("showdigits" , "total");
	  s3.addVariable("image" ,urlImagen);
	  s3.addVariable("searchbar" , "false");
	  s3.addVariable("showstop" , "false");
	

   }
	  s3.write(divHTML);
}

var fileRec;
var idDivRec;
var tipoRec;
var urlimgRec;


function cargarVariablesVideoJS (file_rec , reproductorVideoRel, video,url_imagen) {
    fileRec = file_rec;
    idDivRec = reproductorVideoRel;
    tipoRec = video;
    urlimgRec=url_imagen;    
}

var tituloPagina;
var seccionPrincipal;
var seccionSecundaria;

function setDimensiones(w,h)
{
   altoReproductor = h;
   anchoReproductor = w;
}

function generarPageViewVideo(swf) {
    tituloPagina = arregloMedias[swf][1];
    seccionPrincipal = arregloMedias[swf][2];
    seccionSecundaria = arregloMedias[swf][3];
    generarPageView(tituloPagina,seccionPrincipal,seccionSecundaria);
}

function getUpdate(typ,pr1,pr2,swf) {
  if(typ == 'state') {
     obj = thisMovie(swf).itemData(0);
     if (!arregloMedias[swf]) {
         arregloMedias[swf] = new Array(4);
         arregloMedias[swf][0] = 0;
     }
     if (pr1 == 2) {
         arregloMedias[swf][0] = 1;
         generarPageViewVideo(swf);
     }else if (pr1 == 3) {
         arregloMedias[swf][0] = 0;
     }
  }
}


function thisMovie(swf) {
    if(navigator.appName.indexOf("Microsoft") != -1) {
        return window[swf];
    } else {
        return document[swf];
    }
}

function cambiarVideoReproductor(divVideoPlay, divVideoInfo){
   //incluirObjeto("CAMBIAR_MULTIMEDIA_TEXT", divVideoPlay, 'informacionVideo');
   incluirObjeto("CAMBIAR_MULTIMEDIA_CONT", divVideoPlay, ponerScriptVideo);
}

function ponerScriptVideo(resultado){
   alert("res1 "+ resultado);

//   var contenidosVideos = resultado.split("||||");
   
//   alert(contenidosVideos[0]);
//   alert(contenidosVideos[1]);
//   generarVideoJS(contenidosVideos[0], 'reproducirVideo', 'video', 320, 300,contenidosVideos[1]);
}
function dePrueba(){
    alert("sandruchis");
}
