
        var imageidx = 0;
		var office = [];
		var thesePics = [];
	
        loadImages();

        function loadImages()
        {

			office[0] = ["office/tour8.jpg", "522", "372"];
			office[1] = ["office/tour10.jpg", "522", "372"];
			office[2] = ["office/tour9.jpg", "522", "372"];
			office[3] = ["office/tour11.jpg", "329", "372"];
			office[4] = ["office/tour12.jpg", "329", "372"];
			office[5] = ["office/tour2.jpg", "329", "372"];
			office[6] = ["office/tour6.jpg", "522", "372"];
			office[7] = ["office/tour7.jpg", "522", "372"];
			office[8] = ["office/tour3.jpg", "522", "372"];
			office[9] = ["office/tour5.jpg", "522", "372"];
			office[10] = ["office/tour4.jpg", "522", "372"];
			office[11] = ["office/tour1.jpg", "522", "372"];
			

	
			}
                                                    
      
                                                    
        function swapNext()
        {
            var links;
            image = thesePics[++imageidx];
			var imagesLength = thesePics.length -1;
            if ( imageidx >= imagesLength )
            {
                links = '<a href="javascript:swapPrev();">Previous</a>'
            }            
            else
            {
                links = '<a href="javascript:swapPrev();">Previous</a>&nbsp;<a href="javascript:swapNext();">Next</a>'

            }            

            MOOdalBox.open('loadimg.php?img='+image[0],links, image[1] + ' ' + image[2])

        }    

        function swapPrev()
        {
            var links;
            image = thesePics[--imageidx];
            if ( imageidx <= 0 )
            {
                links = '<a href="javascript:swapNext();">Next</a>'
            }            
            else
            {
                links = '<a href="javascript:swapPrev();">Previous</a>&nbsp;&nbsp;<a href="javascript:swapNext();">Next</a>'

            }            

            MOOdalBox.open('loadimg.php?img='+image[0],links, image[1] + ' ' + image[2])
        }    

        function start(whatPics)
        {
			imageidx = 0;
			if(whatPics) {
				var image = whatPics[0]; 
				thesePics = whatPics;
			}
			else {
				var image = images[0];	
				whatPics = images;
				thesePics = whatPics;
			}
            MOOdalBox.open('loadimg.php?img='+image[0],'<a href="javascript:swapNext();">Next</a>', image[1] + ' ' + image[2])
        }
