Type.registerNamespace("Awc.WestOnline.UI");

Awc.WestOnline.UI.IndicesImageController = function (graphImageId) {

    this._graphImage = $get(graphImageId);
    this._indicesImages = new Array();
    this._indicesImages['S&P/ASX 200'] = 'feeds/indices/ASX200.jpg';
    this._indicesImages['S&P/ASX 200 Energy'] = 'feeds/indices/ASX200Energy.jpg';
    this._indicesImages['S&P/ASX 200 Industrials'] = 'feeds/indices/ASX200Indust.jpg';
    this._indicesImages['ALL ORDINARIES'] = 'feeds/indices/ASXAllOrds.jpg';
    this._prevChart = 'INDICES_POS_1';
    $get(this._prevChart).className = 'plain-link';
}

Awc.WestOnline.UI.IndicesImageController.prototype = {
    SwitchChart : function(indice, updateKey, pos)
    {
        if (this._graphImage && this._indicesImages[indice])
            this._graphImage.src = this._indicesImages[indice] + '?=' + updateKey;
        
        $get(this._prevChart).className = '';
        
        var current = 'INDICES_POS_' + pos;
        
	    var selected = $get(current);
	    selected.className = 'plain-link';
	    selected.blur();
	    
	    this._prevChart = current;
    }
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();