var tempImgs = tempString.split(',');
tempImgs = tempImgs.join(',uploads/media/');
var Imgs = new Array();
Imgs = tempImgs.split(',');
$('imageslider1').src = Imgs[0];
$('imageslider2').src = Imgs[0];


Slider = new Class({
	delay: 4000,
	duration: 1000,
	images: Imgs,
	slider: function(){
		if(this.img[1].getStyle("opacity")==0) {
			this.fader.start(0,1);
		} else {
			this.fader.start(1,0);
		}
	},

	load: function() {
		this.slidepos=(this.slidepos+1)%2;
		this.arrpos=(this.arrpos+1)%this.images.length;
		this.img[this.slidepos].src=this.images[this.arrpos];

		this.slider.delay(this.delay,this);
	},

	start: function(){
		this.slidepos=0;
		this.arrpos=0;
		this.img=$$("#imageslider .images img");
		this.img[1].setStyle("opacity", "0");

		var self=this;
		this.fader = new Fx.Style(this.img[1], 'opacity', {
			duration:self.duration, 
			onComplete: function(){ self.load();}
		});

		this.load();
	}
});

window.addEvent("load", function() {
	show=new Slider();
	show.start();
});
