SB_FeaturedBox=function(name){this.name=name;}
SB_FeaturedBox.prototype.boxes=new Array();
SB_FeaturedBox.prototype.intTimeInterval=10000;
SB_FeaturedBox.prototype.intCurrentBox=0;
SB_FeaturedBox.prototype.intPrevBox=0;
SB_FeaturedBox.prototype.timer="";
SB_FeaturedBox.prototype.next=function(){
	if(++this.intCurrentBox >= this.boxes.length) this.intCurrentBox=0;
	this.doBox(this.intCurrentBox);
}
SB_FeaturedBox.prototype.prev=function(){
	if(--this.intCurrentBox < 0) this.intCurrentBox=this.boxes.length-1;
	this.doBox(this.intCurrentBox);
}
SB_FeaturedBox.prototype.gotoBox=function(thisID){
	this.stop();
	this.intCurrentBox=thisID;
	this.doBox(thisID);
}
SB_FeaturedBox.prototype.doBox=function(id){
	document.getElementById("sb_fb_head").innerHTML = this.boxes[id].head;
	document.getElementById("sb_fb_sectionName").innerHTML = this.boxes[id].head;
	document.getElementById("sb_fb_title").innerHTML = this.boxes[id].title;
	document.getElementById("sb_fb_title").href = this.boxes[id].url;
	if(document.getElementById("sb_fb_title2")) document.getElementById("sb_fb_title2").href = this.boxes[id].url;
	document.getElementById("sb_fb_link").href = this.boxes[id].url;
	document.getElementById("sb_fb_related_1").innerHTML = this.boxes[id].relatedText1;
	document.getElementById("sb_fb_related_1").href = this.boxes[id].relatedLink1;
	document.getElementById("sb_fb_related_2").innerHTML = this.boxes[id].relatedText2;
	document.getElementById("sb_fb_related_2").href = this.boxes[id].relatedLink2;
	document.getElementById("sb_fb_img").src=this.boxes[id].imgSrc;

	document.getElementById("sb_fb_copy").innerHTML = this.boxes[id].author + "<br />" + this.boxes[id].copy;
	document.getElementById("sb_featuredbox").className = this.boxes[id].background;
	document.getElementById("sb_fb_nav_"+id).src="/images/framework/nav_on.gif";
	document.getElementById("sb_fb_nav_"+this.intPrevBox).src="/images/framework/nav_off.gif";
	this.intPrevBox=this.intCurrentBox;
}
SB_FeaturedBox.prototype.start=function(){ 
	this.timer=window.setInterval(this.name+".next()", this.intTimeInterval);
}
SB_FeaturedBox.prototype.stop=function(){ window.clearInterval(this.timer); }
SB_FeaturedBox.prototype.startSlide=function() { 
	this.start();
	document.getElementById("sb_fb_control").innerHTML="<a href='javascript:"+this.name+".stopSlide();'>Stop Slideshow</a>";
}
SB_FeaturedBox.prototype.stopSlide=function() { 
	this.stop();
	document.getElementById("sb_fb_control").innerHTML="<a href='javascript:"+this.name+".startSlide();'>Start Slideshow</a>";
}