// JavaScript Document

var timerID = 0;
var featuredproducts = new Array();
featuredproducts[0]='cnn\/Facebook_Subat_728x90_01.swf';
featuredproducts[1]='cnn\/Twitter_Subat_728x90_01.swf';
featuredproducts[2]='cnn\/Haberim_Subat_728x90_01.swf';

var bgcolor=new Array;
bgcolor[0]='#FFFFFF';
bgcolor[1]='#FFFFFF';
bgcolor[2]='#FFFFFF';

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};
 
var count = -1;

function updatebarea() {
   var updatedcode;
   var featLen = featuredproducts.length;
   count++;
   if (count >= featLen) {
	   count = 0;
   }
   if(timerID) {
      clearTimeout(timerID);
   }
	 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=\"728\" height=\"90\" 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=best bgcolor=' + bgcolor[count] + '  width=\"728\" height=\"90\" 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.barea2.document.open();
  document.barea2.document.write(updatedcode);
  document.barea2.bgColor = bgcolor[count];
  document.barea2.document.close();
 }
 timerID=setTimeout ("updatebarea()", 9800);
}