/* Copyright 2009 Palm, Inc.  All rights reserved. */

HomeAssistant = Class.create({
	
	spinner: 'activity-spinner',
	
	spinning: false,
	
	spinnerAttrs: {
		spinnerSize: Mojo.Widget.spinnerLarge
	},
	
	initialize: function() {
		
	},
	
	setup: function() {
		this.controller.setupWidget(this.spinner, this.spinnerAttrs, {});
		this.timer = setTimeout(this.startSpinner.bind(this), 10000);
	},
	
	startSpinner: function() {	
		this.spinning = true;
		$(this.spinner).mojo.start();
		
		$('scrimDiv').show();
		Mojo.Log.info("---------------------- Spinner is set --------------------------------");
	},
		
	deactivate: function() {
		if (this.timer) {
			clearTimeout(this.timer);
		}	
		$(this.spinner).mojo.stop();
		this.spinning = false;
	}	
});
