// ------[ Generic Popup Image Function ]------------------------------------------------- //
// ------[ Set Image URL ]---------------------------------- //	
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');");
}

// ------[ Race Sled PopUp ]------------------------------------------------- //	
// ------[ Picture Browser ]---------------------------------- //	
BRP.Home = {
	Slides : [],
	image : null,
	content : null,
	next : null,
	previous : null,
	nav : null,
	current : 0,
	
	Init : function() {
		this.image = document.getElementById('SlideImage');	
		this.next = document.getElementById('slide-next');	
		this.previous = document.getElementById('slide-previous');	
		this.content = document.getElementById('slide-content');	
		this.nav = document.getElementById('slide-nav');
		
		if(this.Slides.length > 1) {
			YAHOO.util.Dom.setStyle(this.nav, 'display', 'block');			
			}
		
		YAHOO.util.Event.addListener(this.next, "click", function() {
				BRP.Home.Show(BRP.Home.current+1);
			}, this, true);		
			
		YAHOO.util.Event.addListener(this.previous, "click", function() {
				BRP.Home.Show(BRP.Home.current-1);
			}, this, true);					
	},
	
	Show : function(n) {
		if(n < 0) n = BRP.Home.Slides.length-1;
		if(n > BRP.Home.Slides.length-1) n = 0;

		this.current = n;
		this.content.innerHTML = BRP.Home.Slides[n].content;
		setTimeout("BRP.Home.image.src = BRP.Home.Slides["+n+"].imageUrl",50);
		}
};