function swapImages(strThisObjName){
	this.knownAs=strThisObjName;
	this.iWaitMillis=4000;
	this.swapImages=Array();
	this.swapTitles=Array();
	this.swapLinks=Array();
	this.imageID="";
	this.titleID="";
	this.LinkID="";
	this.prevImage=-1;
	this.currImage=0;
	this.showFilter=(parseFloat(navigator.appVersion.split("MSIE")[1])>=5.5)?1:0;
}

swapImages.prototype.addImage=function(strURL,strTitle,strLink){
	if(document.images){
		var temp=new Image()
		temp.src=strURL;
	}
	this.swapImages[this.swapImages.length]=strURL;
	this.swapTitles[this.swapTitles.length]=strTitle;
	this.swapLinks[this.swapLinks.length]=strLink?strLink:'#';
}



swapImages.prototype.transImage=function(oImg) {
	oImg.filters(0).Apply();
    oImg.style.visibility = "visible";
    oImg.filters(0).Play();
}

swapImages.prototype.switchImage=function() {
	this.prevImage=this.currImage;
	this.currImage++;
	newImage = this.swapImages[this.currImage];
	if (this.showFilter == 1) {
		this.transImage(document.getElementById(this.imageID));
		document.getElementById(this.imageID).src = newImage;
	}else{
		this.swapImage(this.imageID,'',newImage);
	}if(document.getElementById(this.linkID))
		if(this.swapLinks[this.currImage])
			document.getElementById(this.linkID).href = this.swapLinks[this.currImage];
		else{
			if(document.getElementById(this.linkID))
				document.getElementById(this.linkID).href = '#';
		}
	if(document.getElementById(this.titleID))
		if(this.swapTitles[this.currImage])
			document.getElementById(this.titleID).innerHTML = this.swapTitles[this.currImage];
		else
			document.getElementById(this.titleID).innerHTML = '&nbsp;';
		
}

swapImages.prototype.swapImage=function() { 
	var i,j=0,x,a=this.swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

swapImages.prototype.swap=function() {
	if(this.currImage==this.swapImages.length-1) this.currImage=-1;
	this.switchImage();
}

swapImages.prototype.getRealLeft=function(obj) {
    xPos = obj.offsetLeft;
    tempEl = obj.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

swapImages.prototype.getRealTop=function(obj) {
    yPos = obj.offsetTop;
    tempEl = obj.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}
