dw_RandRotator.prototype = new dw_Rotator();
function dw_RandRotator(sp, pt, bClickable, bMouse, tgt) {
    this.num = dw_Rotator.col.length;
    this.name = "RandRotateImg" + this.num;
    this.mouseEvs = bMouse;
    this.clickable = bClickable;
    this.rObj = dw_Rotator;
    this.rObj(this.name, sp, pt, tgt);
};
dw_RandRotator.prototype.setUpImage = function(imgStart, imgAr, locAr, locObj, w, h, bTrans) {
	this.trans = bTrans;
	this.ctr = Math.floor(Math.random() * imgAr.length);
	this.locObj = locObj;
	var img = imgAr[this.ctr];
	var loc = locAr[this.ctr];
	var imgStr = '<img name="' + this.name + '" src="' + imgStart + '" border="0"';
	imgStr += (typeof w=="number") ? ' width="'+w+'"' : '';
	imgStr += (typeof h=="number") ? ' height="'+h+'"' : '';
	imgStr += ' alt="">';
	var locStr = '<div id="CustLocation" style="margin-top:10px;"></div>';
	var str = "";
	if(this.clickable) {
		str += '<a href="" onclick="return dw_Rotator.doClick(' + this.num + ')"';
		if(this.mouseEvs) {
			str += ' onmouseover="dw_Rotator.pause(' + this.num + ')"';
			str += ' onmouseout="dw_Rotator.resume(' + this.num + ')"';
		}
		str += ' onfocus="this.blur()">' + imgStr + '</a>';
	} else {
		str = imgStr;
	}
	document.write(str + locStr);
	document.getElementById(this.locObj).innerHTML = "";
	document.close();
	for(var i = 0; imgAr[i]; i++)
		this.addImages(imgAr[i]);
	this.locs = locAr;
};
dw_RandRotator.prototype.rotate = function() {
	clearTimeout(this.timer);
	this.timer = null;
	var ctr = Math.floor(Math.random() * this.imgs.length);
	var i = 0;
	while(ctr == this.ctr && i < 6) {
		ctr = Math.floor(Math.random() * this.imgs.length);
		i++;
	}
	this.ctr = ctr;
	var imgObj = document.images[this.name];
	if(!imgObj)
		return;
	if(this.trans && typeof imgObj.filters != "undefined") {
		imgObj.style.filter = 'blendTrans(duration=1)';
		if(imgObj.filters.blendTrans)
			imgObj.filters.blendTrans.Apply();
	}
	imgObj.src = this.imgs[this.ctr].src;
	document.getElementById(this.locObj).innerHTML = this.locs[this.ctr];
	if(this.trans && typeof imgObj.filters != "undefined" && imgObj.filters.blendTrans)
		imgObj.filters.blendTrans.Play();
	this.timer = setTimeout(this.animString + ".rotate()", this.speed);
};