function confirmPopulate(g,e,c){var a=g.split(",");var b="";if(e==""&&a.length==1){e="confirm_"+g}if(e=="confirm_donationAmount"){g="donationAmountOther"}var h=' <span class="confirmEditButton"><a href="javascript: confirmEdit(\''+g+"','"+e+"');\">edit</a></span>";for(var d=0;d<a.length;d++){if(g=="title"){b=b+titles[$(("#"+a[d])).val()]}else{if(e=="confirm_receiptName"){if($(("#"+a[d])).attr("checked")&&a[d]=="receiptNameName"){b="My Name"}if($(("#"+a[d])).attr("checked")&&a[d]=="receiptNameOrganisation"){b="My Organisation's Name: "+$("#organisationName").val()}}else{b=b+$(("#"+a[d])).val();b=b.replace("<br>","[br]");b=b.replace(/</g,"&lt;").replace(/>/g,"&gt;");b=b.replace("[br]","<br>");if(g=="donationAmountOther"){b="$"+b}}}if(d<(a.length-1)){if(a[d]=="phoneType1"){if(b=="H"){b="Home"}if(b=="W"){b="Work"}if(b=="M"){b="Mobile"}}b=b+c}}if(b.replace(c,"")==""){$("#"+e).html("Not entered"+h)}else{$("#"+e).html(b+h)}}function confirmEdit(h,g){var a=h.split(",");if(g==""&&a.length==1){g="confirm_"+h}if(g=="confirm_receiptName"){$("#receiptNameSPAN").show();$("#organisationName").show()}var e="#"+g;var b="";for(var c=0;c<a.length;c++){var d="#"+a[c];$(d).show()}if(a.length>1){b='<span class="confirmDoneButton confirmDone_'+g+'"><a href="javascript: confirmDone(\''+h+"','"+g+"');\">done</a></span>";$(e).before(b);$("#"+a[0]).focus()}else{$("#"+h).focus();if(h=="suburbAuto"||h=="venueSuburbAuto"||h=="countryAuto"||(h=="suburb"&&$("#country").val()==2031)){$("#"+h).select()}else{$("#"+h).blur(function(){confirmDone(h,g)})}}$(e).hide()}function confirmDone(j,h){var g=true;var b=j.split(",");var e="#"+h;var a=$(e).parents("form:first").attr("id");for(var c=0;c<b.length;c++){var d="#"+b[c];if(!$("#"+a).validate().element(d)){g=false}if(b[c]=="email"&&!(a=="olaLetterForm")){if(!$("#"+a).validate().element("#email2")){confirmEdit("email2","")}}}if(g){for(var c=0;c<b.length;c++){var d="#"+b[c];$(d).hide()}$(".confirmDone_"+h).remove();if(h=="confirm_receiptName"){$("#receiptNameSPAN").hide()}$(e).show()}}function scrollToElement(b){var a=0;var c=0;while(b!=null){a+=b.offsetLeft;c+=b.offsetTop;b=b.offsetParent}window.scrollTo(a,c)};
