                // Getting all ads
                function getAllAds2(){
                        var arr2 = new Array();

                        // All those pictures are in the same folder as this script
                        arr2[0] = new Array("<a href=http://oms.reosource.com/agents_products_f.htm><img src=http://www.reosource.com/images/agt_banner_1.gif border=1></a>");
				 arr2[1] = new Array("<a href=http://oms.reosource.com/agents_products_f.htm><img src=http://www.reosource.com/images/agt_banner_2.jpg border=1></a>");
		   	return arr2;
                }

                function getAllAds(){
                        var arr = new Array();

                        // All those pictures are in the same folder as this script

			 arr[0] = new Array("<a href=http://oms.reosource.com/agents_products_f.htm><img src=http://www.reosource.com/images/agt_sky_1.jpg border=1></a>");
                                 arr[1] = new Array("<a href=http://oms.reosource.com/agents_products_f.htm><img src=http://www.reosource.com/images/agt_sky_2.jpg border=1></a>");

                        return arr;
                }

                // Getting a random number
                function getRandomNumber(maxVal){
                        var ran_unrounded = Math.random()*maxVal;
                        var num = Math.round(ran_unrounded);
                        return num;
                }
                
                // Rotating Ads
                function rotate(){
			var arr2 = new Array();
			arr2 = getAllAds2();
 			while ( ! arr2[randomAdIndex2]){
                        	var randomAdIndex2 = getRandomNumber(arr2.length-1);
                        }
                        document.getElementById("ad2").innerHTML = arr2[randomAdIndex2];
	
                        var arr = new Array();
                        arr = getAllAds();
			while (! arr[randomAdIndex]){
                        	var randomAdIndex = getRandomNumber(arr.length-1); 
			}
			//alert ("num banner " + randomAdIndex);
                        if(document.getElementById("ad") != null){
				document.getElementById("ad").innerHTML = arr[randomAdIndex];
                       	} 
			//setTimeout("rotate()", 1);
                }
        

                // Delaying rotations

