
/** /bourse/cms/resource/static/resource/common/certificats/number_format_js.tpl.js **/
{(function($) {
  $.number_format = function(value, opts) {
    // Merges default options with parameter opts
    var options = $.extend({precision:     2,
                            decimal:       ',',
                            thousands:     ' ',
                            defaultx:       ' ',
                            allow_negative: true}, opts);

    // Validates negative signal
    var signal = (value.toString().indexOf('-') == 0 && options.allow_negative) ? '-' : '';

    // Set the default value unless the input has any value
    if(get_numeric(value) == 0 || get_numeric(value) == '')
      return signal + options.defaultx;

    // Formats the number
    var val = get_numeric(value);
        val = signal + format_value(val);

    // Return formatted number
    return val;



    // Returns the numeric part of "val", preserving the signal
    function get_numeric(val) {
      var value = val.toString().replace(/[^\d]*/g, '');
      var mult = val.toString().indexOf('-') == 0 ? -1 : 1;
      return parseInt(value * mult);
    }



    // Formats "val"
    function format_value(val) {
      var value = val.toString();
      var offset = value.charAt(0) == '-' ? 1 : 0;
      var integer_part = '';
      var decimal_part = '';
      var formatted_number = '';
      var aux = 0;

      // If there is a precision, formats the number
      if(options.precision > 0) {
        aux = offset ? (options.precision + 1) : options.precision;

        // If the number of digits is lesser than the precision, no need to format
        if(value.length <= aux) {
          integer_part = '0';

          // Adds the correct number of digits in the decimal part
          if(value.length < aux)
            for(var i = 0; i < options.precision - value.length; i++)
              decimal_part += '0';

          decimal_part += offset ? value.slice(1) : value;
          formatted_number += integer_part + options.decimal + decimal_part;

        // If the number of digits is greater than the precision, formats the number
        } else {
          integer_part = value.slice(0, value.length - options.precision);
          decimal_part = value.slice(value.length - options.precision);
          formatted_number = format_integer_part(integer_part) + options.decimal + decimal_part;
        }

      // If no precision is given, the number is integer only
      } else {
        formatted_number = format_integer_part(value);
      }

      return formatted_number;
    }



    // Formats the integer part of the number
    function format_integer_part(val) {
      var counter = 0;
      var formatted = '';
      var separator = '';
      var offset = val.charAt(0) == '-' ? 1 : 0;

      // Adds the thousands separator in every 3 digits
      for(var i = val.length - 1; i >= offset; i--) {
        separator = (counter > 0 && counter % 3 == 0) ? options.thousands : '';
        formatted = val[i] + separator + formatted;
        counter++;
      }

      return formatted;
    }
  };
})(jQuery);


(function ($) {
  $.fn.number_format = function (opts) {
    return $(this).each(function () {
      $(this).val($.number_format($(this).val(), opts));

      // Set event handlers
      $(this)

      // Formats the value
      .keyup(function() {
        $(this).val($.number_format($(this).val(), opts));
      })

      // Trigger keyup event to format the value again, if necessary
      .blur(function() {
        $(this).trigger('keyup');
      })

      // Change focus behaviour to select the value
      .focus(function() {
        $(this).select();
      });
    });
  };
})(jQuery);}

/** /bourse/cms/resource/static/resource/jquery/plugins/jquery_ifixpng.tpl.js **/
{/*
 * jQuery ifixpng plugin
 * (previously known as pngfix)
 * Version 2.1  (23/04/2008)
 * @requires jQuery v1.1.3 or above
 *
 * Examples at: http://jquery.khurshid.com
 * Copyright (c) 2007 Kush M.
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
 
 /**
  *
  * @example
  *
  * optional if location of pixel.gif if different to default which is images/pixel.gif
  * $.ifixpng('media/pixel.gif');
  *
  * $('img[@src$=.png], #panel').ifixpng();
  *
  * @apply hack to all png images and #panel which icluded png img in its css
  *
  * @name ifixpng
  * @type jQuery
  * @cat Plugins/Image
  * @return jQuery
  * @author jQuery Community
  */
 
(function($) {

  /**
   * helper variables and function
   */
  $.ifixpng = function(customPixel) {
    $.ifixpng.pixel = customPixel;
  };
  
  $.ifixpng.getPixel = function() {
    return $.ifixpng.pixel || 'images/pixel.gif';
  };
  
  var hack = {
    ltie7  : $.browser.msie && $.browser.version < 7,
    filter : function(src) {
      return "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";
    }
  };
  
  /**
   * Applies ie png hack to selected dom elements
   *
   * $('img[@src$=.png]').ifixpng();
   * @desc apply hack to all images with png extensions
   *
   * $('#panel, img[@src$=.png]').ifixpng();
   * @desc apply hack to element #panel and all images with png extensions
   *
   * @name ifixpng
   */
   
  $.fn.ifixpng = hack.ltie7 ? function() {
      return this.each(function() {
      var $$ = $(this);
      // in case rewriting urls
      var base = $('base').attr('href');
      if (base) {
        // remove anything after the last '/'
        base = base.replace(/\/[^\/]+$/,'/');
      }
      if ($$.is('img') || $$.is('input')) { // hack image tags present in dom
        if ($$.attr('src')) {
          if ($$.attr('src').match(/.*\.png([?].*)?$/i)) { // make sure it is png image
            // use source tag value if set 
            var source = (base && $$.attr('src').search(/^(\/|http:)/i)) ? base + $$.attr('src') : $$.attr('src');
            // apply filter
            $$.css({filter:hack.filter(source), width:$$.width(), height:$$.height()})
              .attr({src:$.ifixpng.getPixel()})
              .positionFix();
          }
        }
      } else { // hack png css properties present inside css
        var image = $$.css('backgroundImage');
        if (image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)) {
          image = RegExp.$1;
          image = (base && image.substring(0,1)!='/') ? base + image : image;
          $$.css({backgroundImage:'none', filter:hack.filter(image)})
            .children().children().positionFix();
        }
      }
    });
  } : function() { return this; };
  
  /**
   * Removes any png hack that may have been applied previously
   *
   * $('img[@src$=.png]').iunfixpng();
   * @desc revert hack on all images with png extensions
   *
   * $('#panel, img[@src$=.png]').iunfixpng();
   * @desc revert hack on element #panel and all images with png extensions
   *
   * @name iunfixpng
   */
   
  $.fn.iunfixpng = hack.ltie7 ? function() {
      return this.each(function() {
      var $$ = $(this);
      var src = $$.css('filter');
      if (src.match(/src=["']?(.*\.png([?].*)?)["']?/i)) { // get img source from filter
        src = RegExp.$1;
        if ($$.is('img') || $$.is('input')) {
          $$.attr({src:src}).css({filter:''});
        } else {
          $$.css({filter:'', background:'url('+src+')'});
        }
      }
    });
  } : function() { return this; };
  
  /**
   * positions selected item relatively
   */
   
  $.fn.positionFix = function() {
    return this.each(function() {
      var $$ = $(this);
      var position = $$.css('position');
      if (position != 'absolute' && position != 'relative') {
        $$.css({position:'relative'});
      }
    });
  };

})(jQuery);}

/** /bourse/cms/resource/static/resource/jquery/plugins/jquery_simplemodal_1.4.1.tpl.js **/
{/*
 * SimpleModal 1.4.1 - jQuery Plugin
 * http://www.ericmmartin.com/projects/simplemodal/
 * Copyright (c) 2010 Eric Martin (http://twitter.com/ericmmartin)
 * Dual licensed under the MIT and GPL licenses
 * Revision: $Id: jquery.simplemodal.js 261 2010-11-05 21:16:20Z emartin24 $
 */
(function(d){var k=d.browser.msie&&parseInt(d.browser.version)===6&&typeof window.XMLHttpRequest!=="object",m=d.browser.msie&&parseInt(d.browser.version)===7,l=null,f=[];d.modal=function(a,b){return d.modal.impl.init(a,b)};d.modal.close=function(){d.modal.impl.close()};d.modal.focus=function(a){d.modal.impl.focus(a)};d.modal.setContainerDimensions=function(){d.modal.impl.setContainerDimensions()};d.modal.setPosition=function(){d.modal.impl.setPosition()};d.modal.update=function(a,b){d.modal.impl.update(a,
b)};d.fn.modal=function(a){return d.modal.impl.init(this,a)};d.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1E3,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,
persist:false,modal:true,onOpen:null,onShow:null,onClose:null};d.modal.impl={d:{},init:function(a,b){var c=this;if(c.d.data)return false;l=d.browser.msie&&!d.boxModel;c.o=d.extend({},d.modal.defaults,b);c.zIndex=c.o.zIndex;c.occb=false;if(typeof a==="object"){a=a instanceof jQuery?a:d(a);c.d.placeholder=false;if(a.parent().parent().size()>0){a.before(d("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"}));c.d.placeholder=true;c.display=a.css("display");if(!c.o.persist)c.d.orig=
a.clone(true)}}else if(typeof a==="string"||typeof a==="number")a=d("<div></div>").html(a);else{alert("SimpleModal Error: Unsupported data type: "+typeof a);return c}c.create(a);c.open();d.isFunction(c.o.onShow)&&c.o.onShow.apply(c,[c.d]);return c},create:function(a){var b=this;f=b.getDimensions();if(b.o.modal&&k)b.d.iframe=d('<iframe src="javascript:false;"></iframe>').css(d.extend(b.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:f[0],width:f[1],zIndex:b.o.zIndex,top:0,left:0})).appendTo(b.o.appendTo);
b.d.overlay=d("<div></div>").attr("id",b.o.overlayId).addClass("simplemodal-overlay").css(d.extend(b.o.overlayCss,{display:"none",opacity:b.o.opacity/100,height:b.o.modal?f[0]:0,width:b.o.modal?f[1]:0,position:"fixed",left:0,top:0,zIndex:b.o.zIndex+1})).appendTo(b.o.appendTo);b.d.container=d("<div></div>").attr("id",b.o.containerId).addClass("simplemodal-container").css(d.extend(b.o.containerCss,{display:"none",position:"fixed",zIndex:b.o.zIndex+2})).append(b.o.close&&b.o.closeHTML?d(b.o.closeHTML).addClass(b.o.closeClass):
"").appendTo(b.o.appendTo);b.d.wrap=d("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(b.d.container);b.d.data=a.attr("id",a.attr("id")||b.o.dataId).addClass("simplemodal-data").css(d.extend(b.o.dataCss,{display:"none"})).appendTo("body");b.setContainerDimensions();b.d.data.appendTo(b.d.wrap);if(k||l)b.fixIE()},bindEvents:function(){var a=this;d("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});
a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});d(document).bind("keydown.simplemodal",function(b){if(a.o.modal&&b.keyCode===9)a.watchTab(b);else if(a.o.close&&a.o.escClose&&b.keyCode===27){b.preventDefault();a.close()}});d(window).bind("resize.simplemodal",function(){f=a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();if(k||l)a.fixIE();else if(a.o.modal){a.d.iframe&&a.d.iframe.css({height:f[0],
width:f[1]});a.d.overlay.css({height:f[0],width:f[1]})}})},unbindEvents:function(){d("."+this.o.closeClass).unbind("click.simplemodal");d(document).unbind("keydown.simplemodal");d(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this,b=a.o.position;d.each([a.d.iframe||null,!a.o.modal?null:a.d.overlay,a.d.container],function(c,h){if(h){var g=h[0].style;g.position="absolute";if(c<2){g.removeExpression("height");g.removeExpression("width");g.setExpression("height",
'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"');g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')}else{var e;if(b&&b.constructor===Array){c=b[0]?typeof b[0]==="number"?b[0].toString():b[0].replace(/px/,""):h.css("top").replace(/px/,"");c=c.indexOf("%")===-1?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':
parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';if(b[1]){e=typeof b[1]==="number"?b[1].toString():b[1].replace(/px/,"");e=e.indexOf("%")===-1?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}}else{c=
'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}g.removeExpression("top");g.removeExpression("left");g.setExpression("top",
c);g.setExpression("left",e)}}})},focus:function(a){var b=this;a=a&&d.inArray(a,["first","last"])!==-1?a:"first";var c=d(":input:enabled:visible:"+a,b.d.wrap);setTimeout(function(){c.length>0?c.focus():b.d.wrap.focus()},10)},getDimensions:function(){var a=d(window);return[d.browser.opera&&d.browser.version>"9.5"&&d.fn.jquery<"1.3"||d.browser.opera&&d.browser.version<"9.5"&&d.fn.jquery>"1.2.6"?a[0].innerHeight:a.height(),a.width()]},getVal:function(a,b){return a?typeof a==="number"?a:a==="auto"?0:
a.indexOf("%")>0?parseInt(a.replace(/%/,""))/100*(b==="h"?f[0]:f[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){var c=this;if(!c.d.data)return false;c.d.origHeight=c.getVal(a,"h");c.d.origWidth=c.getVal(b,"w");c.d.data.hide();a&&c.d.container.css("height",a);b&&c.d.container.css("width",b);c.setContainerDimensions();c.d.data.show();c.o.focus&&c.focus();c.unbindEvents();c.bindEvents()},setContainerDimensions:function(){var a=this,b=k||m,c=a.d.origHeight?a.d.origHeight:d.browser.opera?
a.d.container.height():a.getVal(b?a.d.container[0].currentStyle.height:a.d.container.css("height"),"h");b=a.d.origWidth?a.d.origWidth:d.browser.opera?a.d.container.width():a.getVal(b?a.d.container[0].currentStyle.width:a.d.container.css("width"),"w");var h=a.d.data.outerHeight(true),g=a.d.data.outerWidth(true);a.d.origHeight=a.d.origHeight||c;a.d.origWidth=a.d.origWidth||b;var e=a.o.maxHeight?a.getVal(a.o.maxHeight,"h"):null,i=a.o.maxWidth?a.getVal(a.o.maxWidth,"w"):null;e=e&&e<f[0]?e:f[0];i=i&&i<
f[1]?i:f[1];var j=a.o.minHeight?a.getVal(a.o.minHeight,"h"):"auto";c=c?a.o.autoResize&&c>e?e:c<j?j:c:h?h>e?e:a.o.minHeight&&j!=="auto"&&h<j?j:h:j;e=a.o.minWidth?a.getVal(a.o.minWidth,"w"):"auto";b=b?a.o.autoResize&&b>i?i:b<e?e:b:g?g>i?i:a.o.minWidth&&e!=="auto"&&g<e?e:g:e;a.d.container.css({height:c,width:b});a.d.wrap.css({overflow:h>c||g>b?"auto":"visible"});a.o.autoPosition&&a.setPosition()},setPosition:function(){var a=this,b,c;b=f[0]/2-a.d.container.outerHeight(true)/2;c=f[1]/2-a.d.container.outerWidth(true)/
2;if(a.o.position&&Object.prototype.toString.call(a.o.position)==="[object Array]"){b=a.o.position[0]||b;c=a.o.position[1]||c}else{b=b;c=c}a.d.container.css({left:c,top:b})},watchTab:function(a){var b=this;if(d(a.target).parents(".simplemodal-container").length>0){b.inputs=d(":input:enabled:visible:first, :input:enabled:visible:last",b.d.data[0]);if(!a.shiftKey&&a.target===b.inputs[b.inputs.length-1]||a.shiftKey&&a.target===b.inputs[0]||b.inputs.length===0){a.preventDefault();b.focus(a.shiftKey?"last":
"first")}}else{a.preventDefault();b.focus()}},open:function(){var a=this;a.d.iframe&&a.d.iframe.show();if(d.isFunction(a.o.onOpen))a.o.onOpen.apply(a,[a.d]);else{a.d.overlay.show();a.d.container.show();a.d.data.show()}a.o.focus&&a.focus();a.bindEvents()},close:function(){var a=this;if(!a.d.data)return false;a.unbindEvents();if(d.isFunction(a.o.onClose)&&!a.occb){a.occb=true;a.o.onClose.apply(a,[a.d])}else{if(a.d.placeholder){var b=d("#simplemodal-placeholder");if(a.o.persist)b.replaceWith(a.d.data.removeClass("simplemodal-data").css("display",
a.display));else{a.d.data.hide().remove();b.replaceWith(a.d.orig)}}else a.d.data.hide().remove();a.d.container.hide().remove();a.d.overlay.hide();a.d.iframe&&a.d.iframe.hide().remove();setTimeout(function(){a.d.overlay.remove();a.d={}},10)}}}})(jQuery);}

/** /bourse/cms/resource/static/resource/loginw2/loginw2_trigger.tpl.js **/
{var checkHashTimer, reopener;

(function($){
  $.checkHash = function() {
    if (window.location.hash == "#inscription") {
      if ($.modal.impl.d.overlay == undefined) {
        reopener = setTimeout("$.openRegistration()", 1000);
        clearInterval(checkHashTimer);
      } else {
        $.modal.close();
      }
    }
  };
})(jQuery);

$(function(){
  var isDialogActive = false;

  $.ifixpng("/bourse/public/website/images/images/blank.gif");

  $.openModal = $(this);

  openModal = function(options) {
    var defaults = {forceLogin: false, opacity: 70};
    if(!options){
       options = {};
    }
    options = $.extend(defaults, options);
    if (window.location.protocol == "http:") {
      var n = "https://" + window.location.host + window.location.pathname + "#connexion";
      window.location.replace(n);
      return false;
    } else {

      window.location.hash = "#connexion";
      checkHashTimer = setInterval("$.checkHash()", 200);

      $.modal('<iframe rel="' + document.location.href + '" src="https://' + window.location.host + '/bourse/connexion/" frameborder="0" allowtransparency="true" height="450" width="100%" style="background: transparent; border:0">', {
        closeHTML: (options.forceLogin) ? '' :'<a class="modalCloseImg" title="Fermer"></a>',
        containerCss: {
          background: "transparent",
          height: 460,
          margin: 0,
          padding: 0,
          width: "100%"
        },
        dataCss: {
          background: "transparent"
        },
        onOpen: function(dialog) {
          dialog.overlay.css({display:"block"});
          dialog.overlay.fadeIn('fast', function(){
            dialog.data.hide();
            dialog.container.fadeIn('fast', function(){
              dialog.data.show('fast');
            });
          });
        },
        onClose: function(dialog) {
          isDialogActive = false;
          if(!options.forceLogin){
            $.modal.close();
          }
        },
        opacity: options.opacity,
        overlayCss: {
          backgroundColor: "#111"
        },
        position: ["25%", null]
      });
      $("#simplemodal-wrap, #simplemodal-wrap, #simplemodal-data, #simplemodal-overlay, #simplemodal-container").ifixpng();
      $("#simplemodal-wrap").ifixpng();
      $("#simplemodal-container a.modalCloseImg").css({
        background: "url(https://media.easybourse.com/upload/media/image/86000/86784/close.png) no-repeat",
        cursor: "pointer",
        display: "inline",
        height: "29px",
        top: "-12px",
        position: "absolute",
        left: $("#simplemodal-container").width() / 2 + 110,
        width: "30px",
        zIndex: "3200"
      }).ifixpng();
    }

  };

  $(window).trigger('openModalLoaded');
  if ( ($("#token_visitor").size() == 1 && window.location.hash == "#connexion") || window.location.hash == "#connexion/release") {
    if(window.location.hash == "#connexion/release"){
      $('#logout').html("<img src='/bourse/public/website/img/pages/loading.gif' />");  
      $('#hiddeniframe').attr('src', pchost+'easybourse/secure_tiles/ssologout.html');
      var date = new Date();
      date.setTime(date.getTime()-1);            
      document.cookie = "rememberMe=''; expires="+date.toGMTString()+"; path=/ ; domain=."+document.domain;
      $.ajax({
         type:"GET",
         cache:false,
         async:false,
         url:'/bourse/rest/',
         data:"method=disconnect",
         complete:function(msg){
           document.location.href = 'https://' + window.location.host + window.location.pathname + '#connexion';
           location.reload();
         }
      });      
      return false;
    }
    openModal();
  };


  if ($("#token_visitor").size() == 1) {

    $(".will_redirect , a[href^=/bourse/action/operation/VTE/] , a[href^=/bourse/action/operation/ACH/] , a[href^=/bourse/action/alerte-sur-cours/] , a[href*=/bourse/secure/compte/] , a[href*=/bourse/secure/operation/], a[href*=/bourse/secure/profil/] , a[href*=/bourse/secure/outils/]").click(function(){

      $.ajax({
        async: false,
        data: {
          method: "remindReferer",
          refererUrl: jQuery(this).attr('href')
        },
        dataType: "xml",
        success: function(res){
          openModal();
        },
        type: "POST",
        url: "/bourse/rest/"
      });

      return false;
    });

    $(".loginw2").click(function(){
      openModal();
      return false;
    });
  };
});}

/** /bourse/cms/resource/static/resource/inscription/membre/inscription_membre_w2_trigger.tpl.js **/
{$(function(){
  if (window.location.hash == "#inscription") {
    $.openRegistration();
  };
});

(function($){
  
  var ie6PositionFix = function(){
    var s = $.modal.impl, p = $.modal.impl.o.position;
    $.each([s.d.iframe || null, !s.o.modal ? null : s.d.overlay, s.d.container], function (i, el) {
      if (el) {
        var s = el[0].style;
        s.position = 'absolute';
        if (i < 2) {
          s.removeExpression('height');
          s.removeExpression('width');
        } else {
          s.removeExpression('top');
          s.removeExpression('left');
        }
      }
    });
  };
  
  $.openRegistration = function() {
    if (window.location.protocol == "http:") {
      var n = "https://" + window.location.host + window.location.pathname + "#inscription";
      window.location.replace(n);
      return false;
    } else {
      $.modal(
        '<iframe src="https://' + window.location.host + '/bourse/inscription/" frameborder="0" allowtransparency="true" height="900" width="100%" style="background: transparent; border:0">',
        {
          closeHTML: '<a class="modalCloseImg" title="Fermer"></a>',
          containerCss: {
            background: "transparent",
            height: 950,
            margin: 0,
            padding: 0,
            position: "absolute",
            width: "100%"
          },
          dataCss: {
            background: "transparent"
          },
          onOpen: function(dialog) {
            isDialogActive = true;
            dialog.overlay.css({display:"block"});
            dialog.overlay.fadeIn('fast', function(){
              dialog.data.hide();
              dialog.container.fadeIn('fast', function(){
                dialog.data.show('fast');
                if ($.browser.msie && parseInt($.browser.version) === 6 && typeof window['XMLHttpRequest'] !== 'object') {
                  $(window).bind('resize.simplemodal', ie6PositionFix);
                  ie6PositionFix();
                };
              });
            });
          },
          onClose: function(dialog) {
            isDialogActive = false;
            window.location.hash = "#";
            $("body").css({overflow: "auto"});
            $.modal.close();
          },
          opacity: 70,
          overlayCss: {
            backgroundColor: "#111"
          },
          position: [20, null],
          zIndex: 9500
        }
      );
      
      $("#simplemodal-wrap, #simplemodal-wrap, #simplemodal-data, #simplemodal-overlay, #simplemodal-container").ifixpng();
      $("#simplemodal-wrap, #simplemodal-container").css({position: "absolute"}).ifixpng();
      $("#simplemodal-container a.modalCloseImg").css({
        background: "url(https://media.easybourse.com/upload/media/image/86000/86784/close.png) no-repeat",
        cursor: "pointer",
        display: "inline",
        height: "29px",
        top: "-12px",
        position: "absolute",
        left: $("#simplemodal-container").width() / 2 + 175,
        width: "30px",
        zIndex: "3200"
      }).ifixpng();
    }
  }
})(jQuery);}

/** /bourse/cms/resource/static/resource/membre/rememberMeDetect.tpl.js **/
{jQuery(document).ready(function(){
  
  var remember = $('#rememberMe').text();
 
  
  if ( remember.length > 10) {

    
    if ( remember == "mustDelete" ) {
      
      var date = new Date();
      date.setTime(date.getTime()-1);            
      document.cookie = "rememberMe=''; expires="+date.toGMTString()+"; path=/ ; domain=."+document.domain;
      
    } else {
      
      $.modal('<p style="color: #000000; font-weight: bold; background-color: #f0faf8; padding: 20px 10px; border: 3px solid #bdc4c9;"><span style="display: block; text-align: center;"><img alt="" src="/bourse/public/website/img/pages/loading.gif"></span>Authentification en cours, veuillez patienter.</p>',
              {
                closeHTML: '<a title="Fermer" class="modalCloseImg simplemodal-close" id="liper_infosvalue"></a>',
                containerCss: {
                  position: "absolute"
                },
                onOpen: function(dialog) {
                  isDialogActive = true;
                  dialog.overlay.css({'display':'block', 'position':'absolute'});
                  dialog.overlay.fadeIn('fast', function(){
                    dialog.data.hide();
                    dialog.container.fadeIn('fast', function(){
                      dialog.data.show('fast');
                      
                    });
                  });
                },
                onClose: function(dialog) {
                  isDialogActive = false;
                  window.location.hash = "#";
                  $("body").css({overflow: "auto"});
                  $.modal.close();
                },
                opacity: 70,
                overlayCss: {
                  backgroundColor: "#111"
                },
                position: [null, "40%"],
                zIndex: 9500
              }
             );
      
      document.location.href = remember;
    }
  }
});}

/** /bourse/cms/resource/static/resource/inscription/membre/fast_inscription_membre_w2_trigger.tpl.js **/
{jQuery(document).ready(function(){
  if (window.location.hash == "#inscription-rapide") {
    $.openFastRegistration();
  };
});

(function($){
  
  var ie6PositionFix = function(){
    var s = $.modal.impl, p = $.modal.impl.o.position;
    $.each([s.d.iframe || null, !s.o.modal ? null : s.d.overlay, s.d.container], function (i, el) {
      if (el) {
        var s = el[0].style;
        s.position = 'absolute';
        if (i < 2) {
          s.removeExpression('height');
          s.removeExpression('width');
        } else {
          s.removeExpression('top');
          s.removeExpression('left');
        }
      }
    });
  };
  
  $.openFastRegistration = function() {
    if (window.location.protocol == "http:") {
      var n = "https://" + window.location.host + window.location.pathname + "#inscription-rapide";
      window.location.replace(n);
      return false;
    } else {
      $.modal(
        '<iframe src="https://' + window.location.host + '/bourse/inscription-rapide/" frameborder="0" allowtransparency="true" height="900" width="100%" style="background: transparent; border:0">',
        {
          closeHTML: '<a class="modalCloseImg" title="Fermer"></a>',
          containerCss: {
            background: "transparent",
            height: 950,
            margin: 0,
            padding: 0,
            width: "100%"       
          },
          dataCss: {
            background: "transparent"
          },
          onOpen: function(dialog) {
            isDialogActive = true;
            dialog.overlay.css({display:"block", position:"fixed"});
            dialog.overlay.fadeIn('fast', function(){
              dialog.data.hide();
              dialog.container.fadeIn('fast', function(){
                dialog.data.show('fast');
                if ($.browser.msie && parseInt($.browser.version) === 6 && typeof window['XMLHttpRequest'] !== 'object') {
                  $(window).bind('resize.simplemodal', ie6PositionFix);
                  ie6PositionFix();
                };
              });
            });
          },
          onClose: function(dialog) {
            isDialogActive = false;
            window.location.hash = "#";
            $("body").css({overflow: "auto"});
            $.modal.close();
          },
          opacity: 70,
          overlayCss: {
            backgroundColor: "#111"
          },
          position:[100, null],
          zIndex: 9500
        }
      );
      
      $("#simplemodal-wrap, #simplemodal-wrap, #simplemodal-data, #simplemodal-overlay, #simplemodal-container").ifixpng();
      $("#simplemodal-container a.modalCloseImg").css({
        background: "url(https://media.easybourse.com/upload/media/image/86000/86784/close.png) no-repeat",
        cursor: "pointer",
        display: "inline",
        height: "29px",
        top: "1px",
        position: "absolute",
        left: $("#simplemodal-container").width() / 2 + 202,
        width: "30px",
        zIndex: "3200"
      }).ifixpng();
    }
  }
  
})(jQuery);}

/** /bourse/cms/resource/static/resource/common/frise_js.tpl.js **/
{$(document).ready(function() {

  //frise_live();

});

frise_live= function(){
  $.ajax({
    type:"GET",
    async:true,
    cache:false,
    url:'/bourse/rest/',
    data:"method=getFriseLiveContent",
    success:function(msg){
      var eurodolar = $(msg).find('eurodolar').text();
      $('#eurodolar').text(Math.round(eurodolar*10000)/10000);

      var cac40_variation = $(msg).find('cac40_variation').text();
      var cac40_class = '';
      var cac40_sign = '';
      if(cac40_variation<0){
        cac40_class = 'rouge';
      } else {
        cac40_class = 'vert';
        cac40_sign = '+';
      }
      $('#cac40_variation').text(cac40_sign+Math.round(cac40_variation*100)/100+"%");
      $('#cac40_variation').addClass(cac40_class);

      var cac40_lastprice = $(msg).find('cac40_lastprice').text();
      $('#cac40_lastprice').text(Math.round(cac40_lastprice));
    }
  });
  return true;
}}

/** /bourse/cms/resource/static/resource/instrument/plugin_liveInfo.tpl.js **/
{(function( $ ){

  $.liveInfo = $(this);

  $.fn.liveInfo = function(options){
    return $.liveInfo.impl.init(this, options);
  };

  $.liveInfo.defaults  = {
      decimal : 'auto',
      color : false,
      transcodeUnit : true,
      currency : 'auto',
      format : 'true',
      returnempty : 'false'
  };
  $.liveInfo.addLivePlugin = function(callback){
    $.liveInfo.impl = $.extend($.liveInfo.impl, callback);
  };

  $.liveInfo.impl = {
      isLoaded: function(plugin){
        return (this[plugin]) ? true : false;
      },
      current: {},
      options: {},
      init: function(obj, options){
        this.current = $(obj);
        this.options = $.extend($.liveInfo.defaults, options);
        return this;
      },

      doFormat : function(value, currency, decimal, color, transcodeUnit, clos, returnempty ){

        if ( ( value == "undefined") || ( value == 0) ) {
          if ( returnempty ) {
            return '';
          }
          else {
            return '--';
          }
        }
        if ( currency == "EUR" ) {
          if ( decimal == "auto" ) {
            decimal = 3;
          }
          var currency = "€";
        }
        else {
          if ( currency == "PTS" ) {
            if ( decimal == "auto" ) {
              decimal = 2;
            }
            var currency = "Pts";
          }
          else {
            if ( currency  == "USD" ) {
              if ( decimal == "auto" ) {
                decimal = 3;
              }
              var currency = "$";
            }
            else {
              if ( currency == "PCT" ) {
                if ( decimal == "auto" ) {
                  decimal = 2;
                }
                var currency = "%";
              }
              else {
                var currency = "";
              }
            }
          }
        }
        var deci = Math.round( Math.pow(10,decimal)*(Math.abs(value)-Math.floor(Math.abs(value)))) ;
        var val = Math.floor(Math.abs(value));
        if ((decimal==0)||(deci==Math.pow(10,decimal))) {
          val=Math.floor(Math.abs(value)); deci=0;
        }
        var val_format=val+"";
        var nb=val_format.length;
        for (var i=1;i<4;i++) {
          if (val>=Math.pow(10,(3*i))) {
            val_format=val_format.substring(0,nb-(3*i))+' '+val_format.substring(nb-(3*i));
          }
        }
        if (decimal>0) {
          var decim="";
          for (var j=0;j<(decimal-deci.toString().length);j++) {decim+="0";}
          deci=decim+deci.toString();
          val_format=val_format+"."+deci;
        }
        if (parseFloat(value)<0) {
          val_format="-"+val_format;
        }
        var reg=new RegExp("([\.])", "g");
        val_format = val_format.replace(reg,",");
        val_format = val_format +' '+ currency;
        if ( color ) {
          if ( value >= 0 ) {
            val_format = '<span class="green vert">+'+val_format+'</span>';
          } else {
            val_format = '<span class="red rouge">'+val_format+'</span>';
          }
        }
        if ( clos ) {
          val_format = val_format +' (c)';
        }
        return val_format;
      }
  };

})( jQuery );}

/** /bourse/cms/resource/static/resource/instrument/plugin_liveInfo_cotation.tpl.js **/
{(function( $ ){

  /**
   * live cotation plugin
   */
  var liveInfoPlugin = {
      liveCotation : function(options) {
      var options = this.options;
      var current = this.current;

      var liveCotations = [];
      current.each(function() {
        if ( $(this).attr('liveCotation') != "-" && $(this).attr('liveCotation') != "")  {
        liveCotations.push({key: $(this).attr('liveCotation'), toDisplay: $(this).attr('liveCotationDisplay'), options : $(this).attr('options')});
        }
        });
        
      var dat = [];
      var datas = '';
      for (var i in liveCotations) {
        if ( jQuery.inArray( liveCotations[i].key, dat)  == -1 ) {
        dat.push(liveCotations[i].key);
        datas += "&data[]="+liveCotations[i].key;
        }
      }
        
      datas += "&token="+Math.random();
      $.ajax({
        type:"GET",
        async:true,
        cache:false,
        url:'/bourse/rest/',
        data:"method=getInstrumentValueInfo"+datas,
        success:function(msg){
        var trading = $(msg).find('trading > *');
        trading.each(function(i,o){
          var isin_market = o.tagName;
          var exploded = isin_market.split("-");
            if (exploded[1] < 100){
               isin_market = exploded[0]+"-"+parseFloat(exploded[1]);
            }
          for (var j in liveCotations) {
            if(liveCotations[j].key == isin_market){
              var clos = false;
              var decimal = options.decimal;
              var color= options.color;
              var transcodeUnit= options.transcodeUnit;
              var currency= options.currency;
              var format= options.format;
              var returnempty = options.returnempty;
              if ( typeof liveCotations[j].options == "string" && liveCotations[j].options != "undefined" ) {
                eval("var option ="+liveCotations[j].options);
                if ( option.decimal) {
                  decimal = option.decimal;
                }
                if ( typeof option.color == "boolean") {
                  color= option.color;
                }
                if ( typeof option.transcodeUnit == "boolean") {
                  transcodeUnit= option.transcodeUnit;
                }
                if ( typeof option.currency == "string") {
                  currency= option.currency;
                }
                if ( typeof option.format == "boolean") {
                  format= option.format;
                }
                if ( typeof option.returnempty == "boolean") {
                  returnempty = option.returnempty ;
                }
              }
              var cotation = $(o).find(liveCotations[j].toDisplay).text();
              if ( ( liveCotations[j].toDisplay == 'cours_dernier' && cotation == "" ) && ( $(o).find('cours_veille').text() != "" ) ) {
                cotation = $(o).find('cours_veille').text();
                var currency = $(o).find('cours_veille').attr('unit');
                clos = true;
              }
              if ( currency == 'auto') {
                var currency = $(o).find(liveCotations[j].toDisplay).attr('unit');
              }
              if ( liveCotations[j].toDisplay == "date_heure" ) {
                var tmp = cotation.split(' ');
                cotation = tmp[0];
              }
              if ( format ) {
                cotation = $.liveInfo.impl.doFormat(cotation, currency, decimal, color, transcodeUnit, clos, returnempty );
              }
              $(current).filter('[liveCotation="'+isin_market+'"]').filter('[liveCotationDisplay="'+liveCotations[j].toDisplay+'"]').filter('[options="'+liveCotations[j].options+'"]').html(cotation);
            }
          }
        });

        $($.liveInfo).trigger('liveCotationLoaded');
      }
      });
    }
  }

  $.liveInfo.addLivePlugin(liveInfoPlugin);

})( jQuery );}

/** /bourse/cms/resource/static/resource/common/search_js.tpl.js **/
{$(document).ready(function()
{
  $('#q').Watermark($('#q').val());

  $('#newsmail').Watermark("email@mail.com");

   $('#btnEnvoyer').click(function(){
    var q = $('#q').val();
    if(q=='<?=$keyDefault; ?>' || q=='')
      return false;
  });

   $('#btnDemander').click(function(){
    var newsmail = $('#newsmail').val();
    if(newsmail=='email@mail.com' || newsmail=='')
      return false;
  });
});}

/** /bourse/cms/resource/static/resource/home/central/actu_opcvm_brokers_js.tpl.js **/
{$(document).ready(function(){ 
  var actu_actu = $('#actualite_bourse_opcvm #actualite_actu');
  var actu_opcvm = $('#actualite_bourse_opcvm #actualite_opcvm');
  var actu_brokers = $('#actualite_bourse_opcvm #actualite_brokers');
   
  actu_actu.show();
  $('#btn_actu').removeClass('btn_actu_off').addClass('btn_actu_on');
  actu_opcvm.hide();
  $('#btn_opcvm').removeClass('btn_opcvm_on').addClass('btn_opcvm_off');
  actu_brokers.hide();
  $('#btn_brokers').removeClass('btn_brokers_on').addClass('btn_brokers_off');
  
  $('#btn_actu').mouseover(function(){
    $(this).removeClass('btn_actu_off').addClass('btn_actu_on');
    $('#btn_opcvm').removeClass('btn_opcvm_on').addClass('btn_opcvm_off');
    $('#btn_brokers').removeClass('btn_brokers_on').addClass('btn_brokers_off');
    actu_actu.fadeIn();
    actu_opcvm.fadeOut();
    actu_brokers.fadeOut();
  });
    
  $('#btn_opcvm').mouseover(function(){
    $(this).removeClass('btn_opcvm_off').addClass('btn_opcvm_on');
    $('#btn_actu').removeClass('btn_actu_on').addClass('btn_actu_off');
    $('#btn_brokers').removeClass('btn_brokers_on').addClass('btn_brokers_off');
    actu_opcvm.fadeIn();
    actu_actu.fadeOut();
    actu_brokers.fadeOut();
  });
  
   $('#btn_brokers').mouseover(function(){
    $(this).removeClass('btn_brokers_off').addClass('btn_brokers_on');
    $('#btn_actu').removeClass('btn_actu_on').addClass('btn_actu_off');
    $('#btn_opcvm').removeClass('btn_opcvm_on').addClass('btn_opcvm_off');
    actu_brokers.fadeIn();
    actu_actu.fadeOut();
    actu_opcvm.fadeOut();
});
});}

/** /bourse/cms/resource/static/resource/load_quotation_js.tpl.js **/
{$(document).ready(function(){
  
  $($.liveInfo).bind('liveCotationLoaded', function() {
       
          var variation = $('#quotationVariation').text();
          if (variation.match(/\+/)) {          
  jQuery("#quotationVariation").addClass('vert');
            $('#picto_fleche_rouge').hide();
            $('#picto_fleche_verte').show();
         } else {          
  jQuery("#quotationVariation").addClass('rouge');
              $('#picto_fleche_verte').hide();
             $('#picto_fleche_rouge').show();
         }
  });
});}

/** /bourse/cms/resource/static/resource/common/menu_accordeon_vertical_js.tpl.js **/
{var closeTimer;
var delayingOpen;
function closeMenu(){
    clearInterval(closeTimer);
    $('.level2')
      .slideUp('fast');
    $('ul.level1>li')
      //.css({'background-color': 'transparent', 'font-weight':'normal'}).each(function(i,o){
      .css('font-weight','normal').each(function(i,o){
        if($(o).hasClass('arrow_up')){
          $(o)
            .removeClass('arrow_up')
            .addClass('mg_sub_nav');
        }
      });
}

function openMenu(){
    if(!delayingOpen){
      return false;
    }
    if(closeTimer){
      clearInterval(closeTimer);
    }
    $(delayingOpen)
      //.css({'background-color': '#e1e4e6', 'font-weight':'bold'})
      .css('font-weight','bold')
      .removeClass('mg_sub_nav')
      .addClass('arrow_up')
      .find('.level2')
      .slideDown(250, function(){ delayingOpen = false;});
}

$(document).ready(function(){
  $('.level2').hide();
  closeTimer = false;
  delayingOpen = false;

  $('ul.level1>li.mg_sub_nav').mouseenter(function(e){
    e.stopPropagation();
    if(!delayingOpen){
      delayingOpen = this;
    }
    setTimeout('openMenu()',350);
  });

  $('ul.level1>li.mg_sub_nav').mouseover(function(e){
    e.stopPropagation();
    if(closeTimer){
      clearInterval(closeTimer);
    }
  });
  $('ul.level1>li.mg_sub_nav').mouseleave(function(e){
    delayingOpen = false;
    closeTimer = setInterval("closeMenu()",1000);
  });
});}

/** /bourse/cms/resource/static/resource/home/right/home_palmares_plus_js.tpl.js **/
{$(document).ready(function(){
  $('#palmares_plus, #more').hover(function(){
    $('#palmares_plus_content').fadeIn();
  }, function(){
    $('#palmares_plus_content').fadeOut();
  });
});}

/** /bourse/cms/resource/static/resource/home/home_dernieres_tendances_js.tpl.js **/
{$(document).ready(function(){
  $('#menu_dernieres_tendances td a:first').addClass('blue3c7eba');

  $('#menu_dernieres_tendances td a').mouseover(function(){
    $('#menu_dernieres_tendances td a').removeClass('blue3c7eba');
    $(this).addClass('blue3c7eba');
  });

  function showHideText(cible){
    cible.removeClass('cacher_text').addClass('afficher_text').siblings().addClass('cacher_text');
  }

  $('#menu_dernieres_tendances td a').mouseover(function(){
    showHideText($('#dernieres_tendances_content #' + this.id +'Txt'));

    if (this.id == 'trend1'){
      var trend1T = $('#trend1_text');
      showHideText(trend1T);
    }
    else if (this.id == 'trend2'){
      var trend2T = $('#trend2_text');
      showHideText(trend2T);
    }
    else if (this.id == 'trend3'){
      var trend3T = $('#trend3_text');
      showHideText(trend3T);
    }
    else if (this.id == 'devise'){
      var deviseT = $('#devise_text');
      showHideText(deviseT);
    }
    else if (this.id == 'petrole'){
      var petroleT = $('#petrole_text');
      showHideText(petroleT);
    }
    else if (this.id == 'taux'){
      var tauxT = $('#taux_text');
      showHideText(tauxT);
    }
  });
  
 
  
});}

/** /bourse/cms/resource/static/resource/poll/validate_poll.tpl.js **/
{$(document).ready(function() {


  $('#btn_reponse').click(function() {
    $('#btn_reponse').html("<img src='/bourse/public/website/img/pages/loading.gif' />");
    validatePoll($('input[type=radio][name=sondage]:checked').attr('value'));
    var id = $('#pollid').attr('valeur');
    var expDate = new Date();
    expDate.setTime(expDate.getTime() + (846000000));
    document.cookie = "ebpoll="+id+";expires=" + expDate.toGMTString();
  });

});


  validatePoll= function(answer){
         $.ajax({
         type:"POST",
         cache:false,
         async:true,
         url:'/bourse/rest/',
         data:"method=validatePoll&answer="+answer,
         success:function(msg){
           location.reload();
       }

      });

  return true;
  }}

/** /bourse/cms/resource/static/resource/home/palmares/home_palmares_ajax.tpl.js **/
{$(document).ready(function(){
  
  var loadPalmares = function(){
  $.ajax({
    url: "/bourse/rest/",
    cache: false,
    data: {method: "palmares"},
    dataType: "xml",
    type: "POST",
    success: function(data){
      var p = $("#palmares");
      var t = p.children("table");
      
      t.find("tr:first-child").remove();
      
      $(data).find("values").children().each(function(i){
        var cours = $(this).children("cours_dernier").text();
        var valeur = $(this).children("variation_veille").text();
        var row = $("<tr/>").appendTo(t);
        var pos = valeur >= 0;
        if (i == 3) {
          row.css("border-top","1px dashed #677D8E");
        }
        var img = $("<img/>").attr("src", "/bourse/public/website/img/pages/compo_fleche" + (pos ? "V" : "R") + ".gif").attr("alt", "").css({marginRight: "4px"});
        var link = $("<a/>")
            .attr("href", $(this).children("link").text())
            .attr("title", $(this).children("libelle").text())
            .text($(this).children("libelle").text());
        row.append($("<td/>").append(img).append(link));
        $("<td/>").addClass("alr").text(String(cours).replace(".", ",") + " €").appendTo(row);
        $("<td/>").addClass("alr").addClass(pos ? "vert" : "rouge").text((pos ? "+" : "") + String(valeur).replace(".", ",") + "%").appendTo(row);
      });
      t.find("tr:odd").addClass("hilite");
    }, 
    error: function(){
      //
    }
  });
  }
      
loadPalmares();
var loadPalmaresCounter = 0;
var loadPalmaresInterval = setInterval(function(){
  if(loadPalmaresCounter > 10){
   clearInterval(loadPalmaresInterval); 
  }
  $("#palmares tr").remove();
  $("#palmares table").append('<tr><td>Actualisation en cours <img src="https://media.easybourse.com/upload/media/image/101000/101701/loading.gif" /></tr></td>');
  loadPalmares();
  loadPalmaresCounter++;
}, (1000*60));

});}

/** /bourse/cms/resource/static/resource/common/right_column/liste_palmares_js.tpl.js **/
{jQuery(document).ready(function(){
  $('#liste_palmares tr:nth-child(even)').addClass('cyan');
  $('#liste_palmares td:first-child').css('border-left','none');
  $('#palmares tr:nth-child(even)').addClass('gray');
  $('#palmares td:first-child').css('padding-left','5px');
  $('#palmares td:not(:first-child)').css('text-align','center');
  
  $('#liste_perso').addClass('label_on shadow');
  $('#palmares_bouton').addClass('label_off shadow');
  
  var palma = $(this).find('#palmares_bouton');
  if ( palma.hasClass('label_off') ) {
   $('#palmares').hide();
  }
  $('#palmares_bouton').click(function(){
    $(this).removeClass('label_off').addClass('label_on');
    $('#liste_perso').removeClass('lable_on').addClass('label_off');
    $('#palmares').show();
    $('#liste_perso_wrapper').hide();
  });
  
  $('#liste_perso').click(function(){
    $(this).removeClass('label_off')
           .addClass('label_on')
           .css({
             'text-align':'center',
             'width':'97px',
             'padding-left':'40px'
           });
    $('#palmares_bouton').removeClass('lable_on').addClass('label_off');
    $('#palmares').hide();
    $('#liste_perso_wrapper').show();
  });
  
    $($.liveInfo).bind('liveCotationLoaded', function() {
      $("#home_liste").tablesorter({
        sortList: [[0,0]]
      }); 
    });
  
});}

/** /bourse/cms/resource/static/resource/tablesorter.tpl.js **/
{(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);}

/** /bourse/cms/resource/static/resource/listes_home_sort.tpl.js **/
{jQuery(document).ready(function() {

/*
  $($.liveInfo).bind('liveCotationLoaded', function() {
       
    $("#home_liste").tablesorter({
      sortList: [[0,0]]
    });
    
  });
  
  */
});}

/** /bourse/cms/resource/static/resource/home/home_slides_show_js.tpl.js **/
{$(document).ready(function(){
//Configuration
  var currentPosition = 0;
  var slideWidth = 420;
  var slides = $('.slide');
  var numberOfSlides = slides.length;

// Supprime la scrollbar prévue pour le cas où javascript est désactivé?
  $('#slidesContainer').css('overflow', 'hidden');

// Attribue  #slideInner  à toutes les div .slide
  slides
    .wrapAll('<div id="slideInner"></div>')// Float left to display horizontally, readjust .slides width
    .css({
      'float' : 'left',
      'width' : slideWidth
    });

// Longueur de #slideInner égale au total de la longueur de tous les slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

// Insérer les contrôles dans le DOM
  $('#slideshow').prepend('<span class="control" id="leftControl">Précédent</span>')
                 .prepend('<span class="control_disable" id="leftControl_disable">Précédent</span>')
           .append('<span class="control" id="rightControl">Suivant</span>')
           .append('<span class="control_disable" id="rightControl_disable">Suivant</span>');


// manageControls: Cache ou montre les flèches de controle en fonction de la position courante
  function manageControls(position){
  // Cache la fleche "précédent" si on est sur le premier slide
    if(position==0){
      $('#leftControl').hide();
      $('#leftControl_disable').show();
    } else {
      $('#leftControl').show();
      $('#leftControl_disable').hide();
    }
  // Cache la fleche "suivant" si on est sur le dernier slide
    if(position==numberOfSlides-1){
      $('#rightControl').hide();
      $('#rightControl_disable').show();
    } else {
      $('#rightControl').show();
      $('#rightControl_disable').hide();
    }
    }

// Cacher la flèche gauche lors du 1er chargement
  manageControls(currentPosition);

//Cr?e un ?couteur d'évènement de type clic sur les classes .control
  $('.control').bind('click', function(){

  // Determine la nouvelle position
    currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;

  // Cache ou montre les controles
    manageControls(currentPosition);

  // Fais bouger le slide
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

});}

