function Changeimg() {

this.create = function(elementId) {
	this.id = document.getElementById(elementId);
	this.list = document.getElementById('imgList');
	if(!this.id || !this.list) return false;
	this.span = this.list.getElementsByTagName('span');
    this.p = this.list.getElementsByTagName('p');
	this.length = this.span.length;
	this.$href = /href=(\"|\')[^\'\"\>\s]*/;
    this.$src = /src=(\"|\')[^\'\"\>\s]*/;
	this.data = {href:[],src:[],text:[]};
	this.numA = '';
    for(var i=0; i<this.length; i++) {
        var temphref = this.span[i].innerHTML.match(this.$href);
	    var tempsrc = this.span[i].innerHTML.match(this.$src);
		var temp_i = i + 1;
        this.data.href[i] = temphref[0].substr(6,temphref[0].length-6);
	    this.data.src[i] = tempsrc[0].substr(5,tempsrc[0].length-5);
		this.data.text[i] = (this.p.length == 0)?'':this.p[i].innerHTML;
        this.numA += '<a href="#" class="styleA" onclick="Imgs.change_img('+ i +'); return false;">'+ temp_i +'</a>';
    }
    this.tempA = '<div id="divA">'+ this.numA + '</div>';
	this.tempT = '<div id="divT"></div>';
	this.tempD = '<div id="divBox"><a id="#href" href="" target="_blank"><img id="divImg" src="'+this.data.src[0]+'" /></a></div>';
    this.id.innerHTML = this.tempD + this.tempA + this.tempT;
	this.aList = document.getElementById('divA').getElementsByTagName('a');
    this.tText = document.getElementById('divT');
    this.Href = document.getElementById('#href');
    this.Src = document.getElementById('divImg');
	this.play();
}

this.flag = 0;
this.play = function() {
    if(navigator.appName.indexOf("Explorer") != -1) {
        this.Src.filters[0].Apply();
	    this.Src.filters[0].Play(duration=2);
	}
	this.Href.setAttribute('href',this.data.href[this.flag]);
    this.Src.setAttribute('src',this.data.src[this.flag]);
	this.tText.innerHTML = this.data.text[this.flag];
	for(var i=0; i<this.length; i++){this.aList[i].className = 'styleA';}
	this.aList[this.flag].className = 'styleB';
	this.flag += 1;
	if(this.flag >= this.length) {this.flag = 0}
	this.timer = setTimeout('Imgs.play()',4000);
}

this.change_img = function(i) {
	clearInterval(this.timer);
	this.flag = i;
    this.play();
}

} //end
var Imgs = new Changeimg();