// random image function //

var home = "home/img"
var golf = "golf/img"
var range = "golf/range/img"
var simulators = "golf/simulators/img"
var minigolf = "golf/minigolf/img"
var leagues = "leagues/img"
var football = "leagues/ff/img"
var softball = "leagues/sb/img"
var golf_league = "leagues/sg/img"
var nineteenth = "nineteenth/img"
var parties = "parties/img"
var about = "about/img"

function writeImg(section, picNum) 
  {

	function randNum (num) 
	  {
     	var now = new Date();
     	var rand = Math.round(num * Math.cos(now.getTime()));
     	if (rand < 0) rand = - rand; if (rand == 0) rand++;
     	picNum = rand;
	  }

	randNum(picNum);
	
    document.writeln('<img class="mainImg" src="images/' + section + picNum + '.jpg" alt="The Sports Bubble">');
  }

/* 
Include script in web page like this...
<script language="JavaScript1.2" src="js/script_name.js"></script>

...Then call the function where you want the random image to live like this...
<script language="JavaScript">writeImg(section, picNum);</script>

...where "section" = 

home
golf
range
simulators
minigolf
leagues
football
softball
golf_league
nineteenth
parties
about

...and "picNum" is the number of images available to display

*/