// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++ Function that randomly displays CD's that can be bought in the <div id="sidebar"> part of any of HTML pages. ++
// ++                                                                                                              ++
// ++ The function should be called as "showImage(<n>)". This means that a number of CD's can be displayed         ++
// ++ from one call.                                                                                               ++
// ++                                                                                                              ++
// ++ How to add a new CD to the lists:                                                                            ++
// ++                                                                                                              ++
// ++ Let's add the next Armalyte release "K-Nitrate - StarkPunkt".                                                ++
// ++ First back this file up somewhere just incase..                                                              ++
// ++ Add the catalog number to the CD array. I.e. after 'ARMCD011' add ,'ARMCD012                                 ++
// ++ Add the artist to the Artist array. I.e. after 'Digicore' add ,'K-Nitrate'                                   ++
// ++ Add the release to the Release array. I.e. after '"Without Freedom" add ,'"StarkPunkt"'                      ++
// ++ That's it!                                                                                                   ++
// ++                                                                                                              ++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function showImage(ShowThisMany){

	// ++ CD Catalog numbers. These MUST be the same as the catalog numbers used for the CD .gif images on the website. 
	var CD = new Array('ARMCD001',
			   'ARMCD002',
			   'ARMCD003',
			   'ARMCD004',
			   'ARMCD005',
			   'ARMCD006',
			   'ARMCD008',
			   'ARMCD009',
			   'ARMCD010',
			   'ARMCD011',
			   'ARMCD012',
			   'ARMCD013');
	
	// ++ Artist.
	var Artist = new Array('Defcon One',
			       'Interlock/Needleye',
			       'Bent U.S.A.',
			       'Defcon Two',
			       'Haloblack',
			       'Kreuzdammer',
			       'Concrete Lung',
			       'Soundphere Presents',
			       'Concrete Lung',
				   'Digicore',
			       'K-Nitrate',
				   'Je$us Loves Amerika');
	// ++ Release.
	var Release = new Array('"Industrial Dawn"',
				'"Death By Design"',
				'"As You Like"',
				'"Collateral Damage"',
				'"Throb"',
				'"Shot Down In Flames"',
				'"Waste Of Flesh"',
				'"Things To Come"',
				'"Versions Of Hell"',
				'"Without Freedom"',
				'"Stark Punkt"',
				'"FYA"');
	
	// ++++++++++++++++ DO NOT EDIT ANYTHING BELOW THIS LINE! ++++++++++++++++
	
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	// ++ Below code creates the CD links without duplicating links.        ++
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	var max = CD.length;
	var num;
	var hyperlink="";
	var createdCD="";
	var i = 1;
	
	// Stop people trying to show more items than we've got in the arrays.
	if (ShowThisMany > max)
	{
		ShowThisMany = max;
	}
	
	while (i<=ShowThisMany)
	{
		num = Math.floor((Math.random() * max));
		if (createdCD.search(num)==-1)
		{
			createdCD = createdCD + "," + num;
			
			hyperlink = "<a href=" + CD[num] + ".htm>";

			document.write('<b>(' + CD[num] + ')</b><br />');
			document.write(Artist[num] + '<br />');
			document.write(Release[num] + '<br />');
			
			document.write(hyperlink + '<img src="' + CD[num] + '.gif"/></a>');
			document.write('<a href="onlinestoreCD.htm">Buy the CD!</a>');
			document.write('<br /><br />');
			
			i++;
		} else {
			// Do nothing..
		}
	}
}
