
var arregloMedias = new Array(10);

function generarVideoJS(video, divHTML, tipoReproduccion, ancho, alto,urlImagen) {
    
   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("http://z.eltiempo.com/media/produccion/jwetAudio/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,ancho,24,"7");    
    else
       var s3 = new SWFObject("http://z.eltiempo.com/media/produccion/jwet/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,ancho,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 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];
    }
}
