// script source: www.olympusrally.com 
//homepage image swapper
	var theImages = new Array() 
	theImages[0] = '/olympusrally/images/banners/1.jpg'
	theImages[1] = '/olympusrally/images/banners/2.jpg'
	theImages[2] = '/olympusrally/images/banners/3.jpg'
	theImages[3] = '/olympusrally/images/banners/4.jpg'
	theImages[4] = '/olympusrally/images/banners/5.jpg'
	theImages[5] = '/olympusrally/images/banners/6.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));
	var whichImage = -1;
	function showImage(){
	whichImage++;
	if (whichImage > 5) { whichImage = 0; }
	document.getElementById('main_img').src = preBuffer[whichImage].src;
	setTimeout('showImage()',5000);
	}
	
	
// this function takes four args:
// url: path to the image
// title: the title you want displayed
// w: width of the image
// h: height of the image  
//
// use this shit all you want, but make sure a playa gets
// credit where credit is due! beeeatch!
function popper( url, title, w, h )
{
  // get the screen dimensions and figure out where
  // to place the image 
  sw = ( screen.availWidth - w ) / 2;
  sh = ( screen.availHeight - h ) / 2;
  // set your window properties
  dims = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,width=' + w + ',height=' + h + ',innerwidth=' + w + ',innerheight=' + h + ',screenX=' + sw + ',screenY=' + sh + ',left=' + sw + ',top=' + sh; 
  htmlStr = '<html><head><title>' + title + '</title><style type="text/css">body { margin:0px ; padding:0px;}</style></head><body bgcolor="#000000" onBlur="window.close();" onClick="window.close();"><img src="' + url + '" width="' + w + '" height="' + h + '" border="0"/></body></html>';
  // create the window and write HTML into it!
  imgWin = window.open( '', 'imgWin', dims );
  //imgWin.document.open( 'text/html', 'replace' );
  imgWin.document.write( htmlStr );
  imgWin.document.close();
  // now, you're a rockstar!
  imgWin.focus();
}