/* This function will spit out Red Hat ads for the Right Side on QMB2 */

function DisplayRSideAd() {

	/* Need to find what page we are on just in case there needs to be a certain ad to show up */
	
	varWhatIsThePage = document.location.href.split('/',4);
	
	/* document.write(varWhatIsThePage); */
	
	/* This will now trap the profile we are targeting */
		for(var x=0; x<1; x++)
			{
				NewPlace = varWhatIsThePage[3];
			}

/* This will now figure which ad goes where */
if (NewPlace == "JackpotJubilee") {
	NewAd = '<div style="width:250px; height:179px; margin:0 auto; background:url(http://www.redhatsociety.com/images/QMB2_AD/BonnevilleSideAD.jpg) center no-repeat;"><a href="http://www.redhatsociety.com/PassOff.html?utm_source=QMB2_AD_RightSide&utm_medium=Website&utm_content=BonnevilleRT01&utm_campaign=QMB2_AD&NewDirection=http://www.bonnevillethemovie.com" target="_blank" style="display:block; width:100%; height:179px;"> </a></div> ';
	
} else {	
/* This now the ads that can be placed anywhere */

	/* This is the random number generator for the ads. To change the max number of ads used... change the last number in the statement below... one number more then your ads. When the page refreashes it spit out a new number and match the ad. */
	
		var randomnumber=Math.floor(Math.random()*4);


	/* Switch statement that uses the random number generator to show the ad */
	
	switch(randomnumber)
		{
		case 1:
			NewAd = '<div style="width:250px; height:179px; margin:0 auto; background:url(http://www.redhatsociety.com/images/store/StoreSideAdQMB2_28.jpg) center no-repeat;"><a href="http://www.redhatsocietystore.com/istar.asp?a=500&utm_source=QMB2_AD_RightSide&utm_medium=Website&utm_content=RedWhiteBlue&utm_campaign=QMB2_AD" target="_blank" style="display:block; width:100%; height:179px;"> </a></div> ';  
		break;    
		case 2:
			NewAd = '<div style="width:250px; height:115px; margin:0 auto; background:url(http://www.redhatsociety.com/images/advertisements/ClassmateAd01.gif) center no-repeat;"><a href=http://www.classmates.com/?s=74799" target="_blank" style="display:block; width:100%; height:115px;"> </a></div> ';  
		break;    
		case 3:
			NewAd = '<div style="width:250px; height:115px; margin:0 auto; background:url(http://www.redhatsociety.com/images/advertisements/ClassmateAd02.gif) center no-repeat;"><a href=http://www.classmates.com/?s=74799" target="_blank" style="display:block; width:100%; height:115px;"> </a></div> ';  
		break;    
		default:
			NewAd = '<div style="width:250px; height:179px; margin:0 auto; background:url(http://www.redhatsociety.com/images/store/StoreSideAdQMB2_29.jpg) center no-repeat;"><a href=http://www.redhatsocietystore.com/istar.asp?a=500&utm_source=QMB2_AD_RightSide&utm_medium=Website&utm_content=HatsOnSale_070908&utm_campaign=QMB2_AD" target="_blank" style="display:block; width:100%; height:179px;"> </a></div> ';  
		}

}

/* This is now the new ad */
return NewAd;

}