//POP-UP WINDOW GENERATOR
function popup (url,width,height,winname,scroll) { 
	var url, width, height; 
	if (width == null) { width = 550; } // default width 
	if (height == null) { height = 350; } // default height 
	var xleft, xtop; if (document.all) { 
		xleft = (screen.width - width) / 2; 
		xtop = (screen.height - height) / 2; 
	} else { 
		if (document.layers) { 
			xleft = (window.outerWidth - width) / 2; 
			xtop = (window.outerHeight - height) / 2; 
		} else { 
			xleft = 320; 
			xtop = 240; 
		} 
	} 
	win=window.open("",winname,'toolbar=no,location=no,directories=no,status=no' 
	+',menubar=no,scrollbars='+scroll+',resizable=yes,width='+width+',height='+height 
	+'screenX='+xleft+',screenY='+xtop+',top='+xtop+',left='+xleft); 
	win.document.write('<head><title>'+winname+'</title></head>');
	win.document.write('<body leftmargin="0" topmargin="0">');
	win.document.write('<a href="javascript:window.close()"><img src="'+url+'" border="0"></a>'); 
	win.document.write('</body>'); 
} 

// RANDOM PHOTO GENERATOR
var theImages = new Array()
theImages[0] = 'images/random/photo01.jpg'
theImages[1] = 'images/random/photo02.jpg'
theImages[2] = 'images/random/photo03.jpg'
theImages[3] = 'images/random/photo04.jpg'
theImages[4] = 'images/random/photo05.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
	preBuffer[i] = new Image()
	preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
	document.write('<img src="'+theImages[whichImage]+'">');
}

// HOMEPAGE SLIDE SHOW
var speed = 3000
var Pic = new Array() // don't touch this
Pic[0] = 'images/splash/spring.jpg'
Pic[1] = 'images/splash/summer.jpg'
Pic[2] = 'images/splash/autumn.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
function runSlideShow(){
   document.images.SlideShow.src = preLoad[j].src
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', speed)
}