
VIEWS.Error = {
        
    returnView: null,

    init: function(args) {
        AMOSTV.showView('Error');
                
        var messages = {
            ajax: 'A network error occured when trying to fetch data.<br/><br/> Please try again by restarting the application.',
            video: 'A network error occured when trying to play a video.<br/><br/> Please try again by restarting the application',
            timelimit: 'It appears you have reached your playtime limit on the current playlist.<br/><br/>Press Enter/Ok to return home.',
			playlist: 'The playlist has ended.<br/><br/>Press Enter/Ok to return home.'
        };
        DOUT('erororororeoroer: ' + args.type)
        putText('errorMessage', messages[args.type]);
        AMOSTV.stopLoading();
		
		_gaq.push(['_trackPageview', '/amosgtv/error/'+messages[args.type]]);
    },
    
    exit: function() {
    },
    
    keyHandler: function(key) {
        if ( key == KEYS.BACK ) {
            AMOSTV.loadView('Menu');
        }
        if ( key == KEYS.OK ) {
            AMOSTV.loadView('Menu');
        }
		
		if ( key == KEYS.ESC ) {
            AMOSTV.loadView('Menu');
		}
    }
};

