   
    var picno_3 = 0
    var i_3 = 1
    var AdsToDisplay_3 = 1; 
    var x_3 = AdsToDisplay_3
    var ImageNumber_3 = 1;
    var counter_3 = 0;

// set the initial src 
document.images["imagexyz_3_1"].src = init_picture_3
document.links("xyzhref_3_1").href = init_href_3
 
	var numberofPics_3 = picture_3.length
	
	///if the user had requested that more images
	///be displayed than are available in database
	///set no of images to be displayed to number 
	///in database
	if (numberofPics_3 < AdsToDisplay_3)
	{
		AdsToDisplay_3 = numberofPics_3
		x_3 = numberofPics_3
	}
		
		
		var num_3 = AdsToDisplay_3 - 1;
		var num2_3 = numberofPics_3 - num_3;


	function GetLinks_3(link)
	{
		document.location.href = splash_3[link];
	}
	
	
    function startClock_3()
    { 
		///rotates every x seconds
		///If the speed is set too quickly you will get flickering on the screen
		///as the code doesn't get enough time to run
		var Timer_3 = setTimeout("startClock_3()", 3700)
		{
			///This int specifies how many times the ad's will 
			///rotate , until all ads are shown
			///Once all ads are displayed, it restarts at the first ads
			if(picno_3 < num2_3)
			{
				///This is the ad to display
				i_3 = x_3-1
				///specifies how many ads to display at a time
				if (counter_3 <= (AdsToDisplay_3-1))
				{
					for (var loop_3=0; loop_3 < AdsToDisplay_3; loop_3++)
					{
						///gets the name of the image holder
						var ImageName_3 = "imagexyz_3_" + (loop_3 + 1);
						
						///Gets the link associted with the ad
						var LinkNames_3 = "xyzhref_3_" + (loop_3 + 1);
						
						///displays the specified ad
						if (document.images(ImageName_3) != null)
							document.images[ImageName_3].src = picture_3[i_3 - counter_3];
						
						//adds the link to the splash page to the ad
						if (document.links(LinkNames_3) != null)
							document.links(LinkNames_3).href = splash_3[i_3 - counter_3];					
						
						counter_3++;
					}
				}
				else
				{
					///resetting the values below
					///for next rotation
					picno_3++;
					x_3++;
					ImageNumber_3 = 1;
					counter_3 = 0;
				}
			}
			else
			{
				///once all ads have been rotated through once
				///restart function and reset variables
				
				///Ensures ads do not start flickering
				clearTimeout(Timer_3);
				
				picno_3 = 0;
				i_3 = 1
				x_3 = AdsToDisplay_3
				ImageNumber_3 = 1;
				counter_3 = 0;
				
				
				///if the user had requested that more images
				///be displayed than are available in database
				///set no of images to be displayed to number 
				///in database
				if (numberofPics_3 < AdsToDisplay_3)
				{
					AdsToDisplay_3 = numberofPics_3
					x_3 = numberofPics_3
				}
				
				startClock_3();
			}
		}
    } 
    
    startClock_3();
    