Template:2010/Donate-now-wmnl2

 function validateForm( form ) {

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 != "" ) { amount = form.amountGiven.value; }

// Check amount is a real number error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); if ( error ) { alert( ' ' ); }

// Check amount is at least the minimum var currency = 'EUR';

return !error; }

function redirectPayment(i) { //if i == 1 var paymentType ="cc"; var action_url = "http://donations.wmnederland.nl/" ; if (i==2) {action_url="http://donations.wmnederland.nl/index.php?action=paymentoptions"; paymentType = "pp"; }   document.paypalcontribution.action = action_url; document.paypalcontribution.custom.value = getQuerystring( 'utm_source' ) + '.' + getLandingPage + '.' + paymentType; if(validateForm(document.paypalcontribution)){ if(typeof(OWA) !== 'undefined'){OWATracker.shareStateByPost( document.paypalcontribution );} document.paypalcontribution.submit; } }          

  €  € <input type="radio" name="amount" id="input_amount_2" onclick="document.paypalcontribution. amountGiven.value = ''" value=" "><label for="input_amount_2"> € <input type="radio" name="amount" id="input_amount_3" onclick="document.paypalcontribution. amountGiven.value = ''" value=" "><label for="input_amount_3"> €

<input type="radio" name="amount" id="input_amount_other" value="Other"><label for="input_amount_other"> <input type="text" name="amountGiven" size="4" onfocus="this.form.input_amount_other.checked=true;">

<input type="button" value=" " class="input-button  " onclick="redirectPayment('1');"/>

<input type="button" value=" " class="input-button  " onclick="redirectPayment('2');"/>

<p style="margin-top: 1em;">

<script type="text/javascript"> function getQuerystring( 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]; }

function getLandingPage {  var path = "  ";

if( path == "default"){ pathArray = window.location.pathname.split( '/' ); return pathArray[2]; }  else return path; }

function updateCC( currency ) { if ( ( currency == 'AUD' ) || ( currency == 'CAD' ) || ( currency == 'EUR' ) ||    (currency == 'GBP' ) || ( currency == 'JPY' ) || ( currency == 'USD' ) ) { document.getElementById('cc-donate-button').style.display = " "; } else { document.getElementById('cc-donate-button').style.display = "none"; } } document.paypalcontribution.utm_medium.value = getQuerystring( 'utm_medium' ); document.paypalcontribution.utm_campaign.value = getQuerystring( 'utm_campaign' ); document.paypalcontribution.referrer.value = document.referrer;