function MM_rand()
{
	/*
	 * This function is used to render random images to a webpage using the config below
	 * please change only the elements contained in a CONFIG comment
	 * @author Fabian Frei, frei@mediamotion.ch, MediaMotion GmbH
	 */
	
	
	/**************** MAIN - CONFIG ****************/
	this.numberOfItems = 8;
	this.spacer = "<img height='1' width='12' alt='' src='http://wl11www737.webland.ch/cms/fileadmin/_nav/spacer.gif' />";
	/**************** MAIN - CONFIG ****************/
	
	/**************** DO NOT CHANGE - Init of the vars needed ****************/
	this.numberOfItemsForArray	= this.numberOfItems - 1;
	this.randArray 				= new Array(this.numberOfItemsForArray);
	this.imagesArray			= new Array(this.numberOfItemsForArray);
	/**************** DO NOT CHANGE - Init of the vars needed ****************/
	
	/**************** imagesArray - CONFIG (you have to start with 1 instead of 0 // if you have to add javascript plz use \'someArgument\') ****************/
	
	this.imagesArray[1] = '<a href="http://www.kabe-farben.ch" target="_blank" onmouseover="MM_swapImage(\'Image25\',\'\',\'fileadmin/_img/logoKABEColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoKABEBW.gif" alt=" " name="Image25" id="Image25" border="0" width="113" height="57"></a>';
	this.imagesArray[2] = '<a href="http://www.heussertapeten.ch" target="_blank" onmouseover="MM_swapImage(\'Image23\',\'\',\'fileadmin/_img/logoHeusserColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoHeusserBW.gif" alt=" " name="Image23" id="Image23" border="0" width="113" height="57"></a>';
	this.imagesArray[3] = '<a href="http://www.dold.ch" target="_blank" onmouseover="MM_swapImage(\'Image21\',\'\',\'fileadmin/_img/logoDoldColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoDoldBW.gif" alt=" " name="Image21" id="Image21" border="0" width="113" height="57"></a>';
	this.imagesArray[4] = '<a href="http://www.frenicolor.ch" target="_blank" onmouseover="MM_swapImage(\'Image27\',\'\',\'fileadmin/_img/logo_FreniBW.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logo_FreniColor.gif" alt=" " name="Image27" id="Image27" border="0" width="113" height="57"></a>';
	/* this.imagesArray[4] = '<img src="fileadmin/_img/logoEmpty.gif" name="Image27" id="Image27" alt="" border="0" width="113" height="57">'; */
	this.imagesArray[5] = '<a href="http://www.stoag.ch" target="_blank" onmouseover="MM_swapImage(\'Image29\',\'\',\'fileadmin/_img/logoSTOColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoSTOBW.gif" alt=" " name="Image29" id="Image29" border="0" width="113" height="57"></a>';
	this.imagesArray[6] = '<a href="http://www.keim.ch" target="_blank" onmouseover="MM_swapImage(\'Image211\',\'\',\'fileadmin/_img/logoKEIMColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoKEIMBW.gif" alt=" " name="Image211" id="Image211" border="0" width="113" height="57"></a>';
	this.imagesArray[7] = '<a href="http://www.meier-oberflaechen.ch" target="_blank" onmouseover="MM_swapImage(\'Image213\',\'\',\'fileadmin/_img/meier_color.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/meier_sw.gif" alt=" " name="Image213" id="Image213" border="0" width="113" height="57"></a>';
	
	this.imagesArray[8] = '<a href="http://www.caparol.ch" target="_blank" onmouseover="MM_swapImage(\'Image313\',\'\',\'fileadmin/_img/logoCAPAROLColor.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="http://wl11www737.webland.ch/cms/fileadmin/_img/logoCAPAROLBW.gif" alt=" " name="Image313" id="Image313" border="0" width="113" height="57"></a>';
	
	this.imagesArray[9] = '<img src="fileadmin/_img/logoEmpty.gif" name="Image215" id="Image215" alt="" border="0" width="113" height="57">';
	
	/**************** imagesArray - CONFIG (you have to start with 1 instead of 0 // if you have to add javascript plz use \'someArgument\') ****************/
	
/*************************************************************************/	
	this.newRand = function ( n )
	{
	  return ( Math.floor ( Math.random ( ) * n + 1 ) );
	}

/*************************************************************************/
	
	this.checkRand = function (randInput)
	{
		for (var checkCounter = 0;checkCounter <= this.numberOfItemsForArray;checkCounter++)
		{
			if (this.randArray[checkCounter] == randInput)
			{	
				return(false);
			}
		}
		return(true);
	}
/*************************************************************************/

	this.renderImages = function ()
	{
		for (var renderCounter = 0;renderCounter <= this.numberOfItemsForArray;renderCounter++)
		{
			if(renderCounter == this.numberOfItemsForArray)
			{
				document.write(this.imagesArray[this.randArray[renderCounter]]);
			} else {
				document.write(this.imagesArray[this.randArray[renderCounter]] + this.spacer);
	
			}
		}
	}
/*************************************************************************/
	
	this.runRand = function()
	{
		randReturn	= false;
		
		for (var i=0;i<=this.numberOfItemsForArray;i++)
		{
			while (randReturn == false)
			{
				randNumber = this.newRand(this.numberOfItems);
				randReturn = this.checkRand(randNumber);			
			}
			
			this.randArray[i] = randNumber;
			randReturn = false;
			
		}
		// DEBUG document.write("RandArray: " + this.randArray + "<br />")
		// DEBUG document.write("Anzahl für Array: "+ this.numberOfItemsForArray + "<br />");
		this.renderImages();
	}
}







