MediaWiki:Centralnotice-template-B1718 1012 frFR dsk p2 sm txt useitalot

<style> /* Hide when editing */ .action-edit .frb, .ve-activated .frb {

   display: none !important;

}

  1. centralNotice.collapsed .frb {
   display: none;

}

/* z-index override for #siteNotice now having .mw-body-content class [1] */

  1. siteNotice {
   z-index: auto;

}

/* z-index override for German Wikipedia */ .mw-body {

   z-index: auto;

}

/* Box-sizing */ .frb, .frb *, .frb *:before, .frb *:after {

   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
   box-sizing: border-box;

}

/* Inline banner styles


*/

  1. frb-inline {
   display: table;
   position: relative;
   text-align: justify;
   background: white;
   color: black;
   font-size: 14px;
   margin-bottom: 28px;
   border: 5px solid #990000;
   -webkit-transition: all .2s ease-in-out;
   -moz-transition:    all .2s ease-in-out;
   -o-transition:      all .2s ease-in-out;
   -ms-transition:     all .2s ease-in-out;
   transition:         all .2s ease-in-out;

}

.frb-inline-main {

   padding: 13px;

}

.frb-inline-message {

   font-size: 16px;
   font-weight: bold;
   line-height: 1.4; /*22.4px @16px*/
   padding: 0 0 8px;
   display: block;

}

.frb-inline-message img {

   height: 16px;
   margin-top: -3px;

}

/* --- Form legends --- */

  1. frb-inline legend {
   width: 100%;
   margin: 0;
   text-align: center;
   color: #7c7c7c;
   font-weight: 500;
   padding: 6px 0 2px 0;

}

.frb-methods legend {

   display: none;

}

  1. frb-inline ul {
   margin: 0;

}

.frb-frequency ul {

   margin-top: 10px !important;

}

  1. frb-inline fieldset {
   width: 100%;
   margin: 0 auto;
   padding: 0;
   border: none;

}

/* --- Common Button Styles --- */

.frb-btn,

  1. frb-amt-other-label {
   display: block;
   min-height: 34px;
   margin: 0 auto;
   padding: 9px 8px 7px 8px;
   background-color: #f8f9fa;
   color: #222;
   border: 1px solid #9aa0a7;
   border-radius: 2px;
   outline: 0;
   text-align: center;
   line-height: 1; /*16px @16px*/
   cursor: pointer;
   font-family: inherit;
   font-weight: 500;
   transition: background 100ms, color 100ms, border-color 100ms, box-shadow 100ms;

} .frb-btn:hover,

  1. frb-amt-other-label:hover {
   background-color: #fff;
   color: #444;
   border-color: #a2a9b1;

} .frb-btn:active,

  1. frb-amt-other-label:active {
   background-color: #d9d9d9;
   color: #000;
   border-color: #7d8389;

}

/*Adjust padding for buttons with logo, e.g. payment methods*/ .frb-btn-logo {

 padding: 2px 8px;

}

.frb-logo-paypal-usd {

   margin-bottom: -6px;

}

.frb-form input[type="radio"]:checked + .frb-btn, .frb-form input[type="radio"]:checked + #frb-amt-other-label, .frb-form .frb-btn.checked {

   background-color: #2a4b8d;
   color: #fff;
   border-color: #7d8389;

}

.frb-btn:focus, .frb-btn-submit:focus,

  1. frb-amt-other-label:focus,
  2. frb-amt-other-input:focus,

.email_input:focus {

   outline: 0;
   border-color: #36c;
   box-shadow: inset 0 0 0 1px #36c;

}

.frb-form input[type=radio]:focus + .frb-btn, .frb-form input[type=radio]:focus + #frb-amt-other-label, .frb-form input[type=radio]:checked + .frb-btn:focus, .frb-form input[type=radio]:checked + #frb-amt-other-label:focus, .frb-form input[type=radio]:checked + #frb-amt-other-label #frb-amt-other-input:focus, .frb-btn-submit:focus {

   box-shadow: inset 0 0 0 1px #36c, inset 0 0 0 2px #fff;

}

.frb-form input[type="radio"]:checked + .frb-btn, .frb-form input[type="radio"]:checked + #frb-amt-other-label, .frb-form .frb-btn.checked {

   background-color: #2a4b8d;
   color: #fff;
   border-color: #7d8389;

}

.frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input {

   background-color: transparent;
   color: #fff;

}

/*Blue buttons*/ .frb-methods .frb-btn,

  1. frb-nag .frb-btn {
 color: #3366cc;

} .frb-methods .frb-btn:active,

  1. frb-nag .frb-btn:active {
 color: #2a4b8d;

}

/* Submit/Continue buttons (blue background) */ .frb-btn-submit {

   width: 100%;
   display: block;
   margin-top: 6px;
   padding: 8px 2px;
   color: #fff;
   background-color: #3366cc;
   border-color: #3366cc;
   cursor: pointer;
   border: 0;
   border-radius: 2px;
   font-size: 14px;
   transition: background 100ms, color 100ms, border-color 100ms, box-shadow 100ms;

} .frb-btn-submit:hover {

   background-color: #447ff5;
   border-color: #447ff5;

} .frb-btn-submit:active {

   background-color: #2a4b8d;
   border-color: #2a4b8d;
   box-shadow: none;

}

/* Hide radio buttons. Based on http://jqueryui.com/button/#radio */ .frb-frequency li input[type="radio"], .frb-amounts li input[type="radio"] {

   position: absolute;
   overflow: hidden;
   height: 1px;
   width: 1px;
   clip: rect(0 0 0 0);
   border: 0;
   margin: -1px;
   padding: 0;

}

/* --- Buttons layout --- */

.frb-frequency ul, .frb-amounts ul, .frb-methods ul {

   display: table;
   table-layout: fixed;
   width: 100%;

}

.frb-frequency ul li, .frb-amounts ul li, .frb-methods ul li {

   display: table-cell;
   vertical-align: top;
   padding: 0 7px 0 0;

}

/* --- Frequency buttons appearance --- */

.frb-frequency li {

   display: table-cell;
   padding: 0 7px 0 0;
   vertical-align: top;

}

.frb-frequency label {

   display: block;
   width: 100%;
   font-size: 15px;

}

/* --- Amount buttons appearance --- */

@media (min-width: 768px) {

   .frb-amounts li label {
       font-size: 15px;
   }

}

/* --- Other amount --- */

  1. frb-amt-other-label {
   padding: 0;

}

  1. frb-amt-other-input {
   margin: 0;
   padding: 6px 6px 7px 6px;
   background: transparent;
   border: none;
   width: 100%;
   font-size: 15px;
   text-align: center;
   direction: ltr;
   -moz-appearance:textfield; /* remove number spinner in Firefox */

}

/* Remove number spinner Safari and Chrome */

  1. frb-amt-other-input::-webkit-inner-spin-button,
  2. frb-amt-other-input::-webkit-outer-spin-button {
 -webkit-appearance: none;
 margin: 0;

}

/* Placeholder styles */

  1. frb-amt-other-input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
   color: #222;

}

  1. frb-amt-other-input:-moz-placeholder { /* Firefox 18- */
   color: #222;
   opacity: 1 !important;

}

  1. frb-amt-other-input::-moz-placeholder { /* Firefox 19+ */
   color: #222;
   opacity: 1 !important;

}

  1. frb-amt-other-input:-ms-input-placeholder { /* IE 10+ */
   color: #222;

}

/* Placeholder checked styles */ .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input::-webkit-input-placeholder { /* Chrome/Opera/Safari */

   color: #fff;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:-moz-placeholder { /* Firefox 18- */

   color: #fff;
   opacity: 1 !important;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input::-moz-placeholder { /* Firefox 19+ */

   color: #fff;
   opacity: 1 !important;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:-ms-input-placeholder { /* IE 10+ */

   color: #fff;

}

/* Placeholder focus styles */ .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:focus::-webkit-input-placeholder { /* Chrome/Opera/Safari */

   color: #CCC;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:focus:-moz-placeholder { /* Firefox 18- */

   color: #CCC;
   opacity: 1 !important;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:focus::-moz-placeholder { /* Firefox 19+ */

   color: #CCC;
   opacity: 1 !important;

} .frb-form input[type="radio"]:checked + #frb-amt-other-label #frb-amt-other-input:focus:-ms-input-placeholder { /* IE 10+ */

   color: #CCC;

}

/* --- Payment method buttons appearance --- */

/* hide methods which aren't monthly capable when monthly option is selected */ .form-monthly .no-monthly {

   display: none !important;

}

.frb-methods .frb-btn {

   width: 100%;
   font-size: 16px;
   font-weight: 500;

}

.frb-methods .frb-btn img {

   display: block;
   margin: 0 auto;
   max-height: 16px;
   max-width: 100%;

}

/* --- Close and RML Options --- */ .frb-inline-topbar {

   width: 100%;
   padding: 2px 10px 5px;
   text-align: center;
   background-color: #990000;
   color: #FFFFFF;
   display: inline-block;
   z-index: 999;

}

.frb-inline-header {

   display: inline-block;
   font-weight: bold;
   font-size: 16px;
   line-height: 1.125; /*18px @16px*/
   padding: 4px 0;

}

body.rtl .frb-inline-header {

   float: right;

}

.frb-inline-window {

   position: relative;
   float: right;
   text-align: right;

}

body.rtl .frb-inline-window {

   float: left;
   text-align: left;

}

.frb-inline-rml-wrapper {

   position: relative;

}

/* --- Close button --- */ .frb-inline-close-bottom-wrapper {

   position: absolute;
   width: 100%;
   bottom: -29px;
   text-align: center;

}

  1. frb-inline-close,

.frb-inline-rml-wrapper {

   padding: 5px 7px;

}

.frb-inline-close {

   z-index: 999;
   color: #999999;

}

.frb-inline-close, .frb-inline-rml-link {

   text-transform: uppercase;
   cursor: pointer;
   line-height: 1.2857142857; /*18px @16px*/

}

.frb-inline-rml-link {

   display: inline-block;
   margin-left: 1px;

}

/* Close button icon */ .frb-inline-close-icon {

   margin-bottom: -2px;
   width: 11px;

}

.frb-inline-close-icon g {

   stroke: #999999;

}

/* RML text color */

.frb-inline-close-txt, .frb-inline-rml-txt {

   font-size: 12px;
   letter-spacing: 0.2px;

}

.frb-inline-rml-txt {

   color: #3366cc;
   font-weight: bold;

}

/* RML clock icon */ .frb-inline-rml-icon {

   margin-bottom: -3px;
   width: 13px;

}

.frb-inline-rml-icon path {

   fill: #3366cc;

}

.frb-inline-rml-icon circle {

   stroke: #3366cc;

}

.frb-inline-rml-link:hover .frb-inline-rml-txt {

   color: #000000;

}

.frb-inline-rml-link:hover .frb-inline-rml-icon path {

   fill: #000000;

}

.frb-inline-rml-link:hover .frb-inline-rml-icon circle {

   stroke: #000000;

}

/* Close hover and focus*/ .frb-inline-close-txt {

   font-size: 12px;

}

.frb-inline-close:hover .frb-inline-close-txt, .frb-inline-close:focus .frb-inline-close-txt, .frb-inline-rml-form-close:hover .frb-inline-rml-form-close-txt, .frb-inline-rml-form-close:focus .frb-inline-rml-form-close-txt {

   color: #000000;

}

.frb-inline-close:hover .frb-inline-close-icon g, .frb-inline-close:focus .frb-inline-close-icon g, .frb-inline-rml-form-close:hover .frb-inline-rml-form-close-icon g, .frb-inline-rml-form-close:focus .frb-inline-rml-form-close-icon g {

   stroke: #000000;

}

/* --- Remind me by email --- */

.frb-inline-rml-link {

   position: relative;
   text-transform: uppercase;
   display: inline-block;
   cursor: pointer;
   color: #666;

}

.frb-inline-rml {

   display: none;
   position: absolute;
   cursor: default;
   padding: 14px 14px 4px 14px;
   top: 34px;
   right: -143px;
   z-index: 10000;
   width: 320px;
   background: #fff;
   color: #000;
   border: 1px solid #aaa;
   border-radius: 2px;
   box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.15);
   text-transform: none;

}

body.rtl .frb-inline-rml {

   left: 49px;
   right: auto;

}

.frb-inline-rml-form:before, .frb-inline-rml-form:after {

   bottom: 100%;
   border: solid transparent;
   content: " ";
   height: 0;
   width: 0;
   position: absolute;
   left: auto;
   right: 148px;
   pointer-events: none;

}

body.rtl .frb-inline-rml-form:before, body.rtl .frb-inline-rml-form:after {

   left: 8px;
   right: auto;

}

.frb-inline-rml-form:before {

   border-bottom-color: #888;
   border-width: 11px;

}

.frb-inline-rml-form:after {

   border-bottom-color: #fff;
   border-width: 10px;
   margin-right: 1px; /*Triangle pixel glitch fix (margin left and right)*/
   margin-left: 0;

}

/*Triangle pixel glitch fix for RTL*/ body.rtl .frb-inline-rml-form:after {

   margin-right: 0;
   margin-left: 1px;

}

.frb-inline-rml-form form {

   display: table;
   width: 100%;
   text-align: center;
   font-weight: 500;

}

.frb-inline-rml-form input {

   direction: ltr;
   background: #fff;
   width: 100%;
   display: block;
   padding: 7px;
   margin: 0;
   font-size: inherit;
   font-family: inherit;
   color: #000;
   border: 1px solid #9aa0a7;
   border-radius: 2px;

}

.frb-inline-rml-form input.error {

   border-color: #ff0000;
   box-shadow: inset 0 0 0 1px #ff0000;

}

.frb-inline-rml-form #errorMessageContainerId {

   color: #cc0000;

} .frb-inline-rml-done {

   text-align: left;
   font-size: 15px;

}

body.rtl .frb-inline-rml-done {

   text-align: right;

}

.frb-inline-rml-form .smallprint {

   margin-top: 5px;
   font-size: 11px;
   color: #555;
   line-height: 1.4;/*15.4px @11px*/

}

.frb-inline-rml-form-close-wrapper {

   padding-top: 4px;
   text-align: center;

}

.frb-inline-rml-form-close {

   margin: 6px auto 0 auto;
   color: #999999;
   font-size: 11px;
   cursor: pointer;

}

.frb-inline-rml-form-close-txt {

   text-transform: uppercase;

}

.frb-inline-rml-form-close-icon {

   width: 9px;
   height: 9px;

}

.frb-inline-rml-form-close-icon g {

   stroke: #999999;

}

/* --- "Nag" --- */ div#frb-nag {

   position: fixed;
   z-index: 999;
   top: 120px;
   color: black;
   background-color: white;
   padding: 5px 10px;
   width: 170px;
   font-size: 13px;
   text-align: center;
   font-weight: bold;
   font-style: normal;
   border: 5px solid #990000;
   border-radius: 3px;
   box-shadow: 1px 2px 6px rgba(0,0,0,.3);
   -webkit-transition: margin .5s ease-in-out;
   -moz-transition:    margin .5s ease-in-out;
   -o-transition:      margin .5s ease-in-out;
   -ms-transition:     margin .5s ease-in-out;
   transition:         margin .5s ease-in-out;

}

body.ltr div#frb-nag {

   left: -1px;
   margin-left: -240px;
   border-left: 0;

} body.rtl div#frb-nag {

   right: -1px;
   margin-right: -240px;
   border-right: 0;

}

body.ltr div#frb-nag.reveal {

   margin-left: 0;

} body.rtl div#frb-nag.reveal {

   margin-right: 0;

}

@media (min-width: 982px) {

   div#frb-nag {
       width: 190px;
   }

}

  1. frb-nag:hover, #frb-nag a:hover {
   text-decoration: none;

}

  1. frb-nag a {
   display: block;
   text-decoration: none;

}

  1. frb-nag a:hover {
   text-decoration: none;

}

  1. frb-nag img {
   display: block;
   margin: 6px auto;
   height: 30px;
   width: 30px;

}

.frb-nag-text {

   font-size: 17px;
   line-height: 1.4; /*23.8px @17px*/
   color: black;

}

.frb-nag-donate {

   display: inline-block;
   margin: 5px 0;
   font-size: 12px;

}

.frb-nag-close:hover {

   opacity: 1;

}

.frb-nag-close {

   display: block;
   position: absolute;
   top: 0;
   right: 5px;
   width: 15px;
   height: 15px;
   background: url('//upload.wikimedia.org/wikipedia/donate/8/84/Close-dark-trilogy.png') no-repeat center center;
   background-size: contain;
   cursor: pointer;
   opacity: 0.8;
   margin: 10px 6px;
   -webkit-transition: all .25s ease-in-out;
   -moz-transition:    all .25s ease-in-out;
   transition:         all .25s ease-in-out;

} body.rtl .frb-nag-close {

   right: auto;
   left: 5px;

}

.frb-nag-close:hover {

   opacity: 1;

}

/* --- Nag RML --- */

.frb-nag-rml-wrapper {

   position: relative;

}

.frb-nag-rml-link {

   padding: 5px;
   display: block;
   color: #2d2d2c;
   font-size: 12px;
   text-transform: uppercase;
   position: relative;
   cursor: pointer;
   z-index: 999;

}

.frb-nag-rml-link:hover {

   text-decoration: underline;

}

.frb-nag-rml {

   position: absolute;
   padding: 13px;
   width: 300px;
   background: #fff;
   border: 1px solid #aaa;
   font-weight: normal;
   border-radius: 2px;
   box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.15);
   color: #000;

}

body.ltr .frb-nag-rml {

   left: 150px;
   -moz-transform:    translateX(-50%);
   -ms-transform:     translateX(-50%);
   -webkit-transform: translateX(-50%);
   transform:         translateX(-50%);

} body.rtl .frb-nag-rml {

   right: 150px;
   -moz-transform:    translateX(50%);
   -ms-transform:     translateX(50%);
   -webkit-transform: translateX(50%);
   transform:         translateX(50%);

}

.frb-nag-rml-form:before, .frb-nag-rml-form:after {

   content: " ";
   position: absolute;
   left: 25%;
   bottom: 100%;
   width: 0;
   height: 0;
   border: solid transparent;

}

body.rtl .frb-nag-rml-form:before, body.rtl .frb-nag-rml-form:after {

   left: auto;
   right: 25%;

}

.frb-nag-rml-form:before {

   border-bottom-color: #888;
   border-width: 11px;
   margin-left: -1px;
   margin-right: -1px;

} .frb-nag-rml-form:after {

   border-bottom-color: #ffffff;
   border-width: 10px;

}

.frb-nag-rml input {

   direction: ltr;
   background: #fff;
   width: 100%;
   display: block;
   font-size: 13px;
   padding: 6px;
   margin: 6px 0 0 0;
   font-size: inherit;
   font-family: inherit;
   color: #000;
   border: 1px solid #9aa0a7;
   border-radius: 2px;

}

.frb-nag-rml input.error {

   border-color: #ff0000;
   box-shadow: inset 0 0 0 2px #ff0000;

}

.frb-nag-rml #errorMessageContainerId {

   color: #ff0000;

}

/* --- Footer / Small Print --- */ .frb-legal {

   margin-top: 11px;
   font-size: 11px;
   line-height: 1.4; /*15.4px @11px*/
   color: #555;

}

.recurring-details {

   display: none;

} </style>

   <a href="#frb-inline">
       <img src="//upload.wikimedia.org/wikipedia/donate/9/99/RedInfoI.svg">
Si chaque personne qui lit ce message donnait %MINIMUM%, cela permettrait à Wikipédia de continuer à prospérer de nombreuses années.
       <button class="frb-btn frb-nag-donate">Donate now</button>
       
   </a>

<script> var frb = frb || {};

/* jshint maxerr: 600 */ frb.amounts = frb.amounts || {};

// Hard minimum amounts that can be given // From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php frb.amounts.minimums = {

   'USD' : 1,
   'CAD' : 1.26,
   'AUD' : 1.29,
   'NZD' : 1.38,
   'GBP' : 0.72,
   'EUR' : 0.84,
   'DKK' : 6.18,
   'HUF' : 303,
   'ILS' : 3.30,
   'INR' : 73,
   'JPY' : 107,
   'MYR' : 4.05,
   'NOK' : 8.52,
   'PLN' : 3.78,
   'RON' : 4.05,
   'SEK' : 8.45,
   'UAH' : 28,
   'ZAR' : 15,
   // Latin America
   'BRL' : 5.62,
   'ARS' : 90,
   'CLP' : 729,
   'COP' : 3660,
   'MXN' : 21,
   'PEN' : 3.63,
   'UYU' : 43,
   'CHF' : 1

};

frb.amounts.options7 = {

   // Big English
   'USD' : [2.75, 10, 16.36, 25, 50, 75, 100],
   'CAD' : [2.75, 10, 15, 25, 50, 75, 100],
   'AUD' : [2.75, 10, 15, 25, 50, 75, 100],
   'NZD' : [2.75, 10, 15, 25, 50, 75, 100],
   'GBP' : [2, 10, 15, 25, 50, 75, 100],
   'EUR' : {
       'default' : [2, 10, 15, 25, 50, 75, 100]
   },
   // Others
   'DKK' : [20, 100, 150, 200, 300, 500, 1000],
   'HUF' : [500, 1000, 2000, 4000, 5000, 7000, 10000],
   'ILS' : [10, 50, 100, 200, 300, 500, 1000],
   'INR' : [75, 300, 500, 1000, 1500, 3000, 5000],
   'JPY' : [300, 1000, 1500, 2000, 3000, 5000, 10000],
   'MYR' : [10, 30, 50, 100, 200, 300, 500],
   'NOK' : [20, 100, 150, 200, 500, 750, 1000],
   'PLN' : [10, 20, 50, 100, 200, 300, 500],
   'RON' : [10, 50, 75, 100, 200, 300, 500],
   'SEK' : [30, 50, 100, 200, 300, 500, 1000],
   'UAH' : [50, 75, 150, 300, 500, 750, 1000],
   'ZAR' : [30, 50, 100, 200, 300, 500, 1000],
   // Latin America
   'BRL' : [10, 20, 30, 50, 100, 200, 300],
   'ARS' : [175, 250, 500, 750, 1000, 1500, 2000],
   'CLP' : [1500, 2500, 5000, 10000, 15000, 25000, 50000],
   'COP' : [7000, 10000, 20000, 50000, 100000, 150000, 200000],
   'MXN' : [40, 70, 150, 250, 500, 700, 1000],
   'PEN' : [10, 15, 25, 50, 75, 100, 200],
   'UYU' : [100, 200, 300, 500, 1000, 1500, 2000],
   'CHF' : [3, 5, 10, 25, 50, 100, 200]

};

// 5 amount options. Since 2020 6C, no longer used frb.amounts.options5 = {

   // Big English
   'USD' : [2.75, 16.36, 20, 50, 100],
   'CAD' : [2.75, 15, 20, 50, 100],
   'AUD' : [2.75, 15, 20, 50, 100],
   'NZD' : [2.75, 15, 20, 50, 100],
   'GBP' : [2, 10, 20, 50, 100],
   'EUR' : [2, 10, 20, 50, 100],
   // Others
   'DKK' : [20, 100, 200, 500, 1000],
   'HUF' : [500, 2500, 4000, 7000, 10000],
   'ILS' : [10, 50, 200, 600, 1000],
   'INR' : [150, 500, 1000, 3000, 5000],
   'JPY' : [300, 1500, 2000, 5000, 10000],
   'MYR' : [10, 50, 100, 300, 500],
   'NOK' : [20, 100, 200, 500, 1000],
   'PLN' : [10, 50, 100, 300, 500],
   'RON' : [10, 50, 100, 200, 1000],
   'SEK' : [30, 100, 200, 500, 1000],
   'UAH' : [50, 150, 300, 750, 1000],
   'ZAR' : [30, 100, 200, 500, 1000],
   // Latin America
   'BRL' : [10, 30, 50, 100, 250],
   'ARS' : [60, 200, 400, 1000, 2000],
   'CLP' : [1500, 5000, 10000, 25000, 50000],
   'COP' : [7000, 20000, 50000, 150000, 200000],
   'MXN' : [35, 100, 200, 750, 1000],
   'PEN' : [10, 50, 150, 300, 700],
   'UYU' : [70, 200, 400, 1500, 2000],
   'CHF' : [3, 10, 25, 50, 100]

};

// "Average" donation frb.amounts.averages = {

   'USD' : 16.36,
   'CAD' : 15,
   'AUD' : 15,
   'NZD' : 15,
   'GBP' : 10,
   'EUR' : 10,
   // Others
   'DKK' : 100,
   'HUF' : 2500,
   'ILS' : 50,
   'INR' : 1000,
   'JPY' : 1500,
   'MYR' : 50,
   'NOK' : 100,
   'PLN' : 50,
   'RON' : 50,
   'SEK' : 100,
   'UAH' : 150,
   'ZAR' : 150,
   // Latin America
   'BRL' : 25,
   'ARS' : 200,
   'CLP' : 8000,
   'COP' : 30000,
   'MXN' : 150,
   'PEN' : 40,
   'UYU' : 300,
   'CHF' : 15

};

// 'If everyone gave X'. Mostly the same as first asks option. frb.amounts.ifEveryone = {

   // Big English
   'USD' : 2.75,
   'CAD' : 2.75,
   'AUD' : 2.75,
   'NZD' : 2.75,
   'GBP' : 2,
   'EUR' : {
       'default' : 2
   },
   // Others
   'DKK' : 20,
   'HUF' : 500,
   'ILS' : 10,
   'INR' : 75,
   'JPY' : 300,
   'MYR' : 10,
   'NOK' : 20,
   'PLN' : 10,
   'RON' : 10,
   'SEK' : 30,
   'UAH' : 50,
   'ZAR' : 30,
   // Latin America
   'BRL' : 10,
   'ARS' : 175,
   'CLP' : 1500,
   'COP' : 7000,
   'MXN' : 40,
   'PEN' : 10,
   'UYU' : 100,
   'CHF' : 3

};

// Minimum fee/PTF amounts. Default is 0.35. // Updated 2018-07-05 based on Ppena's feedback // Updated 2019-05-21 to approx 0.35 USD equivalent frb.amounts.feeMinimums = {

   'DKK' : 2,
   'HUF' : 100,
   'ILS' : 1.2,
   'INR' : 4,
   'JPY' : 35,
   'MYR' : 1,
   'NOK' : 3,
   'PLN' : 1.35,
   'RON' : 1.5,
   'SEK' : 3,
   'UAH' : 10,
   'ZAR' : 5,
   // Latin America
   'BRL' : 2,
   'ARS' : 32,
   'CLP' : 255,
   'COP' : 1300,
   'MXN' : 7.4,
   'PEN' : 1.3,
   'UYU' : 15.5

};

// If one-time amount <= left amount, suggest right amount for monthly frb.amounts.monthlySuggest = {

   'USD' : [ // also CAD, AUD, NZD
       [ 2.74, 0 ],
       [ 9, 1.75 ],
       [ 12, 2 ],
       [ 15, 2.5 ],
       [ 18, 3 ],
       [ 21, 3.5 ],
       [ 24, 4 ],
       [ 27, 4.5 ],
       [ 30, 5 ],
       [ 33, 5.5 ],
       [ 36, 6 ],
       [ 39, 6.5 ],
       [ 42, 7 ],
       [ 45, 7.5 ],
       [ 48, 8 ],
       [ 51, 8.5 ],
       [ 54, 9 ],
       [ 57, 9.5 ],
       [ 60, 10 ],
       [ 63, 10.5 ],
       [ 66, 11 ],
       [ 69, 11.5 ],
       [ 72, 12 ],
       [ 75, 12.5 ],
       [ 102, 17 ],
       [ 250, 25 ],
       [ 480, 50 ],
       [ Infinity, 0 ]
   ],
   'GBP' : [ // also EUR
       [ 1.99, 0 ],
       [ 9, 1.75 ],
       [ 12, 2 ],
       [ 15, 2.5 ],
       [ 18, 3 ],
       [ 21, 3.5 ],
       [ 24, 4 ],
       [ 27, 4.5 ],
       [ 30, 5 ],
       [ 33, 5.5 ],
       [ 36, 6 ],
       [ 39, 6.5 ],
       [ 42, 7 ],
       [ 45, 7.5 ],
       [ 48, 8 ],
       [ 51, 8.5 ],
       [ 54, 9 ],
       [ 57, 9.5 ],
       [ 60, 10 ],
       [ 63, 10.5 ],
       [ 66, 11 ],
       [ 69, 11.5 ],
       [ 72, 12 ],
       [ 75, 12.5 ],
       [ 102, 17 ],
       [ 250, 25 ],
       [ 480, 50 ],
       [ Infinity, 0 ]
   ],
   'INR' : [
       [ 300, 150 ],
       [ 500, 175 ],
       [ 1000, 250 ],
       [ 1500, 350 ],
       [ 3000, 500 ],
       [ 5000, 750 ],
       [ 10000, 1000 ],
       [ 25000, 2500 ],
       [ Infinity, 5000 ]
   ],
   'JPY' : [
       [ 1000, 300 ],
       [ 1500, 450 ],
       [ 2000, 500 ],
       [ 3000, 700 ],
       [ 5000, 900 ],
       [ 10000, 1100 ],
       [ 25000, 2500],
       [ 50000, 5000],
       [ 100000, 12000],
       [ 250000, 25000],
       [ 500000, 50000],
       [ 750000, 75000],
       [ Infinity, 100000]
   ],
   'SEK' : [
       [ 50, 25 ],
       [ 100, 30 ],
       [ 200, 50 ],
       [ 300, 70 ],
       [ 500, 90 ],
       [ 1000, 110 ],
       [ 2500, 250 ],
       [ 5000, 500 ],
       [ Infinity, 1000 ]
   ]

}; frb.amounts.monthlySuggest.EUR = frb.amounts.monthlySuggest.GBP; frb.amounts.monthlySuggest.CAD = frb.amounts.monthlySuggest.USD; frb.amounts.monthlySuggest.AUD = frb.amounts.monthlySuggest.USD; frb.amounts.monthlySuggest.NZD = frb.amounts.monthlySuggest.USD;

frb.currencyFormats = {

   'USD' : '$\t',
   'CAD' : {
       'fr' : '$\t',
       'default' : '$\t'
   },
   'AUD' : '$\t',
   'NZD' : '$\t',
   'GBP' : '£\t',
   'EUR' : {
       'en' : '€\t',
       'cy' : '€\t',
       'ga' : '€\t',
       'mt' : '€\t',
       'nl' : '€ \t',
       'lv' : '€ \t',
       'tr' : '€ \t',
       'default' : '\t €'
   },
   // Others
   'DKK' : '\t kr.',
   'HUF' : '\t Ft',
   'ILS' : {
       'he' : '\t ₪',
       'yi' : '\t ₪',
       'ar' : '\t ₪',
       'default' : '₪ \t'
   },
   'INR' : '₹ \t',
   'JPY' : '¥\t',
   'MYR' : 'RM\t',
   'NOK' : '\t kr',
   'PLN' : '\t zł',
   'RON' : '\t lei',
   'SEK' : '\t kr',
   'UAH' : '₴\t',
   'ZAR' : 'R \t',
   // Latin America
   'BRL' : {
   	'en' : 'R$\t',
   	'default' : 'R$ \t'
   },
   'ARS' : '$\t',
   'CLP' : '$\t',
   'COP' : '$\t',
   'MXN' : '$\t',
   'PEN' : 'S/. \t',
   'UYU' : '$U \t',
   'CHF' : '\t CHF'

};

// Check in user language first, then fall back to English frb.countryNames = {

   'en' : {
       'US' : 'the U.S.',
       'CA' : 'Canada',
       'GB' : 'the UK',
       'IE' : 'Ireland',
       'AU' : 'Australia',
       'NZ' : 'New Zealand',
       'AR' : 'Argentina',
       'AT' : 'Austria',
       'BE' : 'Belgium',
       'BR' : 'Brazil',
       'CH' : 'Switzerland',
       'CL' : 'Chile',
       'CO' : 'Colombia',
       'DK' : 'Denmark',
       'ES' : 'Spain',
       'FR' : 'France',
       'HK' : 'Hong Kong',
       'HU' : 'Hungary',
       'IL' : 'Israel',
       'IN' : 'India',
       'IT' : 'Italy',
       'JP' : 'Japan',
       'LU' : 'Luxembourg',
       'LV' : 'Latvia',
       'MX' : 'Mexico',
       'MY' : 'Malaysia',
       'NL' : 'the Netherlands',
       'NO' : 'Norway',
       'PE' : 'Peru',
       'PL' : 'Poland',
       'PT' : 'Portugal',
       'RO' : 'Romania',
       'SE' : 'Sweden',
       'SK' : 'Slovakia',
       'UA' : 'Ukraine',
       'UY' : 'Uruguay',
       'ZA' : 'South Africa'
   },
   'ca' : {
       'AT' : 'd’Àustria',
       'BE' : 'de Bèlgica',
       'DK' : 'de Dinamarca',
       'ES' : 'd’Espanya',
       'HU' : 'd’Hongria',
       'IL' : 'd’Israel',
       'LV' : 'de Letònia',
       'LU' : 'de Luxemburg',
       'MY' : 'de Malàisia',
       'NO' : 'de Noruega',
       'PL' : 'de Polònia',
       'PT' : 'de Portugal',
       'RO' : 'de Romania',
       'SK' : 'd’Eslovàquia',
       'ZA' : 'de Sud-àfrica',
       'UA' : 'd’Ucraïna'
   },
   'es' : {
       'MX' : 'México',
       'PE' : 'Perú',
       'ES' : 'España'
   },
   'da' : {
       'AT' : 'i Østrig',
       'BE' : 'i Belgien',
       'DK' : 'i Danmark',
       'HU' : 'i Ungarn',
       'IL' : 'i Israel',
       'LV' : 'i Letland',
       'LU' : 'i Luxembourg',
       'MY' : 'i Malaysia',
       'NO' : 'i Norge',
       'PL' : 'i Polen',
       'PT' : 'i Portugal',
       'RO' : 'i Rumænien',
       'SK' : 'i Slovakiet',
       'ZA' : 'i Sydafrika',
       'UA' : 'i Ukraine'
   },
   'nl' : {
       'NL' : 'in Nederland',
       'AT' : 'in Oostenrijk',
       'BE' : 'in België',
       'DK' : 'in Denemarken',
       'HU' : 'in Hongarije',
       'IL' : 'in Israël',
       'LV' : 'in Letland',
       'LU' : 'in Luxemburg',
       'MY' : 'in Maleisië',
       'NO' : 'in Noorwegen',
       'PL' : 'in Polen',
       'PT' : 'in Portugal',
       'RO' : 'in Roemenië',
       'SK' : 'in Slowakije',
       'ZA' : 'in Zuid-Afrika',
       'UA' : 'in Oekraïne'
   },
   'fr' : {
       'AT' : 'en Autriche',
       'BE' : 'en Belgique',
       'CH' : 'en Suisse',
       'DK' : 'au Danemark',
       'HU' : 'en Hongrie',
       'IL' : 'en Israël',
       'LV' : 'en Lettonie',
       'LU' : 'au Luxembourg',
       'MY' : 'en Malaisie',
       'NO' : 'en Norvège',
       'PL' : 'en Pologne',
       'PT' : 'au Portugal',
       'RO' : 'en Roumanie',
       'SK' : 'en Slovaquie',
       'ZA' : 'en Afrique du Sud',
       'UA' : 'en Ukraine'
   },
   'de' : {
       'AT' : 'in Österreich',
       'BE' : 'in Belgien',
       'CH' : 'in der Schweiz',
       'DK' : 'in Dänemark',
       'HU' : 'in Ungarn',
       'IL' : 'in Israel',
       'LV' : 'in Lettland',
       'LU' : 'in Luxemburg',
       'MY' : 'in Malaysia',
       'NO' : 'in Norwegen',
       'PL' : 'in Polen',
       'PT' : 'in Portugal',
       'RO' : 'in Rumänien',
       'SK' : 'in der Slowakei',
       'ZA' : 'in Südafrika',
       'UA' : 'in der Ukraine'
   },
   'he' : {
       'AT' : 'באוסטרליה',
       'BE' : 'בבלגיה',
       'DK' : 'בדנמרק',
       'ES' : 'בספרד',
       'HU' : 'בהונגריה',
       'IL' : 'בישראל',
       'LV' : 'בלטביה',
       'LU' : 'בלוקסמבורג',
       'MY' : 'במלזיה',
       'NO' : 'בנורווגיה',
       'PL' : 'בפולין',
       'PT' : 'בפורטוגל',
       'RO' : 'ברומניה',
       'SK' : 'בסלובקיה',
       'ZA' : 'בדרום אפריקה',
       'UA' : 'באוקראינה'
   },
   'hu' : {
       'AT' : 'ausztriai',
       'BE' : 'belgiumi',
       'DK' : 'dániai',
       'HU' : 'magyarországi',
       'IL' : 'izraeli',
       'LV' : 'lettországi',
       'LU' : 'luxemburgi',
       'MY' : 'malajziai',
       'NO' : 'norvégiai',
       'PL' : 'lengyelországi',
       'PT' : 'portugáliai',
       'RO' : 'romániai',
       'SK' : 'szlovákiai',
       'ZA' : 'dél-afrikai',
       'UA' : 'ukrajnai'
   },
   'it' : {
       'IT' : 'Italia',
       'CH' : 'Svizzera'
   },
   'lv' : {
       'AT' : 'valstī Austrijā',
       'BE' : 'valstī Beļģijā',
       'DK' : 'valstī Dānijā',
       'HU' : 'valstī Ungārijā',
       'IL' : 'Izraēlas valstī',
       'LV' : 'valstī Latvijā',
       'LU' : 'valstī Luksemburgā',
       'MY' : 'valstī Malaizijā',
       'NO' : 'valstī Norvēģijā',
       'PL' : 'valstī Polijā',
       'PT' : 'valstī Portugālē',
       'RO' : 'valstī Rumānijā',
       'SK' : 'valstī Slovākijā',
       'ZA' : 'Dienvidāfrikas valstī',
       'UA' : 'valstī Ukrainā'
   },
   'nb' : {
       'AT' : 'i Østerrike',
       'BE' : 'i Belgia',
       'DK' : 'i Danmark',
       'HU' : 'i Ungarn',
       'IL' : 'i Israel',
       'LV' : 'i Latvia',
       'LU' : 'i Luxembourg',
       'MY' : 'i Malaysia',
       'NO' : 'i Norge',
       'PL' : 'i Polen',
       'PT' : 'i Portugal',
       'RO' : 'i Romania',
       'SK' : 'i Slovakia',
       'ZA' : 'i Sør-Afrika',
       'UA' : 'i Ukraina'
   },
   'pl' : {
       'AT' : 'w Austrii',
       'BE' : 'w Belgii',
       'DK' : 'w Danii',
       'HU' : 'na Węgrzech',
       'IL' : 'w Izraelu',
       'LV' : 'na Łotwie',
       'LU' : 'w Luksemburgu',
       'MY' : 'w Malezji',
       'NO' : 'w Norwegii',
       'PL' : 'w Polsce',
       'PT' : 'w Portugalii',
       'RO' : 'w Rumunii',
       'SK' : 'na Słowacji',
       'ZA' : 'w Republice Południowej Afryki',
       'UA' : 'na Ukrainie'
   },
   'pt' : {
       'AT' : 'na Áustria',
       'BE' : 'na Bélgica',
       'DK' : 'na Dinamarca',
       'HU' : 'na Hungria',
       'IL' : 'em Israel',
       'LV' : 'na Letónia',
       'LU' : 'no Luxemburgo',
       'MY' : 'na Malásia',
       'NO' : 'na Noruega',
       'PL' : 'na Polónia',
       'PT' : 'em Portugal',
       'RO' : 'na Roménia',
       'SK' : 'na Eslováquia',
       'ZA' : 'na África do Sul',
       'UA' : 'na Ucrânia'
   },
   'ro' : {
       'AT' : 'din Austria',
       'BE' : 'din Belgia',
       'DK' : 'din Danemarca',
       'HU' : 'din Ungaria',
       'IL' : 'din Israel',
       'LV' : 'din Latvia',
       'LU' : 'din Luxemburg',
       'MY' : 'din Malaezia',
       'NO' : 'din Norvegia',
       'PL' : 'din Polonia',
       'PT' : 'din Portugalia',
       'RO' : 'din România',
       'SK' : 'din Slovacia',
       'ZA' : 'din Africa de Sud',
       'UA' : 'din Ucraina'
   },
   'ru' : {
       'AT' : 'в Австрии',
       'BE' : 'в Бельгии',
       'DK' : 'в Дании',
       'HU' : 'в Венгрии',
       'IL' : 'в Израиле',
       'LV' : 'в Латвии',
       'LU' : 'в Люксембурге',
       'MY' : 'в Малайзии',
       'NO' : 'в Норвегии',
       'PL' : 'в Польше',
       'PT' : 'в Португалии',
       'RO' : 'в Румынии',
       'SK' : 'в Словакии',
       'ZA' : 'в Южной Африке',
       'UA' : 'в Украине'
   },
   'sk' : {
       'AT' : 'v Rakúsku',
       'BE' : 'v Belgicku',
       'DK' : 'v Dánsku',
       'HU' : 'v Maďarsku',
       'IL' : 'v Izraeli',
       'LV' : 'v Lotyšsku',
       'LU' : 'v Luxembursku',
       'MY' : 'v Malajzii',
       'NO' : 'v Nórsku',
       'PL' : 'v Poľsku',
       'PT' : 'v Portugalsku',
       'RO' : 'v Rumunsku',
       'SK' : 'na Slovensku',
       'ZA' : 'v Juhoafrickej republike',
       'UA' : 'na Ukrajine'
   },
   'sv' : {
       'SE' : 'i Sverige'
   },
   'uk' : {
       'AT' : 'у Австрії',
       'BE' : 'у Бельгії',
       'DK' : 'у Данії',
       'HU' : 'в Угорщині',
       'IL' : 'в Ізраїлі',
       'LV' : 'у Латвії',
       'LU' : 'у Люксембургу',
       'MY' : 'у Малайзії',
       'NO' : 'у Норвегії',
       'PL' : 'у Польщі',
       'PT' : 'у Португалії',
       'RO' : 'у Румунії',
       'SK' : 'у Словаччині',
       'ZA' : 'у ПАР',
       'UA' : 'в Україні'
   }

};

frb.dayNames = {

   'en' : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
   'ca' : [ 'diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte' ],
   'ja' : [ '日', '月', '火', '水', '木', '金', '土' ],
   'es' : [ 'domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado' ],
   'sv' : [ 'söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag' ],
   'da' : [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
   'nb' : [ 'søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag' ],
   'it' : [ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato' ],
   'nl' : [ 'zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag' ],
   'fr' : [ 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi' ],
   'de' : [ 'Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag' ],
   'he' : [ 'ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת' ],
   'lv' : [ 'svētdienā', 'pirmdienā', 'otrdienā', 'trešdienā', 'ceturtdienā', 'piektdienā', 'sestdienā' ],
   'pl' : [ 'niedzielę', 'poniedziałek', 'wtorek', 'środę', 'czwartek', 'piątek', 'sobotę' ],
   'ru' : [ 'воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу' ],
   'uk' : [ 'неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниц', 'суботи' ],
   'hu' : [ 'vasárnapon', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton' ],
   'ro' : [ 'duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă' ],
   'aa' : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]

};

// "This fooday" translations. Needed for some languages where gender varies and "this" must agree frb.dayNamesThis = {

   'en' : [ 'this Sunday', 'this Monday', 'this Tuesday', 'this Wednesday', 'this Thursday', 'this Friday', 'this Saturday' ],
   'jp' : [ 'この日曜日', 'この月曜日', 'この火曜日', 'この水曜日', 'この木曜日', 'この金曜日', 'この土曜日' ],
   'it' : [ 'questa domenica', 'questo lunedì', 'questo martedì', 'questo mercoledì', 'questo giovedì', 'questo venerdì', 'questo sabato'],
   'pl' : [ 'w tę niedzielę', 'w ten poniedziałek', 'w ten wtorek', 'w tę środę', 'w ten czwartek', 'w ten piątek', 'w tę sobotę' ],
   'ru' : [ 'в это воскресенье', 'в этот понедельник', 'в этот вторник', 'в эту среду', 'в этот четверг', 'в эту пятницу', 'в эту субботу' ],
   'uk' : [ 'цієї неділі', 'цього понеділка', 'цього вівторка', 'цієї середи', 'цього четверга', 'цієї п’ятниці', 'цієї суботи' ],
   'pt' : [ 'neste domingo', 'nesta segunda-feira', 'nesta terça-feira', 'nesta quarta-feira', 'nesta quinta-feira', 'nesta sexta-feira', 'neste sábado'],
   'sk' : [ 'túto nedeľu', 'tento pondelok', 'tento utorok', 'túto stredu', 'tento štvrtok', 'tento piatok', 'túto sobotu']

};

frb.iPadTranslations = {

   'en' : 'iPad'

}; /* MediaWiki:FundraisingBanners/CoreJS-2017.js

* Core code for banner forms
*/

var frb = frb || {};

/**

* Main function to submit to paymentswiki
*
* @param  {Object} options
* - method (required)
* - submethod (optional)
* - gateway (optional)
* - ffname (optional)
* - skipValidation (optional boolean, for pp-usd. Not yet implemented.)
*/

frb.submitForm = function(options) {

   var form = document.getElementById('frb-form');
   var uri = new mw.Uri('https://payments.wikimedia.org/index.php/Special:GatewayFormChooser');
   var params = {};
   /* Form selection data */
   params.payment_method = options.method;
   if ( options.submethod ) {
       params.payment_submethod = options.submethod;
   }
   if ( options.gateway ) {
       params.gateway = options.gateway;
   }
   if ( options.ffname ) {
       params.ffname = options.ffname;
   }
   if ( options.variant ) {
       params.variant = options.variant;
   }
   params.recurring = frb.getRecurring(form);
   params.currency_code = frb.getCurrency(mw.centralNotice.data.country) || 'USD';
   params.uselang = mw.centralNotice.data.uselang || 'en';
   params.country = mw.centralNotice.data.country || 'XX';
   if ( params.uselang === 'pt' && params.country === 'BR' ) {
       params.uselang = 'pt-br';
   }
   if ( params.uselang === 'es' && 
       ( params.country === 'AR' || params.country === 'CL' || 
         params.country === 'CO' || params.country === 'MX' || 
         params.country === 'PE' || params.country === 'UY' )
   ) {
       params.uselang = 'es-419';
   }
   /* Adyen override. frb.ccAdyenCountries is defined in LocalizeJS-2017.js */
   if ( params.payment_method === 'cc' && frb.ccAdyenCountries.indexOf( params.country ) !== -1 ) {
       params.gateway = 'adyen';
   }
   /* Amount */
   var amount = frb.getAmount(form);
   // See if "Pay the fee" is checked
   if ( $('#frb-ptf-checkbox').prop('checked') ) {
       amount = amount + frb.calculateFee(amount);
   }
   if ( !frb.validateAmount(amount) ) {
       return false; // Amount problem, bail out of submitting
   }
   params.amount = amount;
   /* Tracking info */
   params.utm_medium   = 'sitenotice';
   params.utm_campaign = mw.centralNotice.data.campaign || 'test';
   params.utm_source   = frb.buildUtmSource(params);
   // No longer used since we have banner history, could use to store something else
   // params.utm_key   = mw.centralNotice.bannerData.cookieCount || 0;
   /* Link to Banner History if enabled */
   var mixins = mw.centralNotice.getDataProperty( 'mixins' );
   if ( mixins && mixins.bannerHistoryLogger ) {
       params.bannerhistlog = mw.centralNotice.bannerHistoryLogger.id;
   }
   uri.extend(params);
   if ( mixins && mixins.bannerHistoryLogger ) {
       mw.centralNotice.bannerHistoryLogger.ensureLogSent().always(function() {
           window.location.href = uri.toString();
       });
   } else {
       window.location.href = uri.toString();
   }

};

/**

* Build the utm_source for analytics.
*
* Own function so it can be overriden for weird tests
*
* @param  {Object} params
* @return {string} utm_source
*/

frb.buildUtmSource = function(params) {

   var utm_source;
   var fullDottedPaymentMethod = params.payment_method;
   if ( params.recurring ) {
       fullDottedPaymentMethod = 'r' + fullDottedPaymentMethod;
   }
   if ( params.payment_submethod ) {
       fullDottedPaymentMethod = fullDottedPaymentMethod + '.' + params.payment_submethod;
   }
   utm_source = mw.centralNotice.data.banner;
   utm_source += '.no-LP.' + fullDottedPaymentMethod;
   return utm_source;

};

/**

* Determine if we should show recurring choice on step 2
* @param  {Object} options     Including method and optional gateway
* @param  {String} country
* @return {boolean}
*/

frb.shouldShowRecurring = function(options, country) {

   if ( frb.noRecurringCountries.indexOf( country ) !== -1 ) { // Defined in LocalizeJS-2017.js
       return false;
   }
   if ( options.method === 'paypal' ) {
       return true;
   }
   if ( options.method === 'cc' ) {
       if ( options.gateway === 'adyen' || frb.ccAdyenCountries.indexOf( country ) !== -1 ) { // Defined in LocalizeJS-2017.js
           return false;
       } else {
           return true;
       }
   }
   return false;

};

/* Is recurring method selected?

*
* Own function so can be overriden for different forms
*/

frb.getRecurring = function(form) {

   return form.frequency.value === 'monthly';

};

/**

* Return amount selected
*/

frb.getAmount = function(form) {

   var amount = null;
   // If there are some amount radio buttons, then look for the checked one
   if (form.amount) {
       for (var i = 0; i < form.amount.length; i++) {
           if (form.amount[i].checked) {
               amount = form.amount[i].value;
           }
       }
   }
   // Check the "other" amount box
   if (form.otherAmount.value !== ) {
       var otherAmount = form.otherAmount.value;
       otherAmount = otherAmount.replace(/[,.](\d)$/, ':$10');
       otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, ':$1$2');
       otherAmount = otherAmount.replace(/[$£€¥,.]/g, );
       otherAmount = otherAmount.replace(/:/, '.');
       amount = otherAmount;
   }
   amount = parseFloat(amount);
   if ( isNaN(amount) ) {
       return 0;
   } else {
       return amount;
   }

};

/**

* Check if given amount is valid i.e. a positive number, between minimum and maximum.
* If not, show an error and return false.
*
* @param  {number}  amount [description]
* @return {boolean}        [description]
*/

frb.validateAmount = function( amount ) {

   var currency  = frb.getCurrency( mw.centralNotice.data.country );
   var minAmount = frb.amounts.minimums[ currency ];
   var errorMessage;
   if ( amount === null || isNaN(amount) || amount <= 0 || amount < minAmount ) {
       errorMessage = "Please select an amount (minimum $1)"
           .replace( '$1', minAmount + ' ' + currency );
       window.alert( errorMessage );
       return false;
   } else if ( amount > 10000 * minAmount ) {
       errorMessage = "We cannot accept donations greater than USD $4 ($1 $2) through our website. Please contact our major gifts staff at $3."
           .replace( '$1', 10000*minAmount )
           .replace( '$2', currency )
           .replace( '$3', 'benefactors@wikimedia.org' );
       window.alert( errorMessage );
       return false;
   } else {
       return true;
   }

};

/**

* Shared code for amount input handling
*/

frb.initAmountOptions = function() {

   // Reset "Other" input if user clicks a preset amount
   $('#frb-form [id^=frb-amt-ps]').click(function() {
       $('#frb-amt-other-input').val();
   });
   // Block typing non-numerics in input field, otherwise Safari allows them and then chokes
   // https://phabricator.wikimedia.org/T118741, https://phabricator.wikimedia.org/T173431
   document.getElementById('frb-amt-other-input').onkeypress = function(e) {
       // Allow special keys in Firefox
       if ((e.code == 'ArrowLeft') || (e.code == 'ArrowRight') ||
           (e.code == 'ArrowUp') || (e.code == 'ArrowDown') ||
           (e.code == 'Delete') || (e.code == 'Backspace')) {
           return;
       }
       var chr = String.fromCharCode(e.which);
       if ("0123456789., ".indexOf(chr) === -1) {
           return false;
       }
   };

}; /* End of MediaWiki:FundraisingBanners/CoreJS-2017.js */ /* jshint maxerr: 600 */ /* == MediaWiki:FundraisingBanners/LocalizeJS-2017.js == */

/**

* Get the currency for a given country
*
* NOTE: The following currency mapping is WMF-specific based on payment
* provider availability, NOT necessarily the official currency of the country
*
* @param  {string} country code
* @return {string} currency code
*/

frb.getCurrency = function(country) {

   switch ( country ) {
       // Big 6
       case 'US': return 'USD';
       case 'CA': return 'CAD';
       case 'AU': return 'AUD';
       case 'NZ': return 'NZD';
       case 'GB': return 'GBP';
       case 'IE': return 'EUR';
       // Euro countries
       case 'AT':
       case 'BE':
       case 'ES':
       case 'FR':
       case 'IE':
       case 'IT':
       case 'LU':
       case 'LV':
       case 'NL':
       case 'PT':
       case 'SK':
           return 'EUR';
       // Others
       case 'DK': return 'DKK';
       case 'HU': return 'HUF';
       case 'IL': return 'ILS';
       case 'IN': return 'INR';
       case 'JP': return 'JPY';
       case 'MY': return 'MYR';
       case 'NO': return 'NOK';
       case 'PL': return 'PLN';
       case 'RO': return 'RON';
       case 'SE': return 'SEK';
       case 'UA': return 'UAH';
       case 'ZA': return 'ZAR';
       // Latin America
       case 'BR': return 'BRL';
       case 'AR': return 'ARS';
       case 'CL': return 'CLP';
       case 'CO': return 'COP';
       case 'MX': return 'MXN';
       case 'PE': return 'PEN';
       case 'UY': return 'UYU';
       case 'CH': return 'CHF';
       // Fall back to USD
       default:
           return 'USD';
   }

};

/**

* Format a currency value
*
* @param  {string} currency code. Leave undefined to get without symbol.
* @param  {number} amount
* @param  {string} language code
* @return {string} formatted string e.g. '$3', '£5', '10 €'
*/

frb.formatCurrency = function(currency, amount, language) {

   var locale, formatterOptions, formatter, fmAmount, supportsIntl;
   if ( isNaN(amount) || amount ===  ) {
       // Not a number, it's probably the 'other' string or box
       // TODO: better way of doing this?
       fmAmount = amount;
   } else {
       // Check browser support
       try {
           supportsIntl = typeof window.Intl === 'object';
       } catch (e) {
           supportsIntl = false; // T265396
       }
       if ( supportsIntl ) {
           // Use Intl for fancy number formatting - thousands separators etc
           locale = language + '-' + mw.centralNotice.data.country;
           if ( amount % 1 !== 0 ) {
               formatterOptions = { minimumFractionDigits: 2 };
           } else {
               formatterOptions = {};
           }
           formatter = new Intl.NumberFormat(locale, formatterOptions);
       } else {
           // Bad browser i.e. IE. Just do the basics: 2 decimal places if needed, or none
           formatter = {};
           formatter.format = function(number) {
               if ( amount % 1 !== 0 ) {
                   return number.toFixed(2);
               } else {
                   return number.toString();
               }
           };
       }
       fmAmount = formatter.format(amount);
   }
   // No symbol needed
   if ( currency === undefined ) {
       return fmAmount;
   }
   // Better dive into the formatting object
   if ( frb.currencyFormats[currency] === undefined ) {
       return currency + ' ' + fmAmount;
   }
   if ( frb.currencyFormats[currency] instanceof Object ) { // not a string
       if ( frb.currencyFormats[currency][language] !== undefined ) {
           return frb.currencyFormats[currency][language].replace('\t', fmAmount);
       }
       return frb.currencyFormats[currency]['default'].replace('\t', fmAmount);
   }
   return frb.currencyFormats[currency].replace('\t', fmAmount);

};

/*

* Select the correct amount or array of amounts from object in "source"
*
* @param {Object} source   - the amounts data object e.g. frb.amounts.options7, frb.amounts.averages
* @param {string} currency - ISO code of currency
* @param {string} country  - ISO code of country (optional)
* @return {array/number}   - depending on source
*/

frb.pickAmounts = function(source, currency, country) {

   if ( source[currency]['default'] ) { // we need to go deeper
       if ( source[currency][country] !== undefined ) {
           return source[currency][country];
       } else {
           return source[currency]['default'];
       }
   } else {
       return source[currency];
   }

};

/* Credit card types so we can show the correct logos */ frb.cardTypes = {

   // Big 6
   'US' : 'vmad',
   'CA' : 'vma',
   'GB' : 'vmaj',
   'IE' : 'vmaj',
   'AU' : 'vmaj',
   'NZ' : 'vma',
   // Euro countries
   'AT' : 'vmaj',
   'BE' : 'vmaj',
   'ES' : 'vmaj',
   'FR' : 'vma', // Adyen
   'IT' : 'vmaj',
   'LU' : 'vmaj',
   'LV' : 'vma',
   'NL' : 'vmaj', // Adyen
   'PT' : 'vmaj',
   'SK' : 'vmaj',
   // Others
   'DK' : 'vma',
   'HU' : 'vma',
   'IL' : 'vmad', // Adyen
   'JP' : 'vmaj',
   'MY' : 'vmaj',
   'NO' : 'vma',
   'PL' : 'vma',
   'RO' : 'vma',
   'SE' : 'vma',
   'UA' : 'vma', // Adyen
   'ZA' : 'vm',
   'IN' : 'vmar' // dLocal

};

/**

* Display the correct payment methods for current country
*
* Methods should be labeled with class 'frb-pm-xxxx'
* TODO: clean this function up more
*
* @param  {string} country
*/

frb.localizeMethods = function(country) {

   // Hide recurring completely for some countries
   if ( frb.noRecurringCountries.indexOf(country) !== -1 ) {
       $('.frb-frequency, .recurring-details').hide();
   }
   // Remove any leftover WorldPay and Adyen
   $('.frb-pm-cc-wp').remove();
   $('.frb-pm-cc-adyen').remove();
   // Monthly Adyen credit card is allowed now
   // if ( frb.ccAdyenCountries.indexOf( country ) !== -1 ) {
   //     $('.frb-pm-cc').addClass('no-monthly');
   // }
   // Countries with no PayPal option
   var noPP = ['IN', 'RU', 'SG', 'AE', 'QA', 'OM', 'BD', 'BO', 'PA',
               'PY', 'GT', 'JM', 'TT', 'DZ'];
   if ($.inArray(country, noPP) !== -1) {
       $('.frb-pm-pp').remove();
       $('.frb-pm-pp-usd').remove();
   }
   // Countries with no PayPal for mobile only - https://phabricator.wikimedia.org/T173001
   var noPPmobile = ['PH', 'ID', 'TH', 'KR', 'MY', 'VN'];
   var mobileRegex = /(_mob_|_ipd_|_m_)/;
   if ($.inArray(country, noPPmobile) !== -1) {
       if (mw.centralNotice.data.banner.search(mobileRegex) !== -1) {
           $('.frb-pm-pp').remove();
           $('.frb-pm-pp-usd').remove();
       }
   }
   // Countries where PayPal must be in USD
   var ppUSD = ['BG', 'HR', 'LT', 'MK', 'RO', 'UA', 'SA', 'CN', 'ID', 'KR',
                'KZ', 'MY', 'VN', 'AR', 'CL', 'DO', 'CO', 'NI', 'UY', 'ZA',
                'BH', 'LB', 'VE', 'TR', 'IS', 'BA', 'MV', 'BB', 'BM', 'BZ',
                'CR', 'CW', 'SX', 'HN', 'KN', 'DM', 'AG', 'LC', 'GD', 'FJ',
                'TN', 'BJ', 'BF', 'CI', 'GW', 'ML', 'NE', 'SN', 'TG', 'BR',
                'PE'];
   if ($.inArray(country, ppUSD) !== -1) {
       $('.frb-pm-pp').remove();
       $('.frb-pm-pp-usd').show();
   } else {
       $('.frb-pm-pp').show();
       $('.frb-pm-pp-usd').remove();
   }
   // Show any extra local payment methods, or remove them if not needed
   var extrapaymentmethods = {
       'amazon'   : ['US'],
       'bpay'     : [],
       'ideal'    : ['NL'],
       'bt'       : ['BR', 'AR', 'CO', 'CL', 'IN'], // Bank Transfer (Astropay)
       'cash'     : ['BR', 'MX', 'AR', 'CO', 'UY']  // 'Cash' methods (Astropay)
   };
   // Methods with different labels per country
   var language = mw.config.get('wgUserLanguage');
   var cashTranslation = 'Cash';
   var btTranslation = 'Bank Transfer';
   if (language === 'en') {
       if (country === 'BR') {
           cashTranslation = 'Boletos';
       }
       if (country === 'UY') {
           cashTranslation = 'RedPagos';
       }
   } else if (language === 'pt') {
       if (country === 'BR') {
           btTranslation   = 'Transferência Bancária';
           cashTranslation = 'Boletos';
       }
   } else if (language === 'es') {
       if (country === 'AR') {
           btTranslation   = 'Transferencia Bancaria';
           cashTranslation = 'Efectivo';
       }
       if (country === 'CL') {
           btTranslation   = 'WebPay';
       }
       if (country === 'CO') {
           btTranslation   = 'PSE Pagos';
           cashTranslation = 'Efectivo';
       }
       if (country === 'MX') {
           cashTranslation = 'Efectivo';
       }
       if (country === 'UY') {
           cashTranslation = 'RedPagos';
       }
   }
   $('.frb-pm-bt button,   .frb-pm-bt label,   button.frb-pm-bt'  ).text( btTranslation );
   $('.frb-pm-cash button, .frb-pm-cash label, button.frb-pm-cash').text( cashTranslation );
   for (var method in extrapaymentmethods) {
       var $methodbutton = $('.frb-pm-' + method);
       if ( $.inArray(country, extrapaymentmethods[method]) !== -1 ) { // country is in the list
           $methodbutton.show();
       } else {
           $methodbutton.remove();
       }
   }
   /* Add card types class to credit card button, so we can show correct logos */
   if ( frb.cardTypes[country] ) {
       $('.frb-pm-cc').addClass('frb-cctypes-' + frb.cardTypes[country] );
   }

};

/**

* Check scheduled payment method outages and hide buttons if needed
*
* Data at https://meta.wikimedia.org/wiki/MediaWiki:FR2013/Resources/PaymentOutages.js
* Methods should be labeled with class 'frb-pm-xxxx'
*
* @param  {string} country code
*/

frb.checkMethodOutages = function(country) {

   // TODO - can we load this a better way?
   /* This file can be used to schedule hiding of individual payment methods from banners
* e.g. if they have scheduled downtime.
*
* Valid methods are:
*	ideal, cc, pp, amazon, bpay, webmoney, cash, pp-usd
* (most of the time it's 'ideal'...)
* Can also limit outage to a specific country with country: "XX" (where XX is an ISO code)
*
* Note that in JavaScript dates the months (and only the months) start at 0.
* Jan=0, Feb=1, Mar=2, Apr=3 etc. How hateful.
*
* Be sure to also update donatewiki if needed e.g. by commenting the method templates
* found at https://donate.wikimedia.org/wiki/Template:2012FR/Form-section/Paymentmethods
* 
*/

var outages = [

   {
       start:      new Date(Date.UTC(2016, 8, 18, 1)),
       end:        new Date(Date.UTC(2016, 8, 18, 7)),
       method:     "ideal"
   }

]; // jshint ignore:line

   var now = new Date();
   for (var i = outages.length - 1; i >= 0; i--) {
       if ( now > outages[i].start && now < outages[i].end ) {
           if (outages[i].country === undefined || outages[i].country == country) {
               $('.frb-pm-' + outages[i].method).hide();
           }
       }
   }

};

/**

* Adjust the amount options and their labels
*
* Inputs should have id frb-amt-psX where X is the index number (starting from 1)
*
* @param  {Object}  source     - object with amounts e.g. frb.amounts.options7
* @param  {string}  currency   - currency code e.g. 'USD'
* @param  {string}  country    - country code  e.g. 'FR' Some currencies can have different options per country.
* @param  {string}  language   - language code e.g. 'en' For symbol formatting
* @param  {boolean} useSymbols - use currency symbols on labels or not? (3 vs $3)
*/

frb.localizeAmountOptions = function(source, currency, country, language, useSymbols) {

   var amountOptions = frb.pickAmounts(source, currency, country);
   $('#frb-form input[name="amount"]').each(function(index) {
       var $input = $(this);
       var $label = $input.siblings('label');
       var i = $input.attr('id').replace('frb-amt-ps', );
       var amount = amountOptions[i-1]; // because IDs start from 1
       if ( amount ) {
           $input.val( amount );
           if ( useSymbols ) {
               $label.text( frb.formatCurrency( currency, amount, language) );
           } else {
               $label.text( frb.formatCurrency( undefined, amount, language) );
           }
       }
   });

};

/**

* Make an element into a link
*
* @param  {string} selector    CSS selector for elements to convert to a link
* @param  {string} language    Code of language (could be es-419 or pt-br)
* @param  {string} baseUrl     URL of link (function will add language parameter)
*/

frb.makeLink = function( selector, language, baseUrl ) {

   var url = baseUrl + '&language=' + language;
   $( selector ).each( function() {
       var $link = $( '<a></a>' );
       $link.html( $( this ).html() );
       $link.attr( { href: url, target: '_blank' } );
       $( this ).replaceWith( $link );
   });

};

/**

* Replace placeholders with number of banners seen
* @param {string} Language code
*/

frb.replaceSeenCount = function( language ) {

   var ordinalNums = {
           'en' : [ , '1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th' ]
       },
       ordinalWords = {
           'en' : [ , 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth' ],

'it' : [ , 'la prima', 'la seconda', 'la terza', 'la quarta', 'la quinta', 'la sesta', 'la settima', "l'ottava", 'la nona', 'la decima' ], 'sv' : [ , 'första', 'andra', 'tredje', 'fjärde', 'femte', 'sjätte', 'sjunde', 'åttonde', 'nionde', 'tionde' ], 'es' : [ , 'primera', 'segunda', 'tercera', 'cuarta', 'quinta', 'sexta', 'séptima', 'octava', 'novena', 'décima' ], 'pt' : [ , 'primeira', 'segunda', 'terceira', 'quarta', 'quinta', 'sexta', 'sétima', 'oitava', 'nona', 'décima' ], 'aa' : [ , 'primera', 'segunda', 'tercera', 'cuarta', 'quinta', 'sexta', 'séptima', 'octava', 'novena', 'décima' ]

       },
       textFragments = {
           'en' : [
               'for the 1st time recently',
               'for the 2nd time recently',
               'for the 3rd time recently',
               'for the 4th time recently',
               'for the 5th time recently',
               'for the 6th time recently',
               'for the 7th time recently',
               'for the 8th time recently',
               'for the 9th time recently',
               'for the 10th time recently'
           ]
       };
   var getReplaceText = function( data, language, seenCount ) {
       if ( data[ language ] ) {
           return data[ language ][ seenCount ];
       } else {
           return data[ 'en' ][ seenCount ];
       }
   };
   try {
       if ( localStorage ) {
           var identifier = mw.centralNotice.internal.state.campaign.mixins.impressionDiet.cookieName,
               lsName = 'CentralNoticeKV|global|impression_diet_' + identifier,
               diet = JSON.parse( localStorage.getItem( lsName ) );
           if ( diet ) {
               var seenCount = diet.val.seenCount;
               $( '.frb-replace-seenCount' ).text( seenCount );
               $( '.frb-replace-seenCount-ordinalNum' ).text( getReplaceText( ordinalNums, language, seenCount ) );
               $( '.frb-replace-seenCount-ordinalWord' ).text( getReplaceText( ordinalWords, language, seenCount ) );
               $( '.frb-replace-seenCount-textFragment' ).text( getReplaceText( textFragments, language, seenCount ) );
           }
       }
   } catch ( ex ) {
       // do nothing - localStorage is configured not to let us read it, or mixin not set
   }

};

frb.noRecurringCountries = ['AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'BR', 'IN']; frb.ccAdyenCountries = ['FR', 'IL', 'UA'];

/* These countries use potentially ambiguous $ sign. Use ISO code instead in text (but still $ for buttons) */ frb.textAmountIsoCountries = ['AR', 'CL', 'CO', 'MX'];

$(function() {

   if ( mw.centralNotice.adminUi ) { // T262693
       return;
   }
   var language = mw.centralNotice.data.uselang;
   var variantLanguage; // for pt-br and es-419, note we can only use these for certain links
   var country  = mw.centralNotice.data.country;
   var currency = frb.getCurrency(country);
   if ( language === 'pt' && country === 'BR' ) {
       variantLanguage = 'pt-br';
   } else if ( language === 'es' && ['AR', 'CL', 'CO', 'PE', 'MX', 'UY'].indexOf( country ) !== -1 ) {
       variantLanguage = 'es-419';
   } else {
       variantLanguage = language;
   }
   // Payment methods
   frb.localizeMethods(country);
   frb.checkMethodOutages(country);
   // Basic replacements
   $('.frb-replace-currencysymbol').text( frb.formatCurrency( currency, , language ).replace(' ', ) );
   $('.frb-replace-currencycode').text( currency );
   // Count banners seen
   frb.replaceSeenCount( language );
   // Country name
   var countryName;
   if ( frb.countryNames[language] ) {
       countryName = frb.countryNames[language][country] || frb.countryNames.en[country];
   } else {
       countryName = frb.countryNames.en[country];
   }
   $('.frb-replace-countryname').text( countryName );
   // Day of week
   var now = new Date();
   var dayNumber = now.getDay();
   var capitalizeText = function( text ) {
       // Capitalize first letter, for use at start of sentence
       return text.charAt(0).toUpperCase() + text.slice(1);
   };
   if ( $('.frb-replace-dayofweek, .frb-replace-dayofweek-capitalize').length > 0 ) {
       if ( frb.dayNames[language] ) {
           $('.frb-replace-dayofweek').text( frb.dayNames[language][dayNumber] );
           $('.frb-replace-dayofweek-capitalize').text( capitalizeText( frb.dayNames[language][dayNumber] ) );
       } else {
           console.log('Warning: banner should contain a day of the week, but no translations found.');
       }
   }
   if ( $('.frb-replace-dayofweek-this, .frb-replace-dayofweek-this-capitalize').length > 0 ) {
       if ( frb.dayNamesThis[language] ) {
           $('.frb-replace-dayofweek-this').text( frb.dayNamesThis[language][dayNumber] );
           $('.frb-replace-dayofweek-this-capitalize').text( capitalizeText( frb.dayNamesThis[language][dayNumber] ) );
       } else {
           console.log('Warning: banner should contain "this DAY", but no translations found.');
       }
   }
   // Capitalize
   $('.frb-capitalize').text(function( index, text ) {
       return text.charAt(0).toUpperCase() + text.slice(1);
   });
   // Replace device with iPad if needed
   var ua = navigator.userAgent;
   if ( ua.match( /ipad/i ) ) {
       $('.frb-replace-device').text( frb.iPadTranslations[language] || frb.iPadTranslations.en );
   }
   // Replace %AVERAGE% with formatted "average" amount
   var avgString, 
       average = frb.pickAmounts(frb.amounts.averages, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       avgString = frb.formatCurrency(undefined, average, language) + ' ' + currency;
   } else {
       avgString = frb.formatCurrency(currency, average, language).replace(/\.$/, ); // strip any period from end for use in running text
   }
   $('.frb').each(function(index){
       var newHtml = $(this).html().replace(/%AVERAGE%/g, '<frb-amt>' + avgString + '</frb-amt>');
       $(this).html(newHtml);
   });
   // Replace %MINIMUM% with formatted "if everyone" amount
   var ifString,
       ifEveryone = frb.pickAmounts(frb.amounts.ifEveryone, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       ifString = frb.formatCurrency(undefined, ifEveryone, language) + ' ' + currency;
   } else {
       ifString = frb.formatCurrency(currency, ifEveryone, language).replace(/\.$/, ); // strip any period from end for use in running text
   }
   $('.frb').each(function(index){
       var newHtml = $(this).html().replace(/%MINIMUM%/g, '<frb-amt>' + ifString + '</frb-amt>');
       $(this).html(newHtml);
   });
   /* Links (in smallprint) TODO: merge with frb.makeLink() */
   $('.frb-localize-links a').each(function() {
       // Add parameters for LandingCheck
       var uri = new mw.Uri( $(this).attr('href') );
       uri.extend({
           country:      country,
           language:     variantLanguage,
           uselang:      variantLanguage,
           utm_medium:   'sitenotice',
           utm_campaign: mw.centralNotice.data.campaign || 'test',
           utm_source:   mw.centralNotice.data.banner
       });
       $(this).attr('href', uri.toString());
       $(this).attr('target', '_blank'); // Make links open in new tab
   });
   // Add links
   frb.makeLink( '.frb-link-privacy', variantLanguage, 'https://foundation.wikimedia.org/wiki/Special:LandingCheck?basic=true&landing_page=Donor_privacy_policy' );
   frb.makeLink( '.frb-link-tax',     variantLanguage, 'https://donate.wikimedia.org/wiki/Special:LandingCheck?basic=true&landing_page=Tax_deductibility' );
   frb.makeLink( '.frb-link-cancel',  variantLanguage, 'https://donate.wikimedia.org/wiki/Special:LandingCheck?basic=true&landing_page=Cancel_or_change_recurring_giving' );
   // Legal text variants
   if (country === 'US') {
       $('.frb-legal-US').show();
       $('.frb-legal-nonUS, .frb-legal-NL').hide();
   } else if (country === 'NL') {
       $('.frb-legal-NL').show();
       $('.frb-legal-US, .frb-legal-nonUS').hide();
   } else {
       $('.frb-legal-nonUS').show();
       $('.frb-legal-US, .frb-legal-NL').hide();
   }
   // Where Remind Me Later should be shown
   var rmlCountries = ['US', 'CA', 'GB', 'IE', 'AU', 'NZ',
                       'SE', 'IT', 'NL', 'JP', 'FR',
                       'AR', 'BR', 'CL', 'CO', 'PE', 'UY', 'MX'];
   var rmlLanguages = ['en', 'fr', 'nl', 'ja', 'it', 'sv', 'es', 'pt'];
   var rmlEnabled = rmlCountries.indexOf(country) !== -1 && rmlLanguages.indexOf(language) !== -1;
   if ( rmlEnabled ) {
       $('.frb').addClass('frb-rml-enabled');
   } else {
       $('.frb').addClass('frb-rml-disabled');
   }

});

/* == end of MediaWiki:FundraisingBanners/LocalizeJS-2017.js == */

/** Provides alterImpressionData hook for CentralNotice

*  This info will be sent back with Special:RecordImpression
*/

mediaWiki.centralNotice.bannerData.alterImpressionData = function( impressionData ) {

   // Returning true from this function indicates the banner was shown
   if (mediaWiki.centralNotice.bannerData.hideReason) {
       impressionData.reason = mediaWiki.centralNotice.bannerData.hideReason;
   }
   if (mediaWiki.centralNotice.bannerData.cookieCount) {
       impressionData.banner_count = mediaWiki.centralNotice.bannerData.cookieCount;
   }
   
   return !mediaWiki.centralNotice.bannerData.hideResult;

};

frb.storedOptions = {};

frb.setMethod = function(options) {

   frb.storedOptions = options || { method: 'cc' }; // Default to credit card
   $('.frb-methods').fadeOut('fast', function() {
       if ( ( ( frb.storedOptions.method === 'cc' && frb.storedOptions.gateway !== 'adyen' ) || frb.storedOptions.method === 'paypal' ) &&
           frb.noRecurringCountries.indexOf(mw.centralNotice.data.country) === -1 // Defined in LocalizeJS-2017.js
       ) {
           $('.frb-frequency, .recurring-details').show();
       }
       $('.frb-step2').fadeIn('fast');
   });

};

frb.postReminderForm = function() {

   // Create the iframe for the form and use it as the form's target
   var frameName = "remindFrame";
   var $form = $(".frb-inline-rml-form form");
   if ($("iframe[name=" + frameName + "]").length == 0) {
       var $iframe = $('<iframe style="display: none;" name="' + frameName + '"></iframe>');
       $form.attr("target", $iframe.attr("name"));
       $form.after($iframe);
   }
   $form[0].submit();

};

frb.postNagReminderForm = function() {

   // Create the iframe for the form and use it as the form's target
   var frameName = "nagRemindFrame";
   var $form = $(".frb-nag-rml-form form");
   if ($("iframe[name=" + frameName + "]").length == 0) {
       var $iframe = $('<iframe style="display: none;" name="' + frameName + '"></iframe>');
       $form.attr("target", $iframe.attr("name"));
       $form.after($iframe);
   }
   $form[0].submit();

};

frb.getCurrentDate = function() {

   var today = new Date();
   var dd = today.getDate();
   var mm = today.getMonth()+1; //January is 0!
   var yyyy = today.getFullYear();
   if(dd<10) {
       dd='0'+dd;
   }
   if(mm<10) {
       mm='0'+mm;
   }
   today = mm+'/'+dd+'/'+yyyy;
   return today;

};

frb.initReminderForm = function() {

   $(".frb-inline-rml-form input[name=rml_country]").val(Geo.country);
   $(".frb-inline-rml-form input[name=rml_language]").val(mw.config.get('wgUserLanguage'));
   $(".frb-inline-rml-form input[name=rml_submitDate]").val(frb.getCurrentDate());
   $(".frb-inline-rml-form input[name=rml_segment]").val(Math.floor((Math.random() * 100) + 1));
   $(".frb-nag-rml-form input[name=rml_country]").val(Geo.country);
   $(".frb-nag-rml-form input[name=rml_language]").val(mw.config.get('wgUserLanguage'));
   $(".frb-nag-rml-form input[name=rml_submitDate]").val(frb.getCurrentDate());
   $(".frb-nag-rml-form input[name=rml_segment]").val(Math.floor((Math.random() * 100) + 1));
   $(".frb-inline-rml-link").on('click keypress', function(e) {
       if (e.which === 13 || e.type === 'click') {
           $('.frb-inline-rml').toggle();
           // Use standard JS focus() method not jQuery, because of IE10 scrolling bug
           // https://phabricator.wikimedia.org/T162049
           $('.frb-inline-rml .email_input').get(0).focus();
       }
   });
   $(".frb-nag-rml-link").on('click keypress', function(e) {
       if (e.which === 13 || e.type === 'click') {
           $('.frb-nag-rml').toggle();
           $('.frb-nag-rml .email_input').get(0).focus();
           return false;
       }
   });
   $(".frb-inline-rml-form button").bind("click keypress", function(e) {
       if (e.which === 13 || e.type === 'click') {
           if ( mw.util.validateEmail( $(".frb-inline-rml-form form input[name='Email']").val() ) ) {
               frb.postReminderForm();
               $(".frb-inline-rml-form form").hide();
               $(".frb-inline-rml-done").show();
               $(".frb-inline-rml").delay(2000).fadeOut(1000, function(){
                   $("#frb-inline").hide();
                   $("#frb-nag").hide();
               });
               mw.centralNotice.internal.hide.setHideWithCloseButtonCookies(); // Hide future banners for 7 days
               return false;
           } else {
               $(".frb-inline-rml-form form input[name='Email']").addClass("error");
               $(".frb-inline-rml-form #errorMessageContainerId").show();
               $('.frb-inline-rml .email_input').get(0).focus();
               return false;
           }
       }
   });
   $(".frb-nag-rml-form button").bind("click keypress", function(e) {
       if (e.which === 13 || e.type === 'click') {
           if ( mw.util.validateEmail( $(".frb-nag-rml-form form input[name='Email']").val() ) ) {
               frb.postNagReminderForm();
               $(".frb-nag-rml-form form").hide();
               $(".frb-nag-rml .frb-inline-rml-done").show();
               $(".frb-nag-rml-form form").hide();
               $(".frb-nag-rml-done").show();
               $(".frb-nag-rml").delay(2000).fadeOut(1000, function(){
                   $('#frb-nag').hide();
               });
               mw.centralNotice.internal.hide.setHideWithCloseButtonCookies(); // Hide future banners for 7 days
               return false;
           } else {
               $(".frb-nag-rml-form form input[name='Email']").addClass("error");
               $(".frb-nag-rml-form #errorMessageContainerId").show();
               $('.frb-nag-rml .email_input').get(0).focus();
               return false;
           }
       }
   });

};

frb.initNag = function() {

   /* --- Code for sticky "nag" banner --- */
   $(window).scroll(function() {
       // Check if element exists on scroll
       // This check is important after email has been submitted in RML nag
       if ( $( '#frb-inline' ).length ) {
           var nagRevealPosition = $('#frb-inline').offset().top + $('#frb-inline').outerHeight();
           if ( $(window).scrollTop() < nagRevealPosition ) {
                   $('#frb-nag').finish();
                   $('#frb-nag').removeClass('reveal');
                   $('.frb-nag-rml').hide();
           } else {
               setTimeout(function(){
                   if ( !$('#frb-nag' ).hasClass('reveal') && $(window).scrollTop() > nagRevealPosition ) {
                       $('#frb-nag').addClass('reveal');
                   }
               }, 1500);
           }
       }
   });
   $('.frb-nag-close').on('click keypress', function(e){
       if (e.which === 13 || e.type === 'click') {
           $('#frb-nag').remove();
           return false;
       }
   });
   $('.frb-nag-rml').on('click keypress', function(e){
       if (e.which === 13 || e.type === 'click') {
           return false;
       }
   });

};

frb.insertInlineBanner = function() {

   // Place frb-inline in article: before first paragraph, or at top
   var $inlineBanner = $('#frb-inline');
   var $firstPara    = $('.mw-parser-output > p:first-of-type').first();
   if ( $firstPara.length > 0 && !mw.config.get('wgIsMainPage') ) {
       $firstPara.before( $inlineBanner );
   } else {
       $('#mw-content-text').prepend( $inlineBanner );
   }
   $inlineBanner.show();

};

$(function() {

   var language = mw.centralNotice.data.uselang;
   var country  = mw.centralNotice.data.country;
   var currency = frb.getCurrency(country);
   frb.initReminderForm();
   frb.initNag();
   frb.initAmountOptions();
   frb.localizeAmountOptions(frb.amounts.options7, currency, country, language, true);
   // Close top banner on click or return
   $('.frb-inline-close').on('click keypress', function(e) {
       if (e.which === 13 || e.type === 'click') {
           $('#frb-inline').hide();
           mw.centralNotice.hideBanner();
           e.stopPropagation();
       }
   });
   // Close inline rml form on click or return
   $('.frb-inline-rml-form-close').on('click keypress', function(e) {
       if (e.which === 13 || e.type === 'click') {
           $('.frb-inline-rml').hide();
           e.stopPropagation();
       }
   });
   $('.frb-amt-other').click(function() {
       document.getElementById('frb-amt-other').checked = true;
       $('#frb-amt-other-input').focus();
   });
   // Activate #input_amount_other radio when tabbing into #frb-amt-other-input
   $('#frb-amt-other-input').focus(function() {
       document.getElementById('frb-amt-other').checked = true;
   });
   /* Hide banner outside of main namespace (and Main Page, for sites where that isn't in main namespace) */
   if ( mw.config.get('wgNamespaceNumber') > 0 && !mw.config.get('wgIsMainPage') ) {
       mw.centralNotice.bannerData.hideResult = true;
       mw.centralNotice.bannerData.hideReason = 'namespace';
   }
   if (!mw.centralNotice.bannerData.hideResult) {
       frb.insertInlineBanner();
   }

}); </script>