var timerID = 0;
var featuredproducts = new Array();
var bgcolor=new Array ();
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function initBanners(pageRoot) {
    featuredproducts[0] = pageRoot + 'Flash\/lily-goodman-sin-mi-edo.swf';
    featuredproducts[1] = pageRoot + 'Flash\/pdv-banner-2.swf';
    featuredproducts[2] = pageRoot + 'Flash\/torontochristianradioadd.swf';
    featuredproducts[3] = pageRoot + 'Flash\/SacredRoots_425x109.jpg';
    featuredproducts[4] = pageRoot + 'Flash\/bernardo-banner.jpg';
    bgcolor[0] = '#000000';
    bgcolor[1] = '#000000';
    bgcolor[2] = '#FFFFFF';
    bgcolor[3] = '#000000';
    bgcolor[4] = '#fefefe';
} 
function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

function updatebarea() {
   var updatedcode;
   var featLen = featuredproducts.length;
   var count = -1;
   while (count < 0 || count > featLen ) {
   		count = Math.floor (Math.random()*(featLen));
   }
   if(timerID) {
      clearTimeout(timerID);
  }
	if (count == 3) {
	    updatedcode = "<a href=\"http:\/\/www.libreriapandevida.com\/cds\/sacred-_roots_1164.htm\"><img src=\"\/Flash\/SacredRoots_425x109.jpg\" width=\"425\" height=\"109\" alt=\"Sacred- Roots\" \/><\/a>"
	} else if (count == 4) {
		updatedcode = "<a href=\"http:\/\/www.libreriapandevida.com\/cds\/tu_amor_es_tan_grande_1166.htm\"><img src=\"\/Flash\/bernardo-banner.jpg\" width=\"425\" height=\"109\" alt=\"Bernardo Ramirez\" \/><\/a>"
//	} else {
//		updatedcode = "<a href=\"\/junio_16_2006.asp\"><img src=\"\/Flash\/santo_remedio.jpg\" width=\"425\" height=\"109\" alt=\"\" \/><\/a>"
	} else {
	 updatedcode = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0\" width=\"425\" height=\"109\" id=\"featuredproduct\" ><param name=\"movie\" value=\"'
	 updatedcode += featuredproducts[count];
	 updatedcode += '\" \/> <param name=\"quality\" value=\"high\" \/> <param name=bgcolor value=\"' + bgcolor[count] + '\" \/> <embed src=\"'
	 updatedcode += featuredproducts[count];
	 updatedcode += '\" quality=high bgcolor=' + bgcolor[count] + '  width=\"425\" height=\"109\" name=\"featuredproduct\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\"><\/embed><\/object>'
	}
 if (document.getElementById) {
	document.getElementById("barea").innerHTML = updatedcode;
	document.getElementById("barea").style.backgroundColor = bgcolor[count];
 } else {
  document.getElementById("barea").document.open();
  document.getElementById("barea").document.write(updatedcode);
  document.getElementById("barea").bgColor = bgcolor[count];
  document.getElementById("barea").document.close();
 }
 timerID=setTimeout ("updatebarea()", 45000);
}

