var ttw=["progid:DXImageTransform.Microsoft.GradientWipe()"]
function thismike(setttw){
	this.ttwid=setttw.ttwid
	this.ttwarray=setttw.ttwarray
	this.pause=setttw.pause
	this.transitionhold=setttw.transitionhold/1000 
	this.currentimg=0
	var preloadimages=[]
	for (var i=0; i<this.ttwarray.length; i++){
		preloadimages[i]=new Image()
		preloadimages[i].src=this.ttwarray[i][0]
	}
	document.write('<div id="'+this.ttwid+'" class="'+setttw.wrapperclass+'">'+this.getSlideHTML(this.currentimg)+'</div>')
	var ttweffect=Math.floor(Math.random()*ttw.length) 
	var ttwdiv=document.getElementById(this.ttwid)
	if (ttwdiv.filters){
		ttwdiv.style.filter=ttw[ttweffect]
		this.pause+=setttw.transitionhold
	}
	this.filtersupport=(ttwdiv.filters && ttwdiv.filters.length>0)? true : false 
	var ttwshow=this
	setInterval(function(){ttwshow.rotate()}, this.pause)
}
thismike.prototype.getSlideHTML=function(index){
	var slideHTML=(this.ttwarray[index][1])? '<a href="'+this.ttwarray[index][1]+'" target="'+this.ttwarray[index][1]+'">\n' : '' //hyperlink slide?
	slideHTML+='<img src="'+this.ttwarray[index][0]+'" />'
	slideHTML+=(this.ttwarray[index][1])? '</a>' :  ''
	return slideHTML
}
thismike.prototype.rotate=function(){
	var ttwdiv=document.getElementById(this.ttwid)
	this.currentimg=(this.currentimg<this.ttwarray.length-1)? this.currentimg+1 : 0
	if (this.filtersupport)
		ttwdiv.filters[0].apply()
	ttwdiv.innerHTML=this.getSlideHTML(this.currentimg)
	if (this.filtersupport)
		ttwdiv.filters[0].play(this.transitionhold)	
}