MediaWiki:Centralnotice-template-B12 1227 ThankYou 5pillars

From Meta, a Wikimedia project coordination wiki

<style type="text/css">

 #centralNotice.collapsed #{{{banner}}}{
   display: none;
 }
 div#{{{banner}}} {
   background: #f0f0e0;
   border-bottom: 1px solid #ddd;
   display: none;
   margin: 0;
   padding: 0;
   position: relative;
   text-align: left;
   width: 100%;
 }
 div#{{{banner}}} div#{{{banner}}}-top {
   padding: 10px 10px 5px 10px;
 }
 div#{{{banner}}} div#{{{banner}}}-top:after {
   clear: both;
   content: ;
   display: block;
   height: 0;
   visibility: hidden;
 }
 * html div#{{{banner}}} div#{{{banner}}}-top {
   height: 1%;
 }
 div#{{{banner}}} div#{{{banner}}}-top img.video-thumb {
   border: 1px solid #ddd;
   cursor: pointer;
   display: block;
   float: right;
   margin: 0 30px 0 10px;
   padding: 0;
 }
 div#{{{banner}}} div#{{{banner}}}-top p.video-legal {
   float: right;
   font-size: 11px;
   line-height: 14px;
   margin: 9px 0 15px 35px;
   padding: 0;
   width: 190px;
 }
 div#{{{banner}}} div#{{{banner}}}-top p {
   font-size: 14px;
   line-height: 20px;
   margin: 0;
   padding: 0 30px 0 0;
 }
 div#{{{banner}}} div#{{{banner}}}-top p strong {
   font-size: 22px;
 }
 div#{{{banner}}} div#{{{banner}}}-top p em {
   font-weight: bold;
 }
 div#{{{banner}}} div#{{{banner}}}-top span {
   background: #ffcc00;
   border-radius: 5px;
   bottom: -13px;
   color: #000;
   cursor: pointer;
   display: block;
   float: left;
   font-size: 13px;
   font-weight: bold;
   left: 50%;
   margin: 0 0 2px -75px;
   padding: 5px 0;
   position: absolute;
   text-align: center;
   width: 150px;
   z-index: 9999;
   -moz-border-radius: 5px;
   -webkit-border-radius: 5px;
 }
 div#{{{banner}}} div#{{{banner}}}-top span:hover {
   text-decoration: underline;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom {
   padding: 0 20px 25px 10px;
   min-width: 925px;
   max-width: 1024px;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom:after {
   clear: both;
   content: ;
   display: block;
   height: 0;
   visibility: hidden;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom {
   display: none;
   margin: 10px 15px 0 0;  # here: 2nd was zero
   width: 800px;
 }
 * html div#{{{banner}}} div#{{{banner}}}-bottom {
   height: 1%;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom .video-container {
   float: right; 
   width: 560px;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom .video-container img {
   cursor: pointer;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom .video-container p {
   color: #333;
   font-size: 11px;
   line-height: 15px;
   margin: 5px 0 0 0;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom .video-attribution {
   float: right; 
   width: 560px;
   font-size: 11px;
   line-height: 14px;
   margin: 9px 0 15px 35px;
   padding: 0;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.editor, div#{{{banner}}} div#{{{banner}}}-bottom div.editor_link {
   float: left;
   margin: 0 7px;
   padding: 0;
   display: block;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.editor {
   line-height: 1.4em;
   width: 150px;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.editor_link {
   line-height: 1em;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.editor:after {
   clear: both;
   content: ;
   display: block;
   height: 0;
   visibility: hidden;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.editors {
   border-style: solid;
   border-width: 2px 0 0;
   float:right;
   clear:both;
   margin: 16px 0 0 0;
   padding: 7px 0 20px 0;
 }


 * html div#{{{banner}}} div#{{{banner}}}-bottom div.editor {
   height: 1%;
 }
   div#{{{banner}}} div#{{{banner}}}-bottom div.editor a {
     border: none;
     color: #000;
     display: block;
     float: left;
     margin: 0 0 18px 0;
     padding: 0;
     text-align: left;
     width: 135px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.editor a img {
     background: #fff;
     border: 1px solid #aaa;
     padding: 4px;
     width: 127px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.editor a span {
     color: #3366bb;
     display: block;
     font-size: 13px;
     font-weight: bold;
     line-height: 16px;
     margin: 5px 0 0 0;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.editor a em {
     color: #000;
     display: block;
     font-size: 11px;
     font-style: normal;
     font-weight: normal;
     line-height: 13px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom a.all {
     border: 2px solid #b9b9b9;
     display: block;
     float: left;
     font-size: 11px;
     margin: 0;
     padding: 5px 0;
     text-align: center;
     width: 133px;
     background-color: #303030;
     color: #99e0ff;
     font-weight: bold;
   }
 div#{{{banner}}} span#{{{banner}}}-close {
   display: block;
   position: absolute;
   right: 5px;
   top: 5px;
 }
 div#{{{banner}}} div#{{{banner}}}-bottom div.left-column {
     float: left;
     width: 310px;
     margin: 0 7px 0 38px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column h2 {
     border: none;
     border-bottom: 1px solid #aaa;
     color: #000;
     font-size: 20px;
     font-weight: bold;
     line-height: 22px;
     margin: 0 0 15px 0;
     padding: 0 0 3px 0;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul {
     margin: 0 0 23px 0;
     padding: 0;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul li {
     display: block;
     font-size: 13px;
     line-height: 16px;
     margin: 0 0 15px 0;
     padding: 0 27px 0 4px;
     position: relative;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul li b {
     font-size: 14px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul li img {
     left: 0;
     position: absolute;
     top: 0;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul li.first img {
     left: 10px;
   }
   div#{{{banner}}} div#{{{banner}}}-bottom div.left-column ul li strong {
     display: block;
     font-size: 17px;
     font-weight: bold;
   }

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column a#getstarted {

   display: -moz-inline-stack;
   display: inline-block;
   vertical-align: middle;
   *vertical-align: auto;
   zoom: 1;
   *display: inline;
   padding: 0.5em 1em;
   margin: 0 0 0 0;
   background-color: #c9c9c9;
   *background-color: #c9c9c9;
   *zoom: 1;
   filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFDCDCDC', endColorstr='#FFC9C9C9');
   background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dcdcdc), color-stop(100%, #c9c9c9));
   background-image: -webkit-linear-gradient(top, #dcdcdc,#c9c9c9);
   background-image: -moz-linear-gradient(top, #dcdcdc,#c9c9c9);
   background-image: -o-linear-gradient(top, #dcdcdc,#c9c9c9);
   background-image: linear-gradient(top, #dcdcdc,#c9c9c9);
   color: #4a4a4a;
   text-shadow: 0 1px 1px rgba(201,201,201,0.3);
   border: 1px solid #c4c4c4;
   -webkit-border-radius: 3px;
   -moz-border-radius: 3px;
   -ms-border-radius: 3px;
   -o-border-radius: 3px;
   border-radius: 3px;
   line-height: 18.2px;
   vertical-align: middle;
   text-align: center;
   text-decoration: none;
   font-family: "Helvetica Neue","Helvetica","Arial",sans-serif;
   font-size: 13px;
   font-weight: bold;
   cursor: pointer;

}

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column:disabled {

   cursor: default;

}

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column a#getstarted {

   background-color: #36b;
   *background-color: #36b;
   *zoom: 1;
   filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FF4779CD', endColorstr='#FF3366BB');
   background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4779cd), color-stop(100%, #3366bb));
   background-image: -webkit-linear-gradient(top, #4779cd,#3366bb);
   background-image: -moz-linear-gradient(top, #4779cd,#3366bb);
   background-image: -o-linear-gradient(top, #4779cd,#3366bb);
   background-image: linear-gradient(top, #4779cd,#3366bb);
   color: white;
   text-shadow: 0 1px 1px rgba(51,102,187,0.75);
   border: 1px solid #3162b3;
   display: block;
   font-size: 1em;

}

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column a#getstarted:hover {

   background-color: #4779cd;
   *background-color: #4779cd;
   *zoom: 1;
   filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FF5B88D2', endColorstr='#FF4779CD');
   background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5b88d2), color-stop(100%, #4779cd));
   background-image: -webkit-linear-gradient(top, #5b88d2,#4779cd);
   background-image: -moz-linear-gradient(top, #5b88d2,#4779cd);
   background-image: -o-linear-gradient(top, #5b88d2,#4779cd);
   background-image: linear-gradient(top, #5b88d2,#4779cd);

}

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column a#getstarted:active {

   background-image: none;
   background-color: #305faf;
   text-shadow: none;

}

div#{{{banner}}} div#{{{banner}}}-bottom div.left-column a#getstarted:disabled {

   background-image: none;
   background-color: #36b;
   opacity: 0.5;
   text-shadow: none;

}

a#meetmore {

   color: #3366BB;
   padding: 0.5em 0em;
   margin: 0 17px 20px 0;
   vertical-align: middle;
   text-align: center;
   text-decoration: none;
   font-family: sans-serif;
   font-weight: bold;
   font-size: 13px;

}

</style>

   <img class="video-thumb" src="//upload.wikimedia.org/wikipedia/donate/0/0b/Video-keyframe.jpg" height="100" width="184" />

Dear Wikipedia Readers: Thank You! 
We're the small non-profit that runs the #5 site on the web. Your overwhelming support let us finish our fundraiser early this year. Thank you! The donations you gave pay for the infrastructure and programs that empower the thousands of volunteers who create Wikipedia. Watch the video or click below to meet them.

   Meet Our Editors

You can edit Wikipedia!

  • Wikipedia is an encyclopedia — written from a neutral point of view, free for anyone to add to, modify, use and distribute.
  • It is created and maintained by a self-governing community of volunteers. Our guiding principles include "Be bold", "Be respectful", and "Ignore all rules" (when they prevent you from improving Wikipedia).
  • Sound like a place you belong? Create an account and we'll suggest a few articles that need your help where you can get started.
      <a href="//en.wikipedia.org/wiki/Special:UserLogin?returnto=Wikipedia:Introduction&type=signup&campaign=fr12b-{{{banner}}}" class="extiw" id="getstarted" title="w:Special:UserLogin/signup">Create Account</a>
     <img src="//upload.wikimedia.org/wikipedia/donate/0/0b/Video-keyframe.jpg" width="560" />

This video is hosted by YouTube under its <a href="https://www.youtube.com/t/terms" target="_blank">terms of use</a> and <a href="https://www.google.com/intl/en/policies/privacy/" target="_blank">privacy policy</a>. Please do not view without agreeing to their policies. Alternatively <a href="//wikimediafoundation.org/wiki/Thank_You_Main?commons=true" target="_blank">watch on Wikimedia Commons</a>.</a>

<a href="//commons.wikimedia.org/wiki/File:The_Impact_Of_Wikipedia.webm">The Impact of Wikipedia</a> by <a href="//commons.wikimedia.org/wiki/User:Vgrigas">Victor Grigas</a>, licensed as <a href="//creativecommons.org/licenses/by-sa/3.0/legalcode">CC-BY-SA 3.0 Unported</a>
       <a href="//wikimediafoundation.org/wiki/Thank_You/Poongothai_Balasubramanian" title="">
         <img src="//upload.wikimedia.org/wikipedia/commons/thumb/4/47/Balasubramanian_Poongothai-365.jpg/320px-Balasubramanian_Poongothai-365.jpg" alt="Poongothai" />
         Poongothai Retired mathematics teacher
       </a>
       <a href="//wikimediafoundation.org/wiki/Thank_You/Oarabile_Mudongo" title="">
         <img src="//upload.wikimedia.org/wikipedia/commons/thumb/1/13/Oarabile_Mudongo-6054.jpg/320px-Oarabile_Mudongo-6054.jpg" alt="Oarabile Mudongo" />
         Oarabile Student
       </a>
       <a href="//wikimediafoundation.org/wiki/Thank_You/Mei_Jiun_Kwek" title="">
         <img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/57/Mei_Jiun_Kwek-206.jpg/320px-Mei_Jiun_Kwek-206.jpg" alt="Mei Jiun" />
         Mei Jiun Scientist
       </a>
       <a href="//wikimediafoundation.org/wiki/Thank_You/Ken_Thomas" title="">
         <img src="//upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Ken_Thomas.jpg/320px-Ken_Thomas.jpg" alt="Ken" />
         Ken Construction Safety
Supervisor
</a>
       <a href="//wikimediafoundation.org/wiki/Thank_You/Ruben_Hilare-Quispe" title="">
         <img src="//upload.wikimedia.org/wikipedia/commons/3/38/Ruben_Hilare-Quispe_cropped.jpg" alt="Ruben" />
         Ruben Language preservationist
       </a>
 <img border="0" src="//bits.wikimedia.org/skins/common/images/closewindow19x19.png" alt="Close" />

<script type="text/javascript">

 //{{{hide-cookie-name}}} WTH more wtf
 //{{{hide-cookie-max-count}}}
   // MediaWiki:FR2012/Resources/DetermineShowHide.js
 // - This expects to be externeraly wrapped in script tags
 // This looks at cookie data and the page name to determine if a banner should be
 // shown. It then populates mw.centralNotice.bannerData.hideResult with true
 // if the banner should be shown. This will also increment the cookie count if
 // the result was a true result.
 //
 // Special Case: if the get param forceBannerDisplay == true the banner will never
 // be hidden.
 //
 // Relies on CN variable hide-cookie-name, and hide-cookie-max-count
 // also MediaWiki:FR2012/Resources/HidePageNameList.js
 (function determineShowHide() {
     // MediaWiki:FR2012/Resources/HidePageNameList.js
 // - This expects to be externeraly wrapped in script tags
 // This provides two lists of pages that should never have banners present
 // on them. One is a special page list, the other is just page names.
 // mw.centralNotice.bannerData.hidePageNameList is to be compared against wgPageName
 // mw.centralNotice.bannerData.hideSpecialPageList is to be compared against wgCanonicalSpecialPageName
 (function addHideLists() {
   mw.centralNotice.bannerData.hidePageNameList = [
     "Sandy_Hook_Elementary_School_shooting"
   ];
   
   mw.centralNotice.bannerData.hideSpecialPageList = [
     "CentralNotice",
     "NoticeTemplate"
   ];
 })();
 // END MediaWiki:FR2012/Resources/HidePageNameList.js
   mw.centralNotice.bannerData.cookieCount = parseInt($.cookie('{{{hide-cookie-name}}}')) | 0;
   if ((Boolean(mw.centralNotice.data.getVars.forceBannerDisplay) == true) || (
         (mw.centralNotice.bannerData.cookieCount < {{{hide-cookie-max-count}}}) &&
         ($.inArray(mw.config.get('wgPageName'), mw.centralNotice.bannerData.hidePageNameList) < 0) &&
         ($.inArray(wgCanonicalSpecialPageName, mw.centralNotice.bannerData.hideSpecialPageList) < 0)
      )
   ) {
     $.cookie('{{{hide-cookie-name}}}', mw.centralNotice.bannerData.cookieCount + 1, { expires: 30, path: '/' });
     mw.centralNotice.bannerData.hideResult = false;
   } else {
     mw.centralNotice.bannerData.hideResult = true;
   }
 })();
 // END MediaWiki:FR2012/Resources/DetermineShowHide.js

 mw.centralNotice.bannerData.alterImpressionData = function( impressionData ) {
   if (mw.centralNotice.bannerData.hideResult == true) { return false; }
   else { return true; }
 };
 $(document).ready( function () {
   $('body').prepend($('#centralNotice'));
   if (mw.centralNotice.bannerData.hideResult == false){
     addBannerSpace();
     $(window).resize(function() {
       addBannerSpace();
     })
     $('span#{{{banner}}}-close').click(function() {
       hideBanner();
       $('#mw-panel').css('top', '160px');
       $('#mw-head').css('top', '0px');
       $('#mw-page-base').css('padding-top', '0');
       return false;
     })
     mw.setConfig( 'EmbedPlayer.RewriteSelector', null );
     $("div#{{{banner}}} div#{{{banner}}}-top span").click(function () {
       if ($('div#{{{banner}}} div#{{{banner}}}-bottom').is(':visible')){
         killVideo();
         $("div#{{{banner}}} div#{{{banner}}}-top img.video-thumb").show(150);
         $("div#{{{banner}}} div#{{{banner}}}-top p.video-legal").show(150);
         $("div#{{{banner}}} div#{{{banner}}}-bottom").slideUp(150);
         $(this).removeClass('close').html("Meet Our Editors");
       } else {
         $("div#{{{banner}}} div#{{{banner}}}-top img.video-thumb").hide(150);
         $("div#{{{banner}}} div#{{{banner}}}-top p.video-legal").hide(150);
         $("div#{{{banner}}} div#{{{banner}}}-bottom").slideDown(150);
         $(this).html('Close');
       }
       setTimeout(addBannerSpace, 200);
       return false;
     });
     $("div#{{{banner}}}-bottom div.video-container img, div#{{{banner}}} div#{{{banner}}}-top img.video-thumb").click(function () {
       startVideo();
       $("div#{{{banner}}} div#{{{banner}}}-top img.video-thumb").hide(150);
       $("div#{{{banner}}} div#{{{banner}}}-top p.video-legal").hide(150);
       $("div#{{{banner}}} div#{{{banner}}}-bottom").slideDown(150);
       $("div#{{{banner}}} div#{{{banner}}}-top span").html('Close');
       setTimeout(addBannerSpace, 200);
     });
   }
   stashPlayerTemplate = $("#youtube-video").clone().detach();
 });
 function killVideo() {
   if (window.player !== undefined){
     if (player.pauseVideo) { player.pauseVideo(); }
     else {
       $("#youtube-video").attr("src", "");
       $("#youtube-video").replaceWith(window.stashPlayerTemplate);
     }
   }
 }
 function startVideo() {
   mw.centralNotice.recordImpression({'result':'ytvideo-click', 'banner':'{{{banner}}}', 'country':Geo.country});
   if (window.YT) {
     onYouTubeIframeAPIReady();
   } else {
     var tag = document.createElement('script');
     tag.src = "//www.youtube.com/iframe_api";
     var firstScriptTag = document.getElementsByTagName('script')[0];
     firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
   }
 }
 function onYouTubeIframeAPIReady() {
   var playerW = parseInt('560');
   var playerH = playerW * 0.5625; //aspect ratio
   player = new YT.Player('youtube-video', {
     width: playerW,
     height: playerH,
     frameborder : 0,
     allowfullscreen : "1",
     videoId: '3Knv6D6Thi0',
     playerVars: {
       autoplay: 1,
       origin: "https://donate.wikimedia.org"
     }
   });
 }
 function addBannerSpace() {
   var expandableBannerHeight = $('div#{{{banner}}}').height();
   $('#mw-panel').css('top', expandableBannerHeight+160);
   $('#mw-head').css('top', expandableBannerHeight);
   $('#{{{banner}}}').css('display', 'block');
 }

</script> <script type="text/javascript" language="javascript"> var getQuerystring = function(key) {

   key = key.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' );
   var regex = new RegExp( '[\\?&]' + key + '=([a-zA-Z0-9\_\-]*)' );
   var qs = regex.exec( window.location.search );
   return qs == null ?  : qs[1];

};

var bannerChooseRandom = function(choiceString) {

   var choices = choiceString.split(',');
   if ( choices.length ) {
       return choices[Math.floor( Math.random() * choices.length )].replace(/^\s+|\s+$/, );
   }
   return ;

};

$(document).ready( function () {

   if(getQuerystring('country') != ){
       Geo.country = getQuerystring('country');
   }
   
   $("a.localize").each(
       function(index){
           var url = $(this).attr("href");
           if( url.indexOf("?") == -1 ){
               url = url + "?"
           } else {
               url = url + "&"
           }
           $(this).attr("href", url + "country=" + Geo.country + "&language=" + mw.config.get('wgUserLanguage')
               + "&uselang=" + mw.config.get('wgUserLanguage'));
       }
   );
   
   if ( wgCanonicalSpecialPageName != "CentralNotice" && wgCanonicalSpecialPageName != "NoticeTemplate" ){
       var currencySymbol = '$';
       switch(Geo.country){
           case 'GB':
               currencySymbol = '£'; break;
           case 'IT':
               currencySymbol = '€'; break;
           default:
               currencySymbol = '$';
       }
       if(currencySymbol != '$'){
           $("div#{{{banner}}} p").each(function(index){
               $(this).html( $(this).html().replace(/\$/g, currencySymbol) );
           });
       }
   }
   

}); </script> <script type='text/javascript'> function validateForm(form) {

   var minimums = {
       'USD':1,
       'GBP':1, // $1.26
       'EUR':1, // $1.26
       'AUD':2, // $1.35
       'CAD':1, // $0.84
       'CHF':1, // $0.85
       'CZK':20, // $1.03
       'DKK':5, // $0.85
       'HKD':10, // $1.29
       'HUF':200, // $0.97
       'JPY':100, // $1
       'NZD':2, // $1.18
       'NOK':10, // $1.44
       'PLN':5, // $1.78
       'SGD':2, // $1.35
       'SEK':10, // $1.28
       'ILS':5 // $1.39
   };
   var error = true;
   // Get amount selection
   var amount = null;
   for (var i = 0; i < form.amount.length; i++) {
       if (form.amount[i].checked) {
           amount = form.amount[i].value;
       }
   }
   if (form.amountGiven.value != "") {
       var otherAmount = form.amountGiven.value;
       otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
       otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
       otherAmount = otherAmount.replace(/[\$,.]/g, );
       otherAmount = otherAmount.replace(/:/, '.');
       form.amountGiven.value = otherAmount;
       amount = otherAmount;
   }
   // Check amount is a real number
   error = ( amount == null || isNaN(amount) || amount.value <= 0 );
   // Check amount is at least the minimum
   var currency = form.currency_code.value;
   if (typeof( minimums[currency] ) == 'undefined') {
       minimums[currency] = 1;
   }
   if (amount < minimums[currency] || error) {
       alert('You must contribute at least $1'.replace('$1', minimums[currency] + ' ' + currency));
       error = true;
   }
   return !error;

} function redirectPayment(i) {

   var ccforms = {
       'US' : 'cc-vmad',
       'AU' : 'cc-vmaj,email-cc-vmaj',
       'CA' : 'cc-vm',
       'GB' : 'cc-vma',
       'NZ' : 'cc-vma',
       'IT' : 'cc-vma'
   };
   var ccformName = bannerChooseRandom( ccforms[Geo.country] );
   var language = mw.config.get('wgUserLanguage');
   var rccforms = {
       'US' : 'rcc-vmad',
       'AU' : 'rcc-vmaj',
       'CA' : 'rcc-vm',
       'GB' : 'rcc-vma',
       'NZ' : 'rcc-vma',
       'IT' : 'rcc-vma'
   };
   var rccformName = bannerChooseRandom( rccforms[Geo.country] );
   var frequency = $("input[name='frequency']:checked").val();
   if( frequency != "monthly" ){
       frequency = "onetime";
   }
   //if i == 1
   var paymentType = "cc";
   var action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=" + language + "\x26appeal=JimmyQuote\x26form_name=RapidHtml\x26ffname=";
   if( frequency == "monthly"){
       action_url += rccformName;
       paymentType = "rcc";
   } else {
       action_url += ccformName;
   }
   if (i == 2) {
       action_url = "https://foundation.wikimedia.org/wiki/Special:ContributionTracking/" + language;
       paymentType = "pp";
       if( frequency == "monthly"){
           $('<input>').attr({
               type : 'hidden',
               id : 'recurring-hidden',
               name : 'recurring_paypal',
               value : "true"
           }).appendTo( $("form[name='paypalcontribution']") );
           paymentType = "rpp";
       }
   }
   if (i == 3) {
       action_url = "https://payments.wikimedia.org/index.php/Special:AmazonGateway?redirect=1\x26uselang=" + language;
       paymentType = "amazon";
   }
   if (i == 4) {
       formName = "obt-bpay";
       action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=" + language + "\x26form_name=RapidHtml\x26ffname=" + formName + "\x26appeal=JimmyQuote";
       paymentType = "bpay";
   }
   if (i == 5) {
       formName = "ew-webmoney";
       action_url = "https://payments.wikimedia.org/index.php/Special:GlobalCollectGateway?uselang=" + language + "\x26form_name=RapidHtml\x26ffname=" + formName + "\x26appeal=JimmyQuote";
       paymentType = "ew";
   }
   document.paypalcontribution.action = action_url;
   document.paypalcontribution.utm_source.value = '{{{banner}}}.no-LP' + '.' + paymentType;
   document.paypalcontribution.payment_method.value = paymentType;
   if (validateForm(document.paypalcontribution)) {
       document.paypalcontribution.submit();
   }

}

$(document).ready( function () {

   if ( wgCanonicalSpecialPageName != "CentralNotice" && wgCanonicalSpecialPageName != "NoticeTemplate" ){
       // append the banner count in utm-key
       var cookieName = 'centralnotice_bannercount_fr12';
       var count = $.cookie(cookieName);
       $('[name="paypalcontribution"]').append(
           $('<input type="hidden" name="utm_key" />').attr('value', count));
       // do country-specific things
       var currency = "USD";
       var symbol = "$";
       switch(Geo.country){
           case 'AU':
               $(".paymentmethod-bpay").css("display", ""); //do not set to block
               currency = "AUD";
               break;
           case 'CA':
               currency = "CAD";
               break;
           case 'GB':
               currency = "GBP";
               symbol = "£";
               break;
           case 'IT':
               currency = "EUR";
               symbol = "€";
               break;
           case 'NZ':
               currency = "NZD";
               break;
           case 'US':
               $(".us-only").css("display", "");
               $(".paymentmethod-amazon").css("display", ""); //do not set to block
               break;
           default:
       }
       // set the form fields
       $("input[name='country']").val(Geo.country);
       $("input[name='currency_code']").val(currency);
       $("input[name='language']").val(mw.config.get('wgUserLanguage'));
       $("input[name='return_to']").val("Thank_You/" + mw.config.get('wgUserLanguage'));
       // do fun things to localize currency in the banner and form
       $("input[name='amount']").each(function(index){
           var id = $(this).attr("id");
           var label = $("label[for='" + id + "']");
           label.text(label.text().replace(/\$/, symbol));
       });
   }

});

function toggleMonthly( monthly ){

   if( monthly.type == "checkbox" ){
       monthly = monthly.checked;
   }
   var onetimeonly = $(".no-monthly");
   if( monthly ){
       onetimeonly.css("display", "none");
   } else {
       onetimeonly.css("display", "");
       if( Geo.country != "US" ){
           $(".paymentmethod-amazon").css("display", "none");
       }
       if( Geo.country != "AU" ){
           $(".paymentmethod-bpay").css("display", "none");
       }
   }

} </script>