<script>

function CheckForCCDisplay(selObj){

var inarray=0;
autopayment = selObj.substr(0,1);
selObj = selObj.substr(2);
<!-- echo list the possible plugins that require cc information -->
validpluginsforcc = new Array({VALIDPLUGINSFORCC})
{STRAVAILABLECCARRAY}
<!-- for loop to take a look and see if the selected plugin accepts cc information -->
for (x=0;x<{ARRAYCOUNT};x++){
    if (selObj==validpluginsforcc[x]) inarray=1;
}
visabit=0;mcbit=0;amexbit=0;discoverbit=0;
<!-- if inarray is 1 then we need to show credit card information -->
if (inarray==1) {
    if (pluginsforcc[selObj][{CCREDITVISA}]==1){
        visabit=1;
        $('visa_logo').style.display="";
    } else {
        $('visa_logo').style.display="none";
    }
    if (pluginsforcc[selObj][{CCREDITMC}]==1){
        mcbit=1;
        $('mastercard_logo').style.display="";
    } else {
        $('mastercard_logo').style.display="none";
    }
    if (pluginsforcc[selObj][{CCREDITAMEX}]==1){
        amexbit=1;
        $('americanexpress_logo').style.display="";
    } else {
        $('americanexpress_logo').style.display="none";
    }
    if (pluginsforcc[selObj][{CCREDITDISC}  ]==1){
        discoverbit=1;
        $('discover_logo').style.display="";
    } else {
        $('discover_logo').style.display="none";
    }
    document.forms['accountinfo'].elements['c_ccnumber'].value='[l]Invalid Credit Card Number[/l]';
    $('creditcardinfo').style.display="";
    document.forms['accountinfo'].elements['r_ccnumber'].value='[l]Credit Card is Required[/l]';
} else {
    document.forms['accountinfo'].elements['c_ccnumber'].value='';
    document.forms['accountinfo'].elements['r_ccnumber'].value='';
    $('creditcardinfo').style.display="none";
}
document.forms['accountinfo'].elements['validcc'].value=""+visabit+mcbit+amexbit+discoverbit+"";
document.forms['accountinfo'].elements['autopayment'].value=autopayment;
}

</script>
<!-- BEGIN DYNAMIC BLOCK: billingerror -->
<div style="text-align:center"><font class="red"><b>[l]Credit Card Authorization Failed[/l]<br></font>{THEBILLINGERROR}</b></div>
<!-- END DYNAMIC BLOCK: billingerror -->
<div id="billingblock" style="display:{BILLINGBLOCKSTYLE}">
<table width="100%" cellpadding="4" cellspacing="1" border="0">
<tr align="center"><td width="35%" align="right" class="step3tdbg">[l]Payment Method[/l]:</td>
<td width="65%" align="left">
<select name="paymenttype" class="dropdown" onChange="SwitchRecurringVisibility(this); CheckForCCDisplay(this.options[this.selectedIndex].value);">
<!-- BEGIN DYNAMIC BLOCK: plugin_names -->
<option value='{GATEWAYVALUE}' {GATEWAYSELECTED}>{GATEWAYTSIGNUPNAME}&nbsp;&nbsp;&nbsp;</option>
<!-- END DYNAMIC BLOCK: plugin_names -->
</select>
<span id="recurringField" style="visibility:{RECURRINGVISIBILITY}">
<!-- BEGIN DYNAMIC BLOCK: not_price_included -->
<input type="hidden" id="use_paypal_subscriptions" name="use_paypal_subscriptions" value="0"/>
<!-- END DYNAMIC BLOCK: not_price_included -->
<!-- BEGIN DYNAMIC BLOCK: plugin_paypal_force -->
&nbsp;&nbsp;[l]Use subscription[/l]: <input type="checkbox" id="use_paypal_subscriptions" name="use_paypal_subscriptions" value="1" {CHECKED} /> {USERECURRINGSUBSCRIPTIONNOTE}
<!-- END DYNAMIC BLOCK: plugin_paypal_force -->
<!-- BEGIN DYNAMIC BLOCK: use_paypal_subscriptions -->
<input type="hidden" id="use_paypal_subscriptions" name="use_paypal_subscriptions" value="1"/>
<!-- END DYNAMIC BLOCK: use_paypal_subscriptions -->
</span>
</td>
</tr>
<tr><td colspan="2">
<input type="hidden" name="autopayment" value="{AUTOPAYMENT}">
<!-- credit card information if the select plugin accepts it -->
<div id="creditcardinfo" style="display:{DISPLAYCC}">
<table width="100%" cellpadding="2" cellspacing="0">
<tr class="{INTCOLORINDEX}">
<td height="23" width="35%" class="step3tdbg" align="right">
[l]Credit Card Number[/l]:&nbsp;&nbsp;</td>
<td width="65%">
<input type="text" class="txtbox" name="ccnumber" value="{CCNUMBER}" size="30" class="required" onkeypress="return noenter(event)">
<input type="hidden" name="c_ccnumber" value="{INVALIDCC}">
<input type="hidden" name="r_ccnumber" value="{REQUIREDCC}">
</td></tr>
<tr><td height="23" width="35%" class="step3tdbg" align="right">[l]Expiration Month[/l]:&nbsp;&nbsp;</td>
<td width="65%"><select type="text" class="dropdown" name="ccmonth">
<!-- BEGIN DYNAMIC BLOCK: monthoption -->
<option value="{MONTHVALUE}"{MONTHSELECTED}>{MONTHNUMBER} - {MONTHNAME}</option>
<!-- END DYNAMIC BLOCK: monthoption -->
</select></td></tr>
<tr><td height="23" width="35%" class="step3tdbg" align="right">[l]Expiration Year[/l]:&nbsp;&nbsp;</td>
<td width="65%"><select class="dropdown" type="text" name="ccyear">
<!-- BEGIN DYNAMIC BLOCK: yearoption -->
<option value="{CCYEAR}" {YEARSELECTED}>{CCYEAR}</option>
<!-- END DYNAMIC BLOCK: yearoption -->
</select></td>
<tr><td height="23" width="35%" class="step3tdbg" align="right">[l]Accepting[/l]:&nbsp;&nbsp;</td><td width="65%">
<img src="images/visa_logo.gif" style="display:{VISASTYLE}" id="visa_logo">
<img src="images/mastercard_logo.gif" style="display:{MASTERCARDSTYLE}" id="mastercard_logo">
<img src="images/americanexpress_logo.gif" style="display:{AMEXSTYLE}" id="americanexpress_logo">
<img src="images/discover_logo.gif" style="display:{DISCSTYLE}" id="discover_logo">
<input type="hidden" name="validcc" value="{BITVALIDCC}">
</td>
</tr>
</table>
</div>
</td></tr>
</table>
</div>
<span id="billingblockmember" style="display:{BILLINGBLOCKMEMBER}">
<center class="step3tdbg" style="background-color:white">[l]Your existing billing method will be used[/l]</center>
</span>
<!-- BEGIN DYNAMIC BLOCK: coupons -->
<table width="100%" cellpadding="2" cellspacing="0">
<tr>
    <td width="35%" align="right" valign="top" class="step3tdbg">[l]Coupon Code[/l]:</td>
    <td width="65%" align="left" valign="top">
        <input type="text" class="txtbox" name="coupon_code" value="{couponCode}" />
        <input type="button" class="button_medium" value="[l]validate[/l]" onclick="validateCoupon(this.form)" />
        <span id="invalid_code" style="margin-left:5px; visibility:hidden; color:red; font-weight:bold">[l]Invalid Code[/l]</span>
        <div id="coupon_name" style="font-weight:bold"></div>
        <div id="coupon_description"></div>
    </td>
</tr>
</table>
<!-- END DYNAMIC BLOCK: coupons -->

