var gameIndex = function() {
    
	return {
	    init : function() {
	        this.rules();
	        gameIndex.reset(false);
	    },
	    
	    rules : function() {
	        Ext.get('fireIcon').on('click', gameIndex.activate);
	        Ext.get('waterIcon').on('click', gameIndex.activate);
	        
	        Ext.select('#ctBox img').on('mouseover', function(e){ 
               Ext.get(e.target).setStyle('cursor', 'pointer'); 
	        });
	        
	        Ext.select('#ctBox img').on('mouseout', function(e){ 
               Ext.get(e.target).setStyle('cursor', 'default'); 
	        });
	    },
	    
	    activate : function(e) {
	        gameIndex.reset(true);
	        
	        obj = Ext.get(e.target);
	        obj.setOpacity(1, true);
	        
	        gameIndex.fillChoiceInput(obj.dom.id);
	    },
	    
	    reset : function(anim) {
	        Ext.get('fireIcon').setOpacity(.5, anim);
	        Ext.get('waterIcon').setOpacity(.5, anim);
	    },
	    
	    fillChoiceInput : function(objId) {
	        if(objId == 'fireIcon') {
	           Ext.get('choice').dom.value = 'f';
	        }
	        if(objId == 'waterIcon') {
	           Ext.get('choice').dom.value = 'w';
	        }
	    }
	}
	
}();
