	var T = -115;
	var Counter = 0;
	var Phase = 0;
	
	var Images = new Array();
	var Links = new Array();
	var Alt = new Array();
	var Sliding = false;
	var Page = 1;	

var imagecount = 0;
function addimage(file, alt, link)
{
	Images[imagecount] = "/images/slide/" + file;
	Links[imagecount] = "/" + link;
	Alt[imagecount] = alt;
	imagecount = imagecount + 1;
}

addimage("bachelorette_pole_dance_party.jpg" , "Pole Dance Party", "bachelorette_packages.htm#H6");
addimage("beer_keg.jpg" , "Beer Keg for hire", "extras.htm#H2");
addimage("bush_pub.jpg" , "Dop till you drop at the Bush Pub", "bachelors_packages.htm#H1");
addimage("canopy_tour_action.jpg" , "Canopy Tour Action", "Birthday_packages.htm#H11");
addimage("cemetry_entrance.jpg" , "Ghost Bus Tour", "Birthday_packages.htm#H8");
addimage("cheers_girls.jpg" , "Fun in the jacuzzi", "bachelorettes.htm");
addimage("cheers_mateys.jpg" , "Beer Keg for hire", "extras.htm#H2");
addimage("chocolate_making___laughing.jpg" , "chocolate making   laughing", "bachelorette_packages.htm#H3");
addimage("crawling_bachelor.jpg" , "crawling bachelor", "bachelors.htm");
addimage("danceheads_party.jpg" , "Dancing Heads Party", "Birthday_packages.htm#H5");
addimage("dealer_button_pack.jpg" , "dealer button pack", "shop.htm#H3");
addimage("dragon_pinata.jpg" , "Dragon Pinata", "shop.htm#H1");
addimage("drinking_shooters.jpg" , "Nothing like a shooter", "birthdays.htm");
addimage("flying_sumo.jpg" , "flying sumo", "bachelors_packages.htm#H7");
addimage("foam_pit_waiting_for_action.jpg" , "foam pit waiting for action", "bachelorette_packages.htm#H16");
addimage("friend_with_gifts.jpg" , "What's a party without presents?", "birthdays.htm");
addimage("funny_present.jpg" , "What's a birthday without presents?", "birthdays.htm");
addimage("fun_in_the_snow.jpg" , "Snow machine for hire", "extras.htm#H2");
addimage("giant_jenga_close-up.jpg" , "Jenga for giants", "bachelors_packages.htm#H15");
addimage("girly_fun_in_the_foam_pit.jpg" , "girly fun in the foam pit", "bachelorette_packages.htm#H16");
addimage("girly_fun_in_the_limo.jpg" , "girly fun in the limo", "bachelorette_packages.htm#H12");
addimage("gladiator_jousting.jpg" , "gladiator jousting", "bachelors_packages.htm#H7");
addimage("goal_shot_human_foosball.jpg" , "goal shot human foosball", "bachelors_packages.htm#H16");
addimage("happy_drinking.jpg" , "happy drinking", "bachelors.htm");
addimage("human_spheres.jpg" , "human spheres", "bachelors_packages.htm#H17");
addimage("inflatable_pub_exterior.jpg" , "inflatable pub exterior", "bachelors_packages.htm#H2");
addimage("kangaroo_boxing.jpg" , "kangaroo boxing", "bachelors_packages.htm#H7");
addimage("lapdancing.jpg" , "lapdancing", "bachelorette_packages.htm#H6");
addimage("luxury_in_the_jacuzzi.jpg" , "luxury in the jacuzzi", "bachelorette_packages.htm#H1");
addimage("luxury_picnic.jpg" , "luxury picnic", "Engagement_packages.htm#H7");
addimage("make-over_time.jpg" , "make-over time", "bachelorette_packages.htm#H17");
addimage("make-up_application.jpg" , "make-up application", "bachelorette_packages.htm#H17");
addimage("meaty_feast.jpg" , "meaty feast", "bachelors_packages.htm#H20");
addimage("mechanical_bull.jpg" , "mechanical bull", "bachelors_packages.htm#H18");
addimage("moonlight_maze.jpg" , "moonlight maze", "#");
addimage("paintballer_in_sight.jpg" , "paintballer in sight", "bachelors.htm");
addimage("paintball_action.jpg" , "paintball action", "bachelors.htm");
addimage("party_bus_inside.jpg" , "party bus inside", "bachelors_packages.htm#H3");
addimage("party_girl.jpg" , "party girl", "bachelorettes.htm");
addimage("party_time.jpg" , "party time", "birthdays.htm");
addimage("poledancing_lesson.jpg" , "poledancing lesson", "bachelorette_packages.htm#H6");
addimage("pole_dancing_group.jpg" , "pole dancing group", "bachelorette_packages.htm#H6");
addimage("pregnant_ladies.jpg" , "pregnant ladies", "stork.htm");
addimage("snow_machine_fun.jpg" , "Snow machine for hire", "extras.htm#H2");
addimage("spa_fantasy_party.jpg" , "spa fantasy party", "bachelorette_packages.htm#H13");
addimage("stargazing.jpg" , "stargazing", "Engagement_packages.htm#H3");
addimage("stork_party_presents.jpg" , "stork party presents", "stork.htm");
addimage("sumo_wrestle.jpg" , "sumo wrestle", "bachelors_packages.htm#H7");
addimage("wine_being_poured.jpg" , "wine being poured", "Housewarming_packages.htm#H4");
addimage("wine_glasses_close-up.jpg" , "wine glasses close-up", "Birthday_packages.htm#H1");



		
	function SlideDown(imgT, imgB)
	{		
			Sliding = true;
			if (T < 5)
			{ 	
				if (Phase < 3) { T = T + 2; }  else { T = T + 8;  } 
				if (T > 5) {T = 5;}
				imgT.style.top = T;
				imgB.style.top = T+20;
				
				setTimeout('SlideDown(' + imgT.id + ',' + imgB.id + ');', 10);
			}
			else
			{
				Sliding = false;
				if (Phase < 3) 
				{
					T = -115;
					NextPhase();
					Phase = Phase + 1;
				}
				else
				{
					T = -400;
				}	
			}
	}

	function NextPhase()
	{
		if (Phase == 0)
			{ setTimeout('SlideDown(img2T, img2B)', 2); }
		if (Phase == 1)
			{ setTimeout('SlideDown(img3T, img3B)', 2); }
		if (Phase == 2)
			{ 
				Phase = -1;
				NextThree(); 
				setTimeout('SlideDown(img1T, img1B)',10000);
			}
	}	

	function ShowPhotos()
	{
		var o = document.getElementById("imgBB");

		if (o == null)
		{
			//alert('Slider');

			Counter = Math.floor(Math.random()* (Images.length + 1));
			if (Counter < 0 || Counter > Images.length - 1) { Counter = 0 }
		
			LineUp();
			setTimeout('SlideDown(img1T, img1B)',2000);
		}
		else
		{
			//alert('Gallery');
			LoadGallery(1);
		}
	}

	function LoadGallery()
	{
		for (var i = 0; i<= 8; i=i+1)
		{
			var img = document.getElementById("img" + (i+1));
			var Counter = (Page - 1) * 9 + i;
			
			img.src = "\\images\\slide\\ph.jpg"; 
			img.alt = "";

			if (Images.length > Counter) {
				img.src = Images[Counter]; 
				img.alt = Alt[Counter]; 

				var link = document.getElementById("link" + (i+1));
				link.href = Links[Counter];
			}
		}

		if (Page > 1) {divPrevious.style.visibility = "visible";}
		else {divPrevious.style.visibility = "hidden";}

		if (Images.length > Page * 9) {divNext.style.visibility = "visible";}
		else {divNext.style.visibility = "hidden";}

		LoadPicture(img1);
	}

	function NextPage()
	{
		Page = Page + 1;
		LoadGallery();
	}

	function PreviousPage()
	{	
		Page = Page - 1;
		LoadGallery();
	}

	function LoadPicture(smallimg)
	{
		var i = parseInt(smallimg.id.substr(3,1));
		i = 9 * (Page-1) + i - 1;

		if (i >= Images.length) {return; }

		var url = smallimg.src.replace(".jpg","_big.jpg");

		if (!Sliding)
		{
			imgBB.src = imgBT.src; imgBB.alt = imgBT.alt; 
		}

		imgBT.src = "\\images\\slide\\loading.jpg";
		imgBT.src = url; 
		imgBT.alt = Alt[i];
		lnk.innerHTML = smallimg.alt;
		lnk.style.visibility = "visible";
		lnk.href = Links[i]; 

		Phase = 5;
		if (!Sliding) { SlideDown(imgBT, imgBB); }
	}

	
	function LineUp()
	{
		//get the next 3 ready...
		img1T.src = Images[Counter]; lnk1T.href = Links[Counter]; img1T.alt = Alt[Counter]; NextImage();
		img2T.src = Images[Counter]; lnk2T.href = Links[Counter]; img2T.alt = Alt[Counter]; NextImage();
		img3T.src = Images[Counter]; lnk3T.href = Links[Counter]; img3T.alt = Alt[Counter]; NextImage();
		
		

	}
	
	function NextThree()
	{
		//reset top and bottom controls. --> set bottom values to top value, hide bottom and show top.
		img1B.src = img1T.src; lnk1B.href = lnk1T.href; img1B.alt = img1T.alt; img1T.style.top = -115; img1B.style.top = -95;
		img2B.src = img2T.src; lnk2B.href = lnk2T.href; img2B.alt = img2T.alt; img2T.style.top = -115; img2B.style.top = -95;
		img3B.src = img3T.src; lnk3B.href = lnk3T.href; img3B.alt = img3T.alt; img3T.style.top = -115; img3B.style.top = -95;
		
		//line up the next images
		LineUp();
	}
	
	function NextImage()
	{
		Counter = Counter + 1;
		if (Counter >= Images.length) {Counter = 0;}
		
	}
	
	//setTimeout('ShowPhotos()',1500);