function rightAds(count, smallCount) 
{


var smallAdsCount = smallCount;
// # of ads available
var ceiling = 9;
var ceilingAdsSmall = 11;
if(count>ceiling)
{
	count = ceiling;
}
// subtract one because arrays begin at 0
//count--;
var ads = new Array();  //array of large ads.
var adsSmall = new Array(); //array of small ads.
var rand;

//links are a list of links that are associated with the images.  
//the first one is null to make sure the rand doesn't roll null
var links = ['',
			 '/Products?search=switcheasy+iphone+3g+rebel&ad=right',
			 '/Products?search=moleskine&ad=right',
			 '/Products?search=belkin&ad=right',
			 '/Products/Apple-iPod-iPhone-Accessories-Gear-iPhone-3G?ad=right',
			 '/Products/Laptop-Computer-Accessories-Gear-Apple-Macbook?ad=right',
			 '/Products/Video-Games-Accessories-Gear-Nintendo-Wii?ad=right',
			 '/Products/OtterBox-Commuter-TL-Hybrid-Case-for-iPhone-3G-and-3GS-Black',
			 '/Products/Incipio-EDGE-Slider-Crystal-Case-for-iPod-Nano-5G-Smoke',
			 'http://www.mygearstore.com/Products?search=iskin&ad=right'];
	
var	smallAdLinks = ['',
					'http://www.mygearstore.com/Products?search=belkin+sport', 
					'http://www.mygearstore.com/Products?search=ipod+nano+cube', 
					'http://www.mygearstore.com/Products?search=moleskine', 
					'http://www.mygearstore.com/Products/Incipio-Edge-Slider-Crystal-Case-for-iPod-Nano-4G-Smoke', 
					'http://www.mygearstore.com/Products?search=iSkin', 
					'http://www.mygearstore.com/Products?search=tech21',
					'http://www.mygearstore.com/Products?search=SwitchEasy',
					'http://www.mygearstore.com/Products?search=universol',
					'http://www.mygearstore.com/Products?search=trexta',
					'http://www.mygearstore.com/Products?search=lenntek'
					];
  
//populates the array with integers corresponding with the ads
for(i = 0; i < ceiling; i++)
{
	ads[i] = i+1; //populates the array with numbers 1 through whatever the ceiling is.
}

for(i = 0; i < ceilingAdsSmall; i++)
{
	adsSmall[i] = i+1;
}
for(i = 0; i < smallAdsCount; i++)
{
	rand = Math.ceil(Math.random()*ceilingAdsSmall);
	while(adsSmall[rand] == null)
	{
		rand = Math.ceil(Math.random()*ceilingAdsSmall);
	}
	document.write('<a href="' + smallAdLinks[rand] + '"><img src="http://img.mygearstore.com/images/siteimages/mgsadsmall' + rand + '.jpg" style="margin: 5px 0;" /></a>');
	adsSmall[rand] = null;
	
}
//count is a parameter entered in the html.

//this is for the large ads.  currently disabled.
/*
for(i = 0; i < count; i++)
{
	//generates a random number.
	rand = Math.ceil(Math.random()*ceiling);
	while(ads[rand] == null)
	{
		rand = Math.ceil(Math.random()*ceiling);
		//if the value of the randomly generated index is null, this will cause it to re-roll until it hits a valid value.
	}
	//when it gets a valid value, it prints the image + link.
	document.write('<a href="' + links[rand] + '"><img src="http://img.mygearstore.com/images/siteimages/mgsad' + rand + '.jpg" style="margin: 5px 0;" /></a>');
	ads[rand] = null; //sets the value to null so the image isn't repeated.
}
*/


} 






//for the picture near the top middle of the page.
function lifestyleImage() 
{
  var num = Math.ceil(Math.random()*16);
  document.write('<img src="http://img.mygearstore.com/images/l' + num + '.jpg"/>');
}