<?php 
drupal_add_js($theme_path . '/js/jqModal.js', 'file');
drupal_add_css($theme_path . '/css/jqModal.css', 'file');

//widget button
?>
<button type="button" class="pay-by-check-btn"><?php print t('Pay by check, stock, or wire transfer'); ?></button> 
<?php
//set poject name
$project_name = false;
if(isset($_GET['project_id'])) {
  if ($project = node_load($_GET['project_id'])) {
    $project_name = $project->title;
  }
}

//set user name
global $user;
$user_language = (isset($user->language)) ? $user->language : LANGUAGE_NONE;
$name = false;
if (isset($user->full_name[$user_language][0]['value'])) $name = $user->full_name[$user_language][0]['value'];
else if (isset($user->name)) $name = $user->name;

//set user email
$mail = (isset($user->mail)) ? $user->mail : false;

//set donation amount
$amount = (isset($_GET['amount'])) ? $_GET['amount'] : false;
?>
<div class="pay-by-check-modal jqmWindow">
<h2>Pay by check, stock, or wire transfer</h2>
<button class="jqmClose" type="button">X</button>
<p>
 Thanks<b><?php if ($name) print ', ' . $name; ?></b>!	 You	want	to give<b><?php if ($amount) print ' $' . $amount; ?></b><?php if ($project_name) print ' to ' . $project_name; ?> by check. <br>Great, it’s easy.  Just do the following:
</p>
<p>Please make checks payable to <strong>Women Deliver</strong>, our fiscal sponsor</p>
<p>Make sure that we have the right information to track and direct your donation.  Write <b><?php print ($mail) ? $mail : 'your email address'; ?> and <?php print ($project_name) ? $project_name : 'the project name'; ?> on the check.</b></p>

<ul><li>
Mail the check to:<br>
Women Deliver - Catapult Platform<br /> 	
584 Broadway,	Suite	306<br /> 
New	York, NY 10012<br /> 	
USA
</li></ul>
<p>We’ll e-mail to let you know when your donation has been processed. <br>Thanks!</p>
<hr>
<h3>To give stock by wire transfer</h3>
<p>Please contact [name] or call us at [phone number] for details</p>
<p>We're able to accept donations in the form of stock, government (including municipal) debt 
and corporate debt through the Depository Trust Company (DTC). For security, settlement 
and reduced paperwork, electronic transfer through the DTC is preferred. This can be 
arranged from most brokerage accounts.
</p>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
  jQuery('.pay-by-check-modal').jqm({
    onHide: closePayByCheck,
    onShow: fixOverlays,
    overlay:1
  });
  jQuery('.pay-by-check-modal').jqmAddTrigger('button.pay-by-check-btn'); 
  function closePayByCheck() {
    jQuery('.pay-by-check-modal').hide();  
    clearOverlays();
  }
  jQuery('.pay-by-check-btn').css('margin-top', jQuery('#donate-title').height() - 52);
});
</script>


<!--
<p>
If you want you can <a href="Javascript: jQuery('#paybycheckprintwindow').get(0).contentWindow.focus(); jQuery('#paybycheckprintwindow').get(0).contentWindow.print();">print</a> and mail a copy of this page with your check to help process the donation.
</p>
<br />
<p>
<iframe id="paybycheckprintwindow" name="paybycheckprintwindow" style="display:none;" src="/donations/paybycheck/print?name=<?php print urlencode($name); ?>&amount=<?php print urlencode($amount); ?>&email=<?php print urlencode($mail); ?>&project_name=<?php print urlencode($project_name); ?>"></iframe>
-->