/****** Random Flash ******
var oFlash = new RandomFlash("objId", width, height, "wmode", "menu", "loop", "play", "quality", "className", "style");
oFlash.baseHref = "/basedirectory/";
oFlash.Add ("flash1.swf");
oFlash.Add ("flash2.swf");
oFlash.Display ();
**************************/

function RandomFlash (obj_id, width, height, wmode, menu, loop, play, quality, class_name, style, base_href) {
	this.objId		= obj_id;
	this.width		= width;
	this.height		= height;
	this.wmode		= wmode;
	this.menu		= menu;
	this.loop		= loop;
	this.play		= play;
	this.quality	= quality;
	this.className	= class_name;
	this.style		= style;
	this.baseHref	= base_href;
	this.files		= new Array();
	this.Add		= AddUrl;
	this.Get		= GetFlashUrl;
	this.Display	= GetFlashUrl;
}

function AddUrl (file_url) {
	this.files[this.files.length] = file_url;
}

function GetFlashUrl () {
	var cd = new Date();
	var strUrl = this.baseHref + this.files[((cd.getSeconds()) % (this.files.length))];
	var strHTML = "<embed src=\""+ strUrl +"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"";
	if (this.objId != null) { strHTML += " id=\""+ this.objId +"\" name=\""+ this.objId +"\""; }
	if (this.width != null) { strHTML += " width=\""+ this.width +"\""; }
	if (this.height != null) { strHTML += " height=\""+ this.height +"\""; }
	if (this.wmode != null) { strHTML += " wmode=\""+ this.wmode +"\""; }
	if (this.quality != null) { strHTML += " quality=\""+ this.quality +"\""; }
	if (this.menu != null) { " menu=\""+ this.menu +"\""; }
	if (this.loop != null) { " loop=\""+ this.loop +"\""; }
	if (this.play != null) { " play=\""+ this.play +"\""; }
	if (this.className != null) { " class=\""+ this.className +"\""; }
	if (this.style != null) { " style=\""+ this.style +"\""; }
	strHTML += "></embed>";
	document.open();
	document.write(strHTML);
	document.close();
}
