//  @import com.hedgehoglab.application.view.BaseView;

function SelectPane(options){
    BaseView.call(this,options);
    var _this=this;
    
    var _panes=$(options.pane,options.element).hide().removeClass('hide').get();
    var _current_pane=0;

    $(options.select,options.element).bind('change',function(event){
        if(_current_pane!=null)
            $("div[rel='"+_current_pane+"']",options.element).hide();

        $("div[rel='"+$(this).val()+"']",options.element).show();

        _current_pane=$(this).val();
    });

    $(options.select,options.element).trigger('change',{});

    //  Do submission of form
    $('.import-submission-button',options.element).bind('click',function(event){
        _this.raise_event('form_submission',{form:$('form',$("div[rel='"+_current_pane+"']",options.element))});
        return false;
    });
};

