caph.app.addScene('TVShowsScene', $class({
    $extends: ListScene,
    
    getSceneOption: function() {
    	return {
    		title: 'CAPH VIDEO',
    		selectedCategory: 'TV Shows',
    		list: {
    			row: 2,
    			column: 4.095,
    			width: Style.width - Style.listLeft, 
    			height: Style.height - Style.listTop - Style.listMarginBottom,
    			x: Style.listLeft, 
    			y: Style.listTop,
    			decorateItem: function(data, index) {
    				return ListItem.getTvShow({
    	    			id: data.id,
    	    			genreId: data.genre.id,
    	        		title: data.title,
    	        		startTime: data.startTime,
    	        		thumbnailUrl: '../../' + Style.imageRootPath + data.thumbnailUrl
    	        	});
    			},
    			onnextpage: function() {
    				/* server version
    				caph.xhr(listUrl, {
                    	type: 'JSON',
                    	parameter: {
                    		id: 3,
                    		start: this.getItemCount(),
                    		offset: 4
                    	}
                    }).then(function(result) {
                    	var value = result.value;
                    	
                    	if (value.status === 'OK' && value.dataList.length > 0) {
                    		this.addItems(value.dataList);
                    	}
                    }.bind(this));	
    				*/
    			}
    		}
    	}
    },
    
    onshow: function(message) {
    	this.$super(message);
    	
    	this.bottom.on({
			keydown: function(message) {
				var source = message.source;

				if (message.key().up && source.getProperty('data-list-item-index') % 2 === 0) {
					message.stopPropagation();
					currentCategory.focus();
				}
			}
		});
    	
    	if (this.bottom.getItemCount() < 1) {
    		// local version
        	caph.xhr(listUrl[3], {
        		type: 'JSON'
        	}).then(function(result) {
        		var value = result.value;
        		
        		if (value.status === 'OK') {
        			this.bottom.addItems(value.dataList);
        			currentItem = this.bottom.getCurrentPositionItem();
        		}
        	}.bind(this));
        	
        	/* server version
        	caph.xhr(listUrl, {
            	type: 'JSON',
            	parameter: {
            		id: 3,
            		start: 0,
            		offset: 10
            	}
            }).then(function(result) {
        		var value = result.value;
        		
        		if (value.status === 'OK') {
        			this.bottom.addItems(value.dataList);
        			currentItem = this.bottom.getCurrentPositionItem();
        		}
        	}.bind(this));
        	*/
    	} else {
    		currentItem = this.bottom.getCurrentPositionItem();
    	}
    	
    	currentCategory = this.top.getChildren()[4];
    	currentCategory.focus();
    }
}));