MediaWiki:Centralnotice-template-B1718 1114 en6C dsk p2 sm nag tuesnag

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search

<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;

}

.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">
If everyone reading this Tuesday gave %MINIMUM%, we could keep Wikipedia thriving for years.
       <button class="frb-btn frb-nag-donate">Donate now</button>
       
   </a>

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

// TODO: Purge currencies that are no longer needed frb.amounts = frb.amounts || {};

// Hard minimum amounts that can be given frb.amounts.minimums = {

   /* From https://github.com/wikimedia/wikimedia-fundraising-SmashPig/blob/master/PaymentData/ReferenceData/CurrencyRates.php */
   'ADF' : 6.01,
   'ADP' : 152,
   'AED' : 3.67,
   'AFA' : 68,
   'AFN' : 68,
   'ALL' : 122,
   'AMD' : 468,
   'ANG' : 1.77,
   'AOA' : 165,
   'AON' : 165,
   'ATS' : 13,
   'AUD' : 1.33,
   'AWG' : 1.79,
   'AZM' : 8510,
   'AZN' : 1.7,
   'BAM' : 1.79,
   'BBD' : 2,
   'BDT' : 81,
   'BEF' : 37,
   'BGL' : 1.79,
   'BGN' : 1.79,
   'BHD' : 0.37445,
   'BIF' : 1681,
   'BMD' : 1,
   'BND' : 1.39,
   'BOB' : 6.8,
   'BRL' : 3.17,
   'BSD' : 1,
   'BTN' : 64,
   'BWP' : 10,
   'BYR' : 20020,
   'BZD' : 1.97,
   'CAD' : 1.37,
   'CDF' : 1369,
   'CHF' : 1,
   'CNY' : 6.89,
   'CRC' : 547,
   'CUC' : 1,
   'CUP' : 25,
   'CVE' : 101,
   'CYP' : 0.54,
   'CZK' : 25,
   'DEM' : 1.79,
   'DJF' : 178,
   'DKK' : 6.81,
   'DOP' : 47,
   'DZD' : 109,
   'ECS' : 25589,
   'EEK' : 14,
   'EGP' : 18,
   'ESP' : 152,
   'ETB' : 23,
   'EUR' : 0.92,
   'FIM' : 5.45,
   'FJD' : 2.08,
   'FKP' : 0.78,
   'FRF' : 6.01,
   'GBP' : 0.78,
   'GEL' : 2.43,
   'GHC' : 41911,
   'GHS' : 4.19,
   'GIP' : 0.78,
   'GMD' : 44,
   'GNF' : 9172,
   'GRD' : 312,
   'GTQ' : 7.17,
   'GYD' : 198,
   'HKD' : 7.78,
   'HNL' : 23,
   'HRK' : 6.83,
   'HTG' : 68,
   'HUF' : 286,
   'IDR' : 13316,
   'IEP' : 0.73,
   'ILS' : 3.61,
   'INR' : 64,
   'IQD' : 1149,
   'IRR' : 32438,
   'ISK' : 106,
   'ITL' : 1774,
   'JMD' : 128,
   'JOD' : 0.71,
   'JPY' : 112,
   'KES' : 101,
   'KGS' : 68,
   'KHR' : 3972,
   'KMF' : 451,
   'KPW' : 135,
   'KRW' : 1129,
   'KWD' : 0.30384,
   'KYD' : 0.81632,
   'KZT' : 314,
   'LAK' : 8068,
   'LBP' : 1491,
   'LKR' : 151,
   'LRD' : 91,
   'LSL' : 13,
   'LTL' : 3.16,
   'LUF' : 37,
   'LVL' : 0.65,
   'LYD' : 1.39,
   'MAD' : 9.85,
   'MDL' : 19,
   'MGA' : 3160,
   'MGF' : 9149,
   'MKD' : 56,
   'MMK' : 1339,
   'MNT' : 2410,
   'MOP' : 7.84,
   'MRO' : 356,
   'MTL' : 0.40,
   'MUR' : 33,
   'MVR' : 15,
   'MWK' : 721,
   'MYR' : 4.33,
   'MZM' : 70440,
   'MZN' : 70,
   'NAD' : 13,
   'NGN' : 312,
   'NIO' : 29,
   'NLG' : 2.02,
   'NOK' : 8.59,
   'NPR' : 101,
   'NZD' : 1.44,
   'OMR' : 0.38365,
   'PAB' : 1,
   'PEN' : 3.21,
   'PGK' : 3.13,
   'PHP' : 50,
   'PKR' : 104,
   'PLN' : 3.86,
   'PTE' : 184,
   'PYG' : 5467,
   'QAR' : 3.64,
   'ROL' : 41607,
   'RON' : 4.16,
   'RSD' : 112,
   'RUB' : 57,
   'RWF' : 822,
   'SAR' : 3.75,
   'SBD' : 7.69,
   'SCR' : 13,
   'SDD' : 665,
   'SDG' : 6.65,
   'SDP' : 2272,
   'SEK' : 8.83,
   'SGD' : 1.39,
   'SHP' : 0.78,
   'SIT' : 220,
   'SKK' : 28,
   'SLL' : 7451,
   'SOS' : 545,
   'SRD' : 7.48,
   'SRG' : 7480,
   'STD' : 22420,
   'SVC' : 8.54,
   'SYP' : 215,
   'SZL' : 13,
   'THB' : 34,
   'TJS' : 8.5,
   'TMM' : 17022,
   'TMT' : 3.4,
   'TND' : 2.41,
   'TOP' : 2.31,
   'TRL' : 3540300,
   'TRY' : 3.54,
   'TTD' : 6.65,
   'TWD' : 30,
   'TZS' : 2213,
   'UAH' : 26,
   'UGX' : 3612,
   'USD' : 1,
   'UZS' : 3728,
   'VEB' : 10022,
   'VEF' : 10,
   'VND' : 22484,
   'VUV' : 107,
   'WST' : 2.59,
   'XAF' : 601,
   'XCD' : 2.69,
   'XOF' : 600,
   'XPF' : 109,
   'YER' : 250,
   'YUN' : 112,
   'ZAR' : 13,
   'ZMK' : 5328,
   'ZWD' : 376,
   /* Astropay currencies have higher minimums - 1.50 USD */
   'ARS' : 22.5,
   'CLP' : 993,
   'COP' : 4380,
   'MXN' : 28.5,
   'UYU' : 42

};

frb.amounts.options7 = {

   'USD' : [3, 5, 10, 20, 30, 50, 100],
   'EUR' : {
       'default' : [2, 5, 10, 20, 30, 50, 100]
   },
   'GBP' : [2, 5, 10, 20, 30, 50, 100],
   'CAD' : [3, 5, 10, 20, 30, 50, 100],
   'AUD' : [3, 5, 10, 20, 30, 50, 100],
   'NZD' : [3, 5, 10, 20, 30, 50, 100],
   'ANG' : [5, 10, 20, 35, 50, 100, 200],
   'ARS' : [30, 50, 100, 200, 500, 750, 1000],
   'BAM' : [3, 5, 10, 25, 40, 70, 140],
   'BBD' : [5, 10, 20, 40, 60, 100, 200],
   'BDT' : [200, 400, 800, 1500, 2000, 4000, 7500],
   'BGN' : [10, 25, 50, 75, 100, 150, 200],
   'BHD' : [1, 2, 4, 8, 10, 20, 40],
   'BMD' : [3, 5, 10, 20, 30, 50, 100],
   'BOB' : [20, 30, 60, 140, 200, 300, 600],
   'BRL' : [10, 20, 30, 50, 100, 250, 500],
   'BZD' : [5, 10, 20, 40, 60, 100, 200],
   'CLP' : [1500, 2500, 5000, 10000, 15000, 25000, 50000],
   'CNY' : [50, 75, 100, 300, 500, 1000, 1500],
   'COP' : [7000, 10000, 20000, 50000, 100000, 150000, 200000],
   'CRC' : [2500, 5000, 10000, 20000, 50000, 75000, 100000],
   'CZK' : [50, 100, 200, 400, 600, 1000, 2000],
   'DKK' : [20, 100, 150, 200, 300, 500, 1000],
   'DOP' : [200, 500, 1000, 2000, 5000, 7500, 10000],
   'DZD' : [200, 400, 750, 1500, 2000, 4000, 7500],
   'FJD' : [5, 10, 20, 40, 50, 100, 200],
   'GTQ' : [20, 40, 80, 150, 200, 350, 750],
   'HKD' : [20, 50, 100, 150, 200, 500, 1000],
   'HNL' : [50, 100, 200, 400, 600, 1000, 1800],
   'HRK' : [35, 50, 100, 250, 500, 1000, 1500],
   'HUF' : [500, 1000, 2000, 4000, 5000, 7000, 10000],
   'ISK' : [300, 500, 1000, 2000, 3000, 5000, 10000],
   'ILS' : [10, 50, 100, 200, 300, 500, 1000],
   'INR' : [100, 200, 300, 500, 1000, 2000, 3000],
   'JMD' : [300, 500, 1000, 2000, 3000, 5000, 10000],
   'JPY' : [300, 1000, 1500, 2000, 3000, 5000, 10000],
   'KRW' : [5000, 10000, 20000, 30000, 50000, 75000, 100000],
   'KWD' : [2, 5, 10,15, 25, 30, 75],
   'KZT' : [750, 1500, 3000, 7500, 12000, 15000, 35000],
   'MKD' : [100, 200, 400, 800, 1200, 2000, 4000],
   'MVR' : [40, 75, 150, 300, 450, 750, 1500],
   'MXN' : [35, 50, 100, 200, 500, 750, 1000],
   'MYR' : [10, 30, 50, 100, 200, 300, 500],
   'NIO' : [100, 250, 500, 1000, 1500, 2500, 5500],
   'NOK' : [20, 100, 150, 200, 500, 750, 1000],
   'OMR' : [1, 2, 4, 8, 10, 20, 40],
   'PAB' : [3, 5, 10, 20, 30, 50, 100],
   'PEN' : [10, 30, 50, 150, 200, 275, 700],
   'PHP' : [200, 500, 750, 1000, 2000, 3000, 5000],
   'PLN' : [10, 20, 50, 100, 200, 300, 500],
   'PYG' : [10000, 20000, 40000, 80000, 120000, 200000, 400000],
   'QAR' : [20, 50, 75, 185, 250, 350, 1000],
   'RON' : [10, 50, 75, 100, 200, 300, 500],
   'SEK' : [30, 50, 100, 200, 300, 500, 1000],
   'SGD' : [3, 5, 10, 20, 30, 50, 100],
   'THB' : [50, 100, 250, 500, 750, 1000, 2000],
   'TND' : [5, 10, 15, 30, 50, 75, 150],
   'TTD' : [20, 30, 60, 120, 200, 300, 600],
   'TWD' : [150, 300, 500, 1000, 1500, 2000, 5000],
   'UAH' : [50, 75, 150, 300, 500, 750, 1000],
   'UYU' : [70, 100, 200, 400, 1000, 1500, 2000],
   'VEF' : [20, 30, 50, 100, 200, 300, 600],
   'VND' : [60000, 100000, 200000, 400000, 600000, 1000000, 2000000],
   'XCD' : [5, 10, 20, 50, 80, 120, 250],
   'XOF' : [1000, 2000, 5000, 10000, 150000, 200000, 400000],
   'XPF' : [250, 400, 800, 1600, 2500, 4000, 8000],
   'ZAR' : [30, 50, 100, 200, 300, 500, 1000],
   'CHF' : [3, 5, 10, 20, 30, 50, 100]

};

// 5 amount options. Used e.g. on mobile // Usual formula: take 1st, 3rd, 4th, 6th and 7th from asks7 */ frb.amounts.options5 = {

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

};

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

   'USD' : 15,
   'EUR' : 10,
   'GBP' : 10,
   'CAD' : 15,
   'AUD' : 15,
   'NZD' : 15,
   'ALL' : 1500,
   'AMD' : 5000,
   'ANG' : 25,
   'ARS' : 100,
   'AZN' : 10,
   'BAM' : 20,
   'BBD' : 30,
   'BDT' : 1000,
   'BGN' : 20,
   'BHD' : 6,
   'BMD' : 15,
   'BND' : 20,
   'BOB' : 100,
   'BRL' : 25,
   'BSD' : 15,
   'BZD' : 30,
   'CHF' : 15,
   'CLP' : 8000,
   'CNY' : 100,
   'COP' : 30000,
   'CRC' : 7500,
   'CZK' : 250,
   'DKK' : 100,
   'DOP' : 600,
   'DZD' : 1000,
   'EGP' : 100,
   'ETB' : 250,
   'FJD' : 25,
   'GEL' : 25,
   'GNF' : 100000,
   'GTQ' : 100,
   'HKD' : 100,
   'HNL' : 250,
   'HRK' : 80,
   'HUF' : 2500,
   'ILS' : 50,
   'INR' : 750,
   'ISK' : 1500,
   'JMD' : 1500,
   'JOD' : 10,
   'JPY' : 1500,
   'KES' : 1000,
   'KRW' : 15000,
   'KWD' : 5,
   'KZT' : 2000,
   'LKR' : 2000,
   'MAD' : 120,
   'MKD' : 600,
   'MOP' : 100,
   'MUR' : 500,
   'MVR' : 200,
   'MXN' : 150,
   'MYR' : 50,
   'MZN' : 50,
   'NGN' : 2500,
   'NIO' : 350,
   'NOK' : 100,
   'OMR' : 5,
   'PAB' : 15,
   'PEN' : 40,
   'PHP' : 600,
   'PKR' : 1500,
   'PLN' : 50,
   'PYG' : 60000,
   'QAR' : 50,
   'RON' : 50,
   'RSD' : 1200,
   'SBD' : 100,
   'SEK' : 100,
   'SGD' : 20,
   'THB' : 500,
   'TND' : 25,
   'TTD' : 100,
   'TWD' : 500,
   'UAH' : 150,
   'UYU' : 300,
   'VEF' : 100,
   'VND' : 300000,
   'XCD' : 40,
   'XOF' : 7000,
   'XPF' : 1000,
   'ZAR' : 150,

};

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

   'USD' : 3,
   'EUR' : {
       'default' : 2
   },
   'GBP' : 2,
   'CAD' : 3,
   'AUD' : 3,
   'NZD' : 3,
   'ANG' : 5,
   'ARS' : 30,
   'BAM' : 3,
   'BBD' : 5,
   'BDT' : 200,
   'BGN' : 10,
   'BHD' : 1,
   'BMD' : 3,
   'BOB' : 20,
   'BRL' : 10,
   'BZD' : 5,
   'CHF' : 3,
   'CLP' : 1500,
   'CNY' : 50,
   'COP' : 7000,
   'CRC' : 2500,
   'CZK' : 50,
   'DKK' : 20,
   'DOP' : 200,
   'DZD' : 200,
   'FJD' : 5,
   'GTQ' : 20,
   'HKD' : 20,
   'HNL' : 50,
   'HRK' : 35,
   'HUF' : 500,
   'ILS' : 10,
   'INR' : 100,
   'ISK' : 300,
   'JMD' : 300,
   'JPY' : 300,
   'KRW' : 5000,
   'KWD' : 2,
   'KZT' : 750,
   'MKD' : 100,
   'MVR' : 40,
   'MXN' : 35,
   'MYR' : 10,
   'NIO' : 100,
   'NOK' : 20,
   'OMR' : 1,
   'PAB' : 3,
   'PEN' : 10,
   'PHP' : 200,
   'PLN' : 10,
   'PYG' : 10000,
   'QAR' : 20,
   'RON' : 10,
   'SEK' : 30,
   'SGD' : 3,
   'THB' : 50,
   'TND' : 5,
   'TTD' : 20,
   'TWD' : 150,
   'UAH' : 50,
   'UYU' : 70,
   'VEF' : 20,
   'VND' : 60000,
   'XCD' : 5,
   'XOF' : 1000,
   'XPF' : 250,
   'ZAR' : 30

};

// TODO: purge unneeded currencies frb.currencyFormats = {

   'USD' : '$\t',
   'EUR' : {
       'en' : '€\t',
       'cy' : '€\t',
       'ga' : '€\t',
       'mt' : '€\t',
       'nl' : '€ \t',
       'lv' : '€ \t',
       'tr' : '€ \t',
       'default' : '\t €'
   },
   'ANG' : 'ƒ\t',
   'ARS' : '$\t',
   'AUD' : '$\t',
   'BAM' : '\t KM',
   'BBD' : 'Bcs$\t',
   'BDT' : '৳\t',
   'BGN' : 'лв\t',
   'BHD' : 'د.ب\t',
   'BMD' : 'BD$\t',
   'BOB' : '$b\t',
   'BRL' : 'R$\t',
   'BZD' : 'BZ$\t',
   'CAD' : {
       'fr' : '$\t',
       'default' : '$\t'
   },
   'CHF' : 'Fr. \t',
   'CLP' : '$\t',
   'CNY' : '\t ¥',
   'COP' : '$\t',
   'CRC' : '\t ₡',
   'CZK' : '\t Kč',
   'DKK' : '\t kr.',
   'DOP' : 'RD$\t',
   'DZD' : 'د.ج\t',
   'EGP' : {
       'en' : 'E£\t',
       'default' : '\t جنيه'
   },
   'FJD' : 'FJ$\t',
   'GBP' : '£\t',
   'GTQ' : 'Q\t',
   'HKD' : 'HK$\t',
   'HNL' : 'L\t',
   'HRK' : '\t kn',
   'HUF' : '\t Ft',
   'ILS' : {
       'he' : '\t ₪',
       'yi' : '\t ₪',
       'ar' : '\t ₪',
       'default' : '₪ \t'
   },
   'INR' : '₹ \t',
   'ISK' : '\t kr',
   'JMD' : 'J$ \t',
   'JOD' : 'دينار\t',
   'JPY' : '¥\t',
   'KES' : '\t KSh',
   'KRW' : '₩\t',
   'KWD' : 'د.ك \t',
   'KZT' : '〒 \t', // TODO: don't use the JP postal code symbol once KZT works in unicode
   'LKR' : '\t Rs.',
   'MAD' : 'د.م.\t',
   'MKD' : '\t ден',
   'MOP' : 'MOP$\t',
   'MUR' : '\t Rs',
   'MXN' : '$\t',
   'MVR' : 'Rf. \t',
   'MYR' : 'RM\t',
   'NIO' : 'C$\t',
   'NOK' : '\t kr',
   'NZD' : '$\t',
   'OMR' : 'ر.ع\t',
   'PAB' : '\t B/.',
   'PEN' : 'S/. \t',
   'PHP' : '₱\t',
   'PKR' : 'Rs \t',
   'PLN' : '\t zł',
   'PYG' : '\t ₲',
   'QAR' : 'ر.ق\t',
   'RON' : '\t lei',
   'SCR' : 'SR \t',
   'SEK' : '\t kr',
   'SGD' : 'S$ \t',
   'SVC' : '\t ₡',
   'THB' : {
       'th' : '\t บาท',
       'default' : '\t ฿'
   },
   'TND' : '\t د.ت',
   'TTD' : 'TT$\t',
   'TWD' : 'NT$\t',
   'TZS' : '\t/=',
   'UAH' : '₴\t',
   'UYU' : '$U \t',
   'UZS' : '\t сўм',
   'VEF' : 'Bs.F. \t',
   'VND' : '\t₫',
   'VUV' : 'VT\t',
   'XAF' : 'FCFA\t',
   'XCD' : 'EC$\t',
   'XOF' : 'CFA \t',
   'XPF' : '\t F',
   'ZAR' : 'R \t'

};

// 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',
       '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'
   },
   'es' : {
       'MX' : 'México',
       'PE' : 'Perú'
   }

};

// Just in English for now, but we may want to add other languages later frb.dayNames = {

   'en' : [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]

};

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';
   /* Express Checkout overrides for Japan and Big English. Remove once it's default. */
   if ( params.payment_method === 'paypal' && 
        $.inArray(params.country, ['JP']) !== -1 
   ) {
       params.gateway = 'paypal_ec';
   }
   if (params.uselang === 'pt' && params.country === 'BR') {
       params.uselang = 'pt-br';
   }
   /* Amount */
   params.amount = frb.getAmount(form);
   if (params.amount === false) {
       return false; // Amount problem, bail out of submitting
   }
   /* Tracking info */
   params.utm_medium   = 'sitenotice';
   params.utm_campaign = mw.centralNotice.data.campaign || 'test';
   params.utm_source   = frb.buildUtmSource(params);
   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;
   // For popups test - only on Big English desktop. Remove this once testing completed.
   if ( utm_source.indexOf( 'en6C_dsk' ) !== -1 ) {
       if ( mw.popups ) {
           utm_source += '_' + ( mw.popups.isEnabled() ? 'popupsEnabled' : 'popupsDisabled' );
       } else {
           utm_source += '_' + 'popupsUnknown';
       }
   }
   utm_source += '.no-LP.' + fullDottedPaymentMethod;
   return utm_source;

};

/* Is recurring method selected?

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

frb.getRecurring = function(form) {

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

};

/**

* Return amount, or false if invalid (e.g. less than minimum)
*/

frb.getAmount = function(form) {

   var amount = null;
   if (form.amount) {
       // If there are some amount radio buttons, then look for the checked one
       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(/:/, '.');
       form.otherAmount.value = otherAmount;
       amount = otherAmount;
   }
   var currency  = frb.getCurrency(mw.centralNotice.data.country);
   var minAmount = Math.ceil( frb.amounts.minimums[currency] ); // NOTE: Round up actual min to nearest whole number
   if ( amount === null || isNaN(amount) || amount <= 0 || amount < minAmount ) {
       alert('Please select an amount (minimum $1)'.replace('$1', minAmount + ' ' + currency));
       return false;
   } else {
       return amount;
   }

};

/**

* 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;
       }
   };

};

// For popups test - only on Big English desktop. Remove this once testing completed. if ( mw.centralNotice.data.banner.indexOf('en6C_dsk') !== -1 ) {

   mw.centralNotice.requestRecordImpressionDelay(
       mw.loader.using( 'ext.popups' )
   ).done( function () {
       if ( mw.popups ) {
           mw.centralNotice.registerTest( ( mw.popups.isEnabled() ? 'popupsEnabled' : 'popupsDisabled' ) );
       } else {
           mw.centralNotice.registerTest( 'popupsUnknown' );
       }
   } );

} /* == 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 5 at the top for speed
       case 'US': return 'USD';
       case 'CA': return 'CAD';
       case 'GB': return 'GBP';
       case 'AU': return 'AUD';
       case 'NZ': return 'NZD';
       // Euro countries
       case 'AD':
       case 'AL':
       case 'AM':
       case 'AT':
       case 'AW':
       case 'AZ':
       case 'BE':
       case 'BY':
       case 'CI':
       case 'CY':
       case 'DE':
       case 'EE':
       case 'ES':
       case 'FI':
       case 'FR':
       case 'GF':
       case 'GR':
       case 'IE':
       case 'IT':
       case 'LT':
       case 'LU':
       case 'LV':
       case 'LY':
       case 'MC':
       case 'ME':
       case 'MG':
       case 'MT':
       case 'NL':
       case 'PT':
       case 'RE':
       case 'RS':
       case 'SI':
       case 'SK':
       case 'SM':
       case 'SR':
       case 'VA':
           return 'EUR';
       // The rest
       case 'AE': return 'AED';
       case 'AR': return 'ARS';
       case 'BA': return 'BAM';
       case 'BB': return 'BBD';
       case 'BD': return 'BDT';
       case 'BG': return 'BGN';
       case 'BH': return 'BHD';
       case 'BM': return 'BMD';
       case 'BO': return 'BOB';
       case 'BR': return 'BRL';
       case 'BZ': return 'BZD';
       case 'CH': return 'CHF';
       case 'CK': return 'NZD';
       case 'CL': return 'CLP';
       case 'CN': return 'CNY';
       case 'CO': return 'COP';
       case 'CR': return 'CRC';
       case 'CZ': return 'CZK';
       case 'DK': return 'DKK';
       case 'DO': return 'DOP';
       case 'DZ': return 'DZD';
       case 'EG': return 'EGP';
       case 'FJ': return 'FJD';
       case 'FO': return 'DKK';
       case 'GL': return 'DKK';
       case 'GT': return 'GTQ';
       case 'HK': return 'HKD';
       case 'HN': return 'HNL';
       case 'HR': return 'HRK';
       case 'HU': return 'HUF';
       case 'ID': return 'IDR';
       case 'IL': return 'ILS';
       case 'IN': return 'INR';
       case 'IS': return 'ISK';
       case 'JM': return 'JMD';
       case 'JO': return 'JOD';
       case 'JP': return 'JPY';
       case 'KE': return 'KES';
       case 'KI': return 'AUD';
       case 'KR': return 'KRW';
       case 'KZ': return 'KZT';
       case 'LB': return 'LBP';
       case 'LI': return 'CHF';
       case 'LK': return 'LKR';
       case 'MA': return 'MAD';
       case 'MK': return 'MKD';
       case 'MV': return 'MVR';
       case 'MW': return 'GBP';
       case 'MX': return 'MXN';
       case 'MY': return 'MYR';
       case 'NI': return 'NIO';
       case 'NO': return 'NOK';
       case 'NP': return 'INR';
       case 'NR': return 'AUD';
       case 'OM': return 'OMR';
       case 'PA': return 'PAB';
       case 'PE': return 'PEN';
       case 'PG': return 'AUD';
       case 'PH': return 'PHP';
       case 'PK': return 'PKR';
       case 'PL': return 'PLN';
       case 'PY': return 'PYG';
       case 'QA': return 'QAR';
       case 'RO': return 'RON';
       case 'RU': return 'RUB';
       case 'SA': return 'SAR';
       case 'SD': return 'GBP';
       case 'SE': return 'SEK';
       case 'SG': return 'SGD';
       case 'TH': return 'THB';
       case 'TM': return 'RUB';
       case 'TN': return 'TND';
       case 'TR': return 'TRY';
       case 'TT': return 'TTD';
       case 'TW': return 'TWD';
       case 'UA': return 'UAH';
       case 'UY': return 'UYU';
       case 'UZ': return 'RUB';
       case 'VE': return 'VEF';
       case 'VN': return 'VND';
       case 'VU': return 'AUD';
       case 'ZA': return 'ZAR';
       // small multi-country currencies
       case 'CW':
       case 'SX':
           return 'ANG';
       case 'AG':
       case 'DM':
       case 'GD':
       case 'KN':
       case 'LC':
           return 'XCD';
       case 'BJ':
       case 'BF':
       case 'CI':
       case 'GW':
       case 'ML':
       case 'NE':
       case 'SN':
       case 'TG':
           return 'XOF';
       case 'PF':
       case 'NC':
       case 'WF':
           return 'XPF';
       // 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;
   if (isNaN(amount) || amount === ) {
       // Not a number, it's probably the 'other' string or box
       // TODO: better way of doing this?
       fmAmount = amount;
   } else {
       if (window.Intl && typeof window.Intl === 'object') {
           // Use this for fancy number formatting - thousands separators etc
           locale = language + '-' + Geo.country;
           if ( amount % 1 !== 0 ) { // Not a whole number
               formatterOptions = { minimumFractionDigits: 2 }
           } else {
               formatterOptions = {};
           }
           formatter = new Intl.NumberFormat(locale, formatterOptions);
       } else {
           // Bad browser. Just do the basics: 2 decimal places if needed, or none
           formatter = {};
           formatter.format = function(number) {
               if ( amount % 1 !== 0 ) { // Not a whole number
                   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];
   }

};


/**

* 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) {

   // Countries with no credit card option (currently none)
   var noCC = [];
   if ($.inArray(country, noCC) !== -1) {
       $('.frb-pm-cc').remove();
   }
   // Can't do monthly credit card in Brazil
   if (country === 'BR') {
       $('.frb-pm-cc').addClass('no-monthly');
   }
   // Remove any leftover WorldPay
   $('.frb-pm-cc-wp').remove();
   // Countries using Adyen for credit card
   if (country === 'FR' || country === 'IL' || country === 'UA') {
       $('.frb-pm-cc').remove();
       $('.frb-pm-cc-adyen').show();
   } else {
       $('.frb-pm-cc-adyen').remove();
   }
   // Countries with no PayPal option
   var noPP = ['IN', 'RU', 'SG', 'AE', 'QA', 'OM', 'BD', 'BO', 'PA',
               'PY', 'GT', 'JM', 'TT', 'DZ', 'PE'];
   if ($.inArray(country, noPP) !== -1) {
       $('.frb-pm-pp').remove();
       $('.frb-pm-pp-usd').remove();
   }
   // Countries with no PayPal for mobile only
   var noPPmobile = ['PH', 'ID', 'TH', 'KR', 'MY', 'VN'];
   var mobileRegex = /(_mob_|_ipd_)/
   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'];
   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'       : ['AR', 'BR', 'CL', 'CO'],      // Bank Transfer (Astropay)
       'cash'     : ['AR', 'BR', 'CO', 'MX', 'UY'] // 'Cash' methods (Astropay)
   };
   // Methods with different labels per country
   if (country === 'AR') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('Santander');
   }
   if (country === 'CO') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('PSE Pagos');
   }
   if (country === 'UY') {
       $('.frb-pm-cash button, button.frb-pm-cash').html('RedPagos');
   }
   if (country === 'CL' && mw.config.get('wgUserLanguage') == 'es') {
       $('.frb-pm-bt button, button.frb-pm-bt').html('Trans. bancaria');
   }
   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();
       }
   }

};

/**

* 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 and donatewiki e.g. if they have scheduled downtime.
* Valid methods are:
* ideal, yandex, cc, dd, sofort, pp, amazon, bpay, webmoney, boletos, enets, 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
*/

var outages = [

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

];

   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.html( frb.formatCurrency( currency, amount, language) );
           } else {
               $label.html( frb.formatCurrency( undefined, amount, language) );
           }
       }
   });

};

frb.noRecurringCountries = ['AR', 'CL', 'CO', 'MX', 'PE', 'UY', 'BR'];

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

$(function() {

   var language = mw.centralNotice.data.uselang;
   var country  = mw.centralNotice.data.country;
   var currency = frb.getCurrency(country);
   // Payment methods
   frb.localizeMethods(country);
   frb.checkMethodOutages(country);
   // Hide recurring for some countries
   if ( frb.noRecurringCountries.indexOf(country) !== -1 ) { // country is in the list
       $('.frb-frequency, .recurring-details').hide();
   }
   // Basic replacements
   $('.frb-replace-currencysymbol').html( frb.formatCurrency( currency, , language ).replace(' ', ) );
   $('.frb-replace-currencycode').html( currency );
   // 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').html( countryName );
   // Day of week
   var dayName;
   var now = new Date();
   var dayNumber = now.getDay();
   if ( frb.dayNames[language] ) {
       dayName = frb.dayNames[language][dayNumber] || frb.dayNames.en[dayNumber];
   } else {
       dayName = frb.dayNames.en[dayNumber];
   }
   $('.frb-replace-dayofweek').html( dayName );
   // Replace device with iPad if needed
   var ua = navigator.userAgent;
   if ( ua.match( /ipad/i ) ) {
       $('.frb-replace-device').html( frb.iPadTranslations[language] || frb.iPadTranslations.en );
   }
   // Replace %AVERAGE% with formatted "average" amount
   var average = frb.pickAmounts(frb.amounts.averages, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       var avgString = average + ' ' + currency;
   } else {
       var 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, '' + avgString + '');
       $(this).html(newHtml);
   });
   // Replace %MINIMUM% with formatted "if everyone" amount
   var ifEveryone = frb.pickAmounts(frb.amounts.ifEveryone, currency, country);
   if ( frb.textAmountIsoCountries.indexOf(country) !== -1 ) {
       var ifString = ifEveryone + ' ' + currency;
   } else {
       var 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, '' + ifString + '');
       $(this).html(newHtml);
   });
   /* Links (in smallprint) */
   $('.frb-localize-links a').each(function() {
       // Add parameters for LandingCheck
       var uri = new mw.Uri( $(this).attr('href') );
       uri.extend({
           country:      country,
           language:     language,
           uselang:      language,
           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
   });
   // 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();
   }

});

/* == 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-content-text .mw-parser-output > p:first-of-type').first();
   if ( $firstPara.length > 0 && !mw.config.get('wgIsMainPage') ) {
       $firstPara.before( $inlineBanner );
   } else {
       $('#mw-content-text .mw-parser-output').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>