    var picno_2 = 0
    var i_2 = 1
    var AdsToDisplay_2 = 1; 
    var x_2 = AdsToDisplay_2
    var ImageNumber_2 = 1;
    var counter_2 = 0;

// set the initial src 
document.images["imagexyz_2_1"].src = init_picture_2
document.links("xyzhref_2_1").href = init_href_2
 
 
	var numberofPics_2 = picture_2.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_2 < AdsToDisplay_2)
	{
		AdsToDisplay_2 = numberofPics_2
		x_2 = numberofPics_2
	}
		
		
		var num_2 = AdsToDisplay_2 - 1;
		var num2_2 = numberofPics_2 - num_2;


	function GetLinks_2(link)
	{
		document.location.href = splash_2[link];
	}
	
	
    function startClock_2()
    { 
		///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_2 = setTimeout("startClock_2()", 3600)
		{
			///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_2 < num2_2)
			{
				///This is the ad to display
				i_2 = x_2-1
				///specifies how many ads to display at a time
				if (counter_2 <= (AdsToDisplay_2-1))
				{
					for (var loop_2=0; loop_2 < AdsToDisplay_2; loop_2++)
					{
						///gets the name of the image holder
						var ImageName_2 = "imagexyz_2_" + (loop_2 + 1);
						
						///Gets the link associted with the ad
						var LinkNames_2 = "xyzhref_2_" + (loop_2 + 1);
						
						///displays the specified ad
						if (document.images(ImageName_2) != null)
							document.images[ImageName_2].src = picture_2[i_2 - counter_2];
						
						//adds the link to the splash page to the ad
						if (document.links(LinkNames_2) != null)
							document.links(LinkNames_2).href = splash_2[i_2 - counter_2];					
						
						counter_2++;
					}
				}
				else
				{
					///resetting the values below
					///for next rotation
					picno_2++;
					x_2++;
					ImageNumber_2 = 1;
					counter_2 = 0;
				}
			}
			else
			{
				///once all ads have been rotated through once
				///restart function and reset variables
				
				///Ensures ads do not start flickering
				clearTimeout(Timer_2);
				
				picno_2 = 0;
				i_2 = 1
				x_2 = AdsToDisplay_2
				ImageNumber_2 = 1;
				counter_2 = 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_2 < AdsToDisplay_2)
				{
					AdsToDisplay_2 = numberofPics_2
					x_2 = numberofPics_2
				}
				
				startClock_2();
			}
		}
    } 
    
    startClock_2();