
// ---------------------------------------------------------
// Función para insertar el ImageFade
//    f: Ruta al archivo del artículo o link asociado
//    w: Ancho del flash (en este caso, de las imágenes)
//    h: Alto del flash (en este caso, de las imágenes)
//    t: Target del link (al hacer click)
//    img1-img4: rutas hacia los archivos de imágenes.
function insert_img_fade(f, w, h, t, img1, img2, img3, img4) {
  var swf = '/prontus_rhona/prontus/prontus_imgfade_8.0.swf';

  var width = w;
  var height = h;
  var linkurl = f;
  var urlartic = f;
  var target = t;
  var foto1 = img1;
  var foto2 = img2;
  var foto3 = img3;
  var foto4 = img4;

  // Esta es la sentencia recomendada por la W3C para pasar la validacion sin
  // tener que recurrir a escribir el objeto con Javascript.
  // Aún ahí se utiliza Javascript para mayor seguridad.
  document.write('<object type="application/x-shockwave-flash"');
  document.write('  data="'+swf+'"');
  document.write('  width="'+width+'"');
  document.write('  height="'+height+'">');
  document.write(' <param name="MOVIE" value="'+swf+'">');
  document.write(' <param name="PLAY" value="true">');
  document.write(' <param name="LOOP" value="true">');
  document.write(' <param name="QUALITY" value="high">');
  document.write(' <param name="WMODE" value="TRANSPARENT">');
  document.write(' <param name="FlashVars" value="linkurl='+linkurl+'&urlartic='+urlartic+'&target='+target+'&foto1='+foto1+'&foto2='+foto2+'&foto3='+foto3+'&foto4='+foto4+'">');
  document.write('</object>');

};


// -----------------------------------------------------------------------------
// Función para insertar el player de Video con dimensiones variables.
//      xml:    URL al xml del video a reproducir.
//      start:  Partida en play, stop o pausa (stop con precarga del audio). 0:stop, 1:play, 2:pause
//      vol:    Volumen por defecto (posición inicial del control de volumen).
//      wvideo: Ancho del Player
//      hvideo: Alto del Player
//      thisid: Id del Flash
function showPlayerVideo(thexml,thestart,thevol,wvideo,hvideo,thisid) {
  if(thexml=='' || thisid=='') {
      return;
  };

  var movieUrl = "/noticias/flash/_PlayerVideo.swf";
  var ancho = '250';
  var alto = '180';
  if(wvideo != '') ancho = wvideo;
  if(hvideo != '') alto = hvideo;
  var anchoreal = parseInt(ancho);
  var altoreal = parseInt(alto) + 20;
  var fvars = {
      xml: thexml,
      start: thestart,
      vol: thevol}

  $('#'+thisid).html('No se pudo desplegar nuestro reproductor Flash');
  $('#'+thisid).flash({
    src: movieUrl,
    width: anchoreal,
    height: altoreal,
    flashvars: fvars
  });

};

