var Onglets =
{
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    preLoadingInit: function() {
        this.bind_postLoadingInit = this.postLoadingInit.bindAsEventListener(this);
        document.observe("dom:loaded", this.bind_postLoadingInit);
    },
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    postLoadingInit: function() {
        document.stopObserving("dom:loaded", this.bind_postLoadingInit);

        this.initOnglet($('lien_fonctions'), $('fonctions'));
        this.initOnglet($('lien_entreprises'), $('entreprises'));
        this.initOnglet($('lien_villes'), $('villes'));
        this.initOnglet($('lien_metiers'), $('metiers'));
        this.initOnglet($('lien_secteurs'), $('secteurs'));
    },
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    initOnglet: function(ong, bloc) {
        ong.href = "javascript:;";
        ong.observe('click', function() { Onglets.activeOnglet(ong, bloc); });
    },
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    resetOnglet: function() {
        //$$('#offres .onglet').each(function(s) { s.removeClassName('on'); });
        //$$('#offres .panel').each(function(o) { o.addClassName('off'); });
		
		jQuery('#offres .onglet').each(function() { jQuery(this).removeClass('on'); });
        jQuery('#offres .panel').each(function() {  jQuery(this).addClass('off'); });
		

		
		
    },
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    activeOnglet: function(a, o) {
        Onglets.resetOnglet();
        a.addClassName('on');
        o.removeClassName('off');
        //$('InOnglet').value = o.id; 
    },
    //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    nop: null
};
Onglets.preLoadingInit();

