var whichBan = new Array();//Create an array to store the names of the ads
whichBan[0]="header1.swf";//You can change these to whatever the filename is and add as many as you like
whichBan[1]="header2.swf";
whichBan[2]="header3.swf";
whichBan[3]="header4.swf";
whichBan[4]="header5.swf";

whichNum = Math.floor(Math.random()*whichBan.length);

//test number////////////////////////////////////////
//you'll want to comment this out with "//" before using. It is set up for me test which banner is running.
//document.write(whichBan[whichNum]);


//this next part embeds the swf into your page. In order for this to work you add:
//<script src="random.js"/>
//Put that into the <div> or <td> that you want your swf to show up
function embedSwf(){
	document.write('<object id="id_object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="510" height="109">')
    	document.write("<param name='movie' value='" + whichBan[whichNum] + "'/>")//Change the first part to the dirctory of your swf
    	document.write('<param name="quality" value="high" />')
    	document.write('<param name="quality" value="high" />')
		document.write('<param name="scale" value="noscale" />')
		document.write('<param name="salign" value="t" />')
		document.write('<param name="wmode" value="transparent" />')
		document.write('<param name="allowScriptAccess" value="always" />')
    	document.write("<embed src='" + whichBan[whichNum]+"' allowScriptAccess='always' name='id_embed' quality='high' scale='noscale' salign='t' allowScriptAccess='always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='510' height='109' wmode='transparent'></embed>")
 	 document.write('</object>')
}

embedSwf();

