try{
    var LA_BUZZ_VERSION = 0.17;
    if(!(jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6)){
        var thebuzz_path  = 'http://www.premiere.fr/';
        var thebuzz_css_path = thebuzz_path + 'extension/lajavascript/design/standard/javascript/jquery/buzz/stylesheets/';
        var thebuzz_data_path = thebuzz_path + 'var/premiere/storage/buzz/';

      
        jQuery('head').append('<link rel="stylesheet" type="text/css" href="' + thebuzz_css_path + 'buzz.css?v=' + LA_BUZZ_VERSION + '" />');

        //http://james.padolsey.com/javascript/jquery-delay-plugin/
        jQuery.fn.delay=function(time, callback){
            jQuery.fx.step.delay = function(){};
            return this.animate({
                delay:1
            }, time, callback);
        };
		
        (function($){
            $.la = $.la||{};
            $.extend(true, $.la,
            {
                cleanUpFlash:function(){
                    try{
                        $('object[cleanup!=true]').each(function(){
                            var opaque=true;
                            $('param[name=wmode]',$(this)).each(function(){
                                if($(this).attr('value') == 'transparent' || $(this).attr('value') == 'opaque'){
                                    opaque = false;
                                }
                            });
                            if(opaque){
                                var clone = $(this).clone();
                                clone.append('<param name="wmode" value="transparent" />');
                                clone.attr('cleanup','true');
                                $('embed',clone).attr('wmode','transparent');
                                $(this).replaceWith(clone);
                            }
                        });
                    }
                    catch(e){}
                    try{
                        $('embed[cleanup!=true]').each(function(){
                            if($(this).attr('wmode') != 'transparent' && $(this).attr('wmode') != 'opaque'){
                                var clone = $(this).clone();
                                clone.attr('wmode','transparent');
                                clone.attr('cleanup','true');
                                $(this).replaceWith(clone);
                            }
                        });
                    }
                    catch(e){}
                },

                buzz: {
                    /* private vars */
                    _dataLoaded : false,
                    _aItems: [],
                    _urlButton:null,
                    _urlData:null,
                    _cache:1,
                    _nbMaxPulse:3,
                    _speedPulse:300,
                    _nbViewShowBeforeRePulse:7,
                    _domain:document.location.hostname,
                    _currentDomain:null,
                    _tracked:{
                        'news' : false,
                        'pratique':false
                    },
                    _test:false,
                    _charset:'utf-8',
                    _tracking:{
                        'elle':	{
                            news:			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=332035&C=12678&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=332037&C=12678&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=333908&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=333910&f=10&h=R&rnd='
                        },
                        'premiere':	{
                            news: 			'http://premiere.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=287414&A=1&L=332047&C=12679&P=23229&T=S&URL=',
                            pratique:		'http://premiere.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=287414&A=1&L=332048&C=12679&P=23229&T=S&URL=',
                            news_img:		'http://premiere.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=335531&f=10&h=R&rnd=',
                            pratique_img:	'http://premiere.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=335530&f=10&h=R&rnd='
                        },
                        'infobebes': {
                            news: 			'http://infobebes.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298364&A=1&L=332058&C=12680&P=23230&T=S&URL=',
                            pratique:		'http://infobebes.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298364&A=1&L=332059&C=12680&P=23230&T=S&URL=',
                            news_img:		'http://infobebes.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=335533&f=10&h=R&rnd=',
                            pratique_img:	'http://infobebes.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=335534&f=10&h=R&rnd='
                        },
                        'ados': {
                            news: 			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=344659&C=13259&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=344660&C=13259&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=344661&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=344664&f=10&h=R&rnd='
                        },
                        'doctissimo': {
                            news: 			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345273&C=13290&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345274&C=13290&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345275&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345276&f=10&h=R&rnd='
                        },
                        'lejdd': {
                            news: 			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345282&C=13291&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345283&C=13291&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345285&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345286&f=10&h=R&rnd='
                        },
                        'parismatch': {
                            news: 			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345289&C=13292&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345290&C=13292&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345293&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345294&f=10&h=R&rnd='
                        },
                        'europe1': {
                            news: 			'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345296&C=13293&P=23228&T=S&URL=',
                            pratique:		'http://elle.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=298360&A=1&L=345297&C=13293&P=23228&T=S&URL=',
                            news_img:		'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345300&f=10&h=R&rnd=',
                            pratique_img:	'http://elle.solution.weborama.fr/fcgi-bin/adserv.fcgi?tag=345301&f=10&h=R&rnd='
                        }
                    },
                    _title:"Service d'actualit&eacute;s du groupe Lagard&egrave;re",
                    _nota:'*UN SERVICE DU GROUPE LAGARD&Egrave;RE',
                    /* init */
                    run: function () {                       
                        if(this._test){
                            thebuzz_path  = '';
                            thebuzz_css_path = thebuzz_path + 'stylesheets/';
                            thebuzz_data_path = thebuzz_path + 'datatest/';
                        }
						
                        if(typeof $.la.promo == 'undefined' || typeof $.la.promo.skinLoaded == 'undefined' || !$.la.promo.skinLoaded){
                            $.la.cleanUpFlash();
                            var domain = document.location.hostname;
                            var aSplit = domain.split('.');
                            this._domain = '.' + aSplit[aSplit.length-2] + '.' + aSplit[aSplit.length-1];
                            switch(this._domain){
                                case '.elle.fr':
                                    this._currentDomain = 'elle';
                                    break;
                                case '.premiere.fr':
                                    this._currentDomain = 'premiere';
                                    break;
                                case '.infobebes.com':
                                    this._currentDomain = 'infobebes';
                                    break;
                                case '.ados.fr':
                                    this._currentDomain = 'ados';
                                    break;
                                case '.doctissimo.fr':
                                    this._currentDomain = 'doctissimo';
                                    this._charset = 'ISO';
                                    break;
                                case '.lejdd.fr':
                                    this._currentDomain = 'lejdd';
                                    break;
                                case '.parismatch.com':
                                    this._currentDomain = 'parismatch';
                                    break;
                                case '.europe1.fr':
                                    this._currentDomain = 'europe1';
                                    break;
                                default:
                                    this._currentDomain = 'premiere';
                                	this._charset = 'ISO';
                                    break;
                            }

                            var d = new Date();
                            var tmp = parseInt(d.getTime()/(1000*60*this._cache));
                            var charset = '';
                            if(this._charset != 'utf-8'){
                            	charset = this._charset;
                            }
                            this._urlButton = thebuzz_data_path  + 'buzz-button' + charset + '.js?v=' + tmp;
                            this._urlData =   thebuzz_data_path  + 'buzz' + charset + '.js?v=' + tmp;
                            $(document).ready(function(){
                                $('head').append('<script type="text/javascript" src="'+$.la.buzz._urlButton+'"></script>'); 
                            });
                        }
                    },

                    _setNumberItems:function(n){
                        if (n)
                        {
                            $('#buzzNewContent').html(n).show();
                            this._canPulse();
                        }
                        else{
                            $('#buzzNewContent').html(n).hide();
                        }
                    },

                    _open: function(){
                        if(!this._dataLoaded){
                            $('head').append('<script type="text/javascript" src="'+this._urlData +'"></script>');
                        }
                        else{
                            this._showData();
                        }
                    },

                    _showButton:function(){
                        this._resize();
                        $('#buzz .buzz_bt').css({
                            display:'block'
                        });
                        this._setTitleButton();
                        
                    },
                    _hideButton:function(){
                        $('#buzz .buzz_bt').css({
                            display:'none'
                        });
                    },

                    _showData: function(){
                        this._hideButton();
                        this._resize();
                        this.cookie.set('_canPulse', 0, false, this._domain);
                        $('#buzz').animate({
                            left:'0'
                        },500,function(){
                            $('#buzz').addClass('buzz_active');
                        });
                        
                    },

                    _hideData:function(){
                        $('#buzzNewContent').html(0).hide();
                        $('#buzz').animate({
                            left:'-420px'
                        },500,function(){
                            $('#buzz').removeClass('buzz_active');
                            $.la.buzz._showButton();
                        });
                    },

                    _showPratique:function(){
                        $('#buzz .buzz_bloc_top').attr('class','buzz_bloc_top buzz_bloc_top_pratique');
                        $('#buzz .buzz_bloc_cnt .buzz_bloc_news').css({
                            display:'none'
                        });
                        $('#buzz .buzz_bloc_cnt .buzz_bloc_pratique').css({
                            display:'block'
                        });
                        // click command pratique
                        this._trackOnOpen('pratique');
                    },
                    
                    _canPulse:function(){
                        var nbView = parseInt($.la.buzz.cookie.get('_canPulse'));
                        if(!nbView || nbView >= this._nbViewShowBeforeRePulse){
                            nbView = 0;
                        }
                        if(nbView == 0){
                            this._pulse();
                        }
                        $.la.buzz.cookie.set('_canPulse', nbView+1, false, this._domain);
                    },
                    

                    _pulse:function(n){
                        var nbPulse;
                        if(typeof n == 'undefined'){
                            nbPulse = 0;
                        }
                        else{
                            nbPulse = parseInt(n);
                        }
                        if(n >= this._nbMaxPulse){
                            return false;
                        }
                    	
                        $('#buzzNewContent').delay(this._speedPulse,function(){
                            $(this).css({
                                display:'none'
                            });
                        }).delay(this._speedPulse,function(){
                            $(this).css({
                                display:'block'
                            });
                            $.la.buzz._pulse(nbPulse+1);
                        });
                    	
                    	       
                    },

                    _trackOnOpen:function(tab){
                        var im;
                        switch(tab){
                            case 'news':
                                if(!this._tracked.news){
                                    im = new Image(1,1);
                                    im.src = this._tracking[$.la.buzz._currentDomain].news_img  + Math.random();
                                    this._tracked.news = true;
                                }
                                break;
                            case 'pratique' :
                                if(!this._tracked.pratique){
                                    im = new Image(1,1);
                                    im.src = this._tracking[$.la.buzz._currentDomain].pratique_img + Math.random();
                                    this._tracked.pratique = true;
                                }
                                break;
                        }
                    },

                    _showNews:function(){
                        $('#buzz .buzz_bloc_top').attr('class','buzz_bloc_top buzz_bloc_top_news');
                        $('#buzz .buzz_bloc_cnt .buzz_bloc_news').css({
                            display:'block'
                        });
                        $('#buzz .buzz_bloc_cnt .buzz_bloc_pratique').css({
                            display:'none'
                        });
                    },

                    _setTitleButton:function(){
                   	 // Title du bouton buzz
                       $('#buzz .buzz_bt').attr('title',$('<code>'+this._title+'</code>').html());
                   },

                    buzz_data:function(data){
                        this._dataLoaded = true;
                        $.la.buzz.cookie.set('cCookie_references', this._aItems,false,this._domain);
                        $('#buzz').html(data.data);
                        // tracking;
                        if(typeof this._currentDomain == 'string'){
                            $('.buzz_bloc_cnt .buzz_bloc_news a:not([href*=solution.weborama.fr])').each(function(){
                                $(this).attr('href', $.la.buzz._tracking[$.la.buzz._currentDomain].news + escape($(this).attr('href')));
                            });
                            $('.buzz_bloc_cnt .buzz_bloc_pratique a:not([href*=solution.weborama.fr])').each(function(){
                                $(this).attr('href', $.la.buzz._tracking[$.la.buzz._currentDomain].pratique + escape($(this).attr('href')));
                            });
                        }
                        //CLICK DU BOUTON FERMER
                        $('#buzz .buzz_bt_close').bind('click',function(){
                            $.la.buzz._hideData();
                        });

                        // nota
                        $('#buzz .buzz_cnt .buzz_bloc').append('<div class="nota">'+this._nota+'</div>');
                        $('body').append('<div id="toto">&acute;</div>');
                        
                       
                        
                        // bind du bouton
                        $('#buzz .buzz_bt').bind('click',function(){
                            $.la.buzz._open();
                        });
                            
                        $('#buzz .buzz_bloc_top ul li').bind('click',function(){
                            if ($('#buzz .buzz_bloc_top').hasClass('buzz_bloc_top_news')) {
                                $.la.buzz._showPratique();
                            }else{
                                $.la.buzz._showNews();
                            }
                        });
                        this._showTabs();
                        this._showData();
                    },

                    buzz_button:function(data){
                        //gestion des items lus
                        var sReadItems = $.la.buzz.cookie.get('cCookie_references');
                        var iCountItems, i, n;
                        var d = $(data.data);
                        // Events
                        /*$(window).unload(function(){
                            $.la.buzz._saveStateBuzz();
                        });*/

                        // redimensionnement buzz ouvert au resize de la page
                        $(window).bind('resize', function() {
                            $('#buzz, #buzz .buzz_cnt').height($(window).height());
                            $('#buzz .buzz_bloc_cnt').height($(window).height()-230);
                            return false;
                        });

                        $("[name=reference]", d).each(
                            function() {
                                $.la.buzz._aItems.push($(this).val());
                            }
                            );
                        $('body').append('<div id="buzz"></div>');
                        $('#buzz').html(data.data);
                        
                        
                         // bind du bouton 1ere fois
                        $('#buzz .buzz_bt').bind('click',function(){
                            $.la.buzz._open();
                        });

                        this._resize();

                        // items déjà lus
                        iCountItems = this._aItems.length;
                        if (sReadItems == false)
                        {
                            n =this._aItems.length;
                        }
                        else
                        {
                            for(i=0; i<this._aItems.length;i++) {
                                if (sReadItems.indexOf(this._aItems[i]) >= 0) {
                                    iCountItems--;
                                }
                            }
                            n = iCountItems;
                        }
                        this._setNumberItems(n);
                        //fin gestion des items lus
                        this._showButton();

                    },

                    _saveStateBuzz: function() {

                        if ($('#buzz').hasClass('buzz_active')) {
                            my_etatbuzz=1;
                        }else{
                            my_etatbuzz=0;
                        }

                        if ($('#buzz .buzz_bloc_top').hasClass('buzz_bloc_top_news')) {
                            my_ongletbuzz=1;
                        }else{
                            my_ongletbuzz=0;
                        }

                        my_buzz=my_etatbuzz+'|'+my_ongletbuzz;
                        $.la.buzz.cookie.set('my_buzz', my_buzz, 3600*24*7,this._domain);
                        return false;
                    },

                    _showTabs: function(){
                        
                        $('#buzz .buzz_bloc_top').addClass('buzz_bloc_top_news');
                        $('#buzz .buzz_bloc_cnt .buzz_bloc_news').css({
                            display:'block'
                        });
                        this._trackOnOpen('news');
                    },

                    _resize:function(){
                        $('#buzz, #buzz .buzz_cnt').height($(window).height());
                        $('#buzz .buzz_bloc_cnt').height($(window).height()-230);
                    },



                    /* COOKIES */
                    cookie:{
                        init: function(){
                            var pathname=location.pathname;
                            var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
                            var date_exp = new Date();
                            var adserver_test=true;
                            date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));
                            var qs = new $.la.utils.querystring();
                            var id_lien=qs.get('id_op');
                            if (id_lien !== null){
                                $.la.buzz.cookie.set('id_lien', id_lien,false,this._domain);
                            }
                            var regImage=qs.get('img');
                            if (regImage !== null){
                                $.la.buzz.cookie.set('regImage', regImage,false,this._domain);
                            }
                        },

                        getVal: function(offset)
                        {
                            var endstr=document.cookie.indexOf (";", offset);
                            if (endstr==-1){
                                endstr=document.cookie.length;
                            }
                            return unescape(document.cookie.substring(offset, endstr));
                        },

                        get: function(name)
                        {
                            var arg=name+"=";
                            var alen=arg.length;
                            var clen=document.cookie.length;
                            var i=0;
                            while (i<clen)
                            {
                                var j=i+alen;
                                if (document.cookie.substring(i, j)==arg){
                                    return $.la.buzz.cookie.getVal(j);
                                }
                                i=document.cookie.indexOf(" ",i)+1;
                                if (i === 0){
                                    break;
                                }
                            }
                            return false;
                        },

                        set: function(name, value, expireParam, domain)
                        {
                            domain = domain||false;
                            var expires = new Date();
                            if (expireParam && typeof expireParam == 'object'){
                                expires = expireParam;
                            }
                            else if (typeof expireParam == 'number'){
                                expires.setTime(((expires.getTime() / 1000) + expireParam) * 1000); // expireParam en secondes
                            }
                            else{
                                expires.setTime(expires.getTime() + 99999999999);
                            }
                            var path="/";
                            var secure=false;
                            var curCookie = name + "=" + escape(value) +
                            ((expires) ? "; expires=" + expires.toGMTString() : "") +
                            ((path) ? "; path=" + path : "") +
                            ((domain) ? "; domain=" + domain : "") +
                            ((secure) ? "; secure" : "");
                            document.cookie = curCookie;
                        },

                        clear: function(name)
                        {
                            var date = new Date();
                            var date_del = date.setFullYear(date.getFullYear() - 1000);
                            document.cookie = name + "=" + escape('') + "; expires=" + date_del;
                        }
                    }
                }
            });
        })(jQuery);
        jQuery(document).ready(function(){
            //jQuery.la.buzz.run();
        });
    }
}
catch(e){
    if (window.console && window.console.log){
        window.console.log(e.message);
    }
}
