//*---------------------------------------------
//* Rutinas para el manejo de imágenes dinámicas
//*---------------------------------------------
Mascotas = new Array();
var iMascotaCount = 0;

//*
//* Lista de Mascotas
//* Ingresar los Mascotas aqui !!!
//*
//* Funcion:
//* AddMascota( URL, Alternative_text );
//*
AddMascota( "actitud.gif", "UniversoPostal.com" );
AddMascota( "alegria.gif", "UniversoPostal.com" );
AddMascota( "fierita.gif", "UniversoPostal.com" );
AddMascota( "ira.gif", "UniversoPostal.com" );
//AddMascota( "verguenza.gif", "UniversoPostal.com" );

//*
//* Rutinas de proceso
//*
var sum_of_all_chances = 0;
for (i = 0; i < Mascotas.length; i++) {
	sum_of_all_chances += Mascotas[i].chance;
}

function AddMascota( imgSource, alt ) {
	Mascotas[iMascotaCount++] = new Mascota( imgSource, alt, 10 )
}

function Mascota( imgSource, alt, chance ) {
	this.imgSource = imgSource;
	this.alt = alt;
	this.chance = chance;
}

function randomMascota() {
	var chance_limit = 0;
	var randomly_selected_chance = 0;
	
	randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
	
	for (i = 0; i < Mascotas.length; i++) {
		chance_limit += Mascotas[i].chance;
		if (randomly_selected_chance <= chance_limit) {
			document.write("<a href=index.php><img src='/images/mascotas/" + Mascotas[i].imgSource + "' width=146 height=115 vspace=0 border=0 alt='" + Mascotas[i].alt + "'></a>");
			//return Mascotas[i];
			break;
      }
   }
}
// END ->

<!--
// Ventana Nueva
	function RecordarPass(desktopURL)
      { 
	  document.location='http://www.multizona.com/pase/recordar.php?site=90';
      }
// -->

<!--
// Ventana Nueva
	function Mensajeria(desktopURL)
      { 
	  var desktop = window.open( "templates"+desktopURL, "_blank", "width=360,height=350,scrollbars=yes,resizable=no");
      }
// -->