//////////////////////////////////////////////////////////////////////////////////////////
// get_Image() Function
//
// Chooses a random image to display from preexisting set of images in an array
// - the image will NOT be forced to a specific size
// - border size of zero means that no ugly border gets drawn around your image when displayed
// - debugging enables or disaples some debugging messages -- useful for making sure the right base url path is set
// - imgBaseURL is the absolute path to where available pix for random selection are located, must include trailing slash
// - adding a new image is simple, add a new entry to the array -- done!
// - don't forget to turn of debugging when going to production server
//
// USAGE:
//
//	Be sure to load this script library in your document <head> 
//
//		<script src="library/randomDJpic.js" 	type="text/javascript"></script>
//
//	When calling the get_Image function in the page body, use the following code...
//
//		<script type="text/javascript"> 
//		<!-- 
//			get_Image() 
//		//--> 
//		</script>
//
//	...this will load a random image from the below defined array into your document
//
//	Also, make sure you update the imgBaseURL variable to be the path to your image
//	image directory base, it must end with the trailing slash to work properly.
//

function get_Image(){
	var debugging=0;		// 0=off, 1=on
	var imgBaseURL = "http://www.djculture.com/djpix/";	// base URL for images
	
	
	var img_name = new Array(
		
		// when adding new item to this array
		// add at top, and end line with a comma
		// this is important, as the array must end with no comma, 
		// followed by close parenthesis, followed by semicolon
		
		imgBaseURL + "bar_bonesrec.jpg", 
		imgBaseURL + "bar_deadmau5.jpg", 
		imgBaseURL + "bar_jtrec.jpg", 	
		imgBaseURL + "bar_liferec.jpg", 
		imgBaseURL + "bar_deadmau5.jpg", 
		imgBaseURL + "bar_swamprec.jpg", 
		imgBaseURL + "bar_tcmrec.jpg", 
		imgBaseURL + "bar_joshethan.jpg", 
		imgBaseURL + "bar_aerotommylee.jpg", 
		imgBaseURL + "bar_chriscarter.jpg", 
		imgBaseURL + "bar_crew.jpg", 
		imgBaseURL + "bar_dan.jpg", 
		imgBaseURL + "bar_davydave.jpg", 
		imgBaseURL + "bar_donald.jpg", 
		imgBaseURL + "bar_egil.jpg", 
		imgBaseURL + "bar_eliteforce.jpg", 
		imgBaseURL + "bar_deadmau5.jpg", 
		imgBaseURL + "bar_feelgood.jpg", 
		imgBaseURL + "bar_fk5.jpg", 
		imgBaseURL + "bar_friendly.jpg", 
		imgBaseURL + "bar_gumbfaline.jpg", 
		imgBaseURL + "bar_johnkelley.jpg", 
		imgBaseURL + "bar_josefq.jpg", 
		imgBaseURL + "bar_joshkaskade.jpg", 
		imgBaseURL + "bar_lillyannehawkeye.jpg", 
		imgBaseURL + "bar_loveblake.jpg", 
		imgBaseURL + "bar_lynwood.jpg", 
		imgBaseURL + "bar_marscriser.jpg", 
		imgBaseURL + "bar_mea.jpg", 
		imgBaseURL + "bar_deadmau5.jpg", 
		imgBaseURL + "bar_meatkatie.jpg", 
		imgBaseURL + "bar_ocscmerc.jpg", 
		imgBaseURL + "bar_oscure.jpg", 
		imgBaseURL + "bar_deadmau5.jpg", 
		imgBaseURL + "bar_rapirene.jpg", 
		imgBaseURL + "bar_reid.jpg", 
		imgBaseURL + "bar_swamp.jpg", 
		imgBaseURL + "bar_wallywobs.jpg");
	
	// determine how long our array is -- how many items minus one equals the number of the last item 
	var maxNum = img_name.length-1 ;
	
	// get a random number between 0 and the highest numbered item in the array
	var rnd_no = Math.round(Math.random()*(img_name.length-1));
	
	
	if (debugging==1) {
		document.write('Random: ' + rnd_no + '<br>');
		document.write('img_name.length: ' + img_name.length + '<br>');
		document.write('maxNum: ' + maxNum + '<br>');
		document.write('img_name[rnd_no]: ' + img_name[rnd_no] + '<br>');
	}

	
	// Draw the random image out to the document...
	document.write('<IMG SRC="' + img_name[rnd_no] + '" ALT="Friends of DJ Culture"><br>');
	
	if (debugging==1) {
		document.write('randomDJpic2.js done processing <hr>');
	}


}