
//
//  Efecto de las fotos para verlas en los thumbnails
//  by Becker Cuéllar (c) 2001
//
//  Revision para hacerlo standard
//
//   Espera que en el directorio esten los archivos en 3 tamaños
//   por ejm.  <BASE-pic-nombre>_Lm_n  donde n [1-xxx] y m in [0-3] 
//                                              0(min),1(med),3(full)


// define and set default values
cur_pic=1
MAX_PIC=13
PICS_2_SHIFT=4
BASE_NAME= ''


//
//  -- llama en load de modo que automaticamente va saber que fotos procesar
//  -- BsC 06/24/02 (c) All rights reserved
//
//     syntax:  SetUp('/this/virtual/dir/', 'this_base_name')
//
function set_up(this_virtual_dir, this_base_name, this_count)
{
   BASE_NAME = this_base_name;  

   MAX_PIC = this_count;
}


// set the cur shifted(if at all) thumbnail
function Set_it(value)
{

  if ( value==1 && cur_pic<MAX_PIC - PICS_2_SHIFT )

     cur_pic++;

  else if( value==-1 && cur_pic>1 )

       cur_pic--;



  if( cur_pic==1) 

    document.Flecha_izq.src="/galeria_ferrari/L_ROJO.gif";

  else if(cur_pic==MAX_PIC - PICS_2_SHIFT)               

    document.Flecha_der.src="/galeria_ferrari/R_ROJO.gif";

  else

  {

    document.Flecha_izq.src="/galeria_ferrari/L_VERDE.gif";

    document.Flecha_der.src="/galeria_ferrari/R_VERDE.gif";

  }


   
   this_pic = 0 + cur_pic;
   document.foto_1.src=BASE_NAME + "L0_"+ this_pic + ".jpg";
   this_pic = 0 + cur_pic + 1;
   document.foto_2.src=BASE_NAME + "L0_"+ this_pic + ".jpg";
   this_pic = 0 + cur_pic + 2;
   document.foto_3.src=BASE_NAME + "L0_"+ this_pic + ".jpg";

   this_pic = 0 + cur_pic + 3;
   document.foto_4.src=BASE_NAME + "L0_"+ this_pic + ".jpg";




   return( true );

}



function Poppy(esta_figura, full_size)
{

  this_picy = 0 + cur_pic + esta_figura - 1;

  if( full_size == 1)
  { 
    window.open(BASE_NAME + "L2_"+ this_picy +'.jpg' ,'top','scrollbars=yes,toolbar=no');
  }
  else if( full_size == 0)
  {
    document.foto_main.src=BASE_NAME + "L1_"+ this_picy + ".jpg";
  }
  else // justy pull up th image
  {
    //ya que esto puede ser llamado varias veces hagamos seguro de que
    //  el nombre del popUP sea diferente
    hoy = new Date;

    if( full_size == 666)
    {
      window.open(esta_figura,'top'+ hoy.getTime()  ,'scrollbars=yes,toolbar=no');
    }
    else
    {
      window.open(esta_figura,'top'+ hoy.getTime()  ,'scrollbars=yes,toolbar=no,height=' + full_size+', width='+ (1.5 * full_size) + '\'');
    }
  }

  return true;

}

function Get_date()
{

  var browser_type=navigator.appName ; 

  meses = new Array(12);
  meses.length = 12;
  meses[1] = "Jan";meses[2] = "Feb";meses[3] = "Mar";
  meses[4] = "Apr";meses[5] = "May";meses[6] = "Jun";
  meses[7] = "Jul";meses[8] = "Aug";meses[9] = "Sep";
  meses[10] = "Oct";meses[11] = "Nov";meses[12] = "Dec";

  //Set todays' date properly

  now = new Date()


  the_day = now.getDate();

  the_month= now.getMonth() + 1;

  monthy = meses [ the_month ];
  if(  browser_type == "Microsoft Internet Explorer" )
    the_year = now.getYear();
  else // handle NS hre
    the_year = now.getYear() + 1900;        


  the_date_is = "" +  monthy + " " ;

  the_date_is += ""+((the_day<10)?"0":"")+the_day;


  the_date_is += ", " +  the_year;


  return (the_date_is);

}      





