function Projector(screen,speed,width,height){
	this.Screen = screen;
	this.Speed = (speed-speed==0)?speed:5;
	this.Width = (width-width==0)?width:600;
	this.Height = (height-height==0)?height:300;
	this.Timer = null;
	this.Frame = 0;
	this.Slides = new Array();
	this.Add = AddSlide;
	this.Play = ProjectSlides;
	this.ShowNextSlide = ShowNextSlide;
}

function Slide(title,image,link,width,height){
	this.Title = title;
	this.Image = image;
	this.Link = link;
	this.Width = width;
	this.Height = height;
	this.Display = DisplaySlide;
}

function DisplaySlide(){
	return "<a href=\""+this.Link+"\" title=\""+this.Title+"\"><img src=\""+this.Image+"\" style=\"border:0px;display:block;width:"+this.Width+"px;height:"+this.Height+"px;\" alt=\""+this.Title+"\"/></a>";
}

function AddSlide(title,image,link,width,height){
	if(width-width!=0){width=this.Width;}
	if(height-height!=0){height=this.Height;}
	this.Slides[this.Slides.length] = new Slide(title,image,link,width,height);
}

function ProjectSlides(){
	if(this.Screen!="",this.Slides.length > 0){
		if(!document.getElementById(this.Screen)){
			document.open();
			document.write("<div id=\""+this.Screen+"\" style=\"width:"+this.Width+"px;height:"+this.Height+"px;overflow:hidden;\"></div>");
			document.close();
		}
		this.ShowNextSlide();
		if(this.Timer == null){
			this.Timer = setInterval('p.ShowNextSlide()',this.Speed*1000);
		}

	}
}

function ShowNextSlide(){
	document.getElementById(this.Screen).innerHTML = this.Slides[this.Frame].Display();
	this.Frame++;
	if(this.Frame>=this.Slides.length){this.Frame=0;}
}