var Splash = new Class({
	current : 1,
	rotator : null,
	bookButton: null,
	authorButton: null,
	videoButton: null,
	authorName: null,
	otherBooks: null,
	otherBookTitle: null,
	initialize: function(){
		this.rotator = $('rotator');
		this.rotator.setStyles({
			'background-image':'url('+SplashData[0].background+')',
			'background-repeat':'no-repeat',
			'background-position':'top left'
		});
		
		this.otherBookTitle = this.rotator.getElement('div.otherBooks');
		
		this.bookButton = $('BTN_bookDetails');
		this.bookButton.set('href','/owProductDetail.asp?idproduct='+SplashData[0].bookId+'&idCategory=');
		
		this.authorButton = $('BTN_authorDetails');
		this.authorButton.set('href','/owListProduct.asp?idCategory='+SplashData[0].authorId);
		
		this.videoButton = $('BTN_bookVideo');
		if(SplashData[0].hasVideo){
			this.videoButton.removeClass('hdn');
			this.videoButton.set('href','/video?idproduct='+SplashData[0].bookId);
		}
		
		this.authorName = $('authorName');
		this.authorName.set('text',SplashData[0].authorName);
		
		if(SplashData[0].alsoAvailable){
			this.authorName.set('text','Books Also Available');
			this.rotator.getFirst('div.otherBooks').set('text',' ');
		}
		
		this.otherBooks = $('otherBooks');
		
		if(SplashData[0].otherBooks.length != 0){
			SplashData[0].otherBooks.each(function(item,idx){
				var img = new Element('img',{
					src: item[1],
					width: 100,
					height: 150
				});
				var a = new Element('a',{
					'href':'/owProductDetail.asp?idproduct='+item[0]+'&idCategory='
				}).grab(img);
				if(idx == 0){
					a.setStyle('margin-right',5);
				}
				this.otherBooks.grab(a);
			},this);
		}else{
			this.otherBookTitle.addClass('hdn');
			this.authorName.addClass('hdn');
			this.otherBooks.addClass('hdn');
		}
	}
	
	
});