function rotator(container,interval) {
//alert("rotator in 1 ");
this.container=container;
//this.contents=container.getElementsByTagName("div");
this.contents=container.getElementsByTagName("a");
this.total_indexes=this.contents.length;
this.current_index=this.total_indexes-1;
this.interval=interval;
this.rotate();
}

function test() {
alert("test ok");
}
rotator.prototype.test=test;

function next_index() {
this.current_index++;
this.current_index=this.current_index%this.total_indexes;
}
rotator.prototype.next_index=next_index;

function rotate() {
//alert("rotate total_indexes=/"+this.total_indexes+"/");
var obj=this.contents[this.current_index];
obj.style.visibility="hidden";
obj.style.display="none";
this.next_index();
obj=this.contents[this.current_index];
obj.style.visibility="visible";
obj.style.display="inline";
var obj = this;
window.setTimeout(function () { obj.rotate(); }, this.interval);
}
rotator.prototype.rotate=rotate;
