<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<script type="text/javascript" src="<?php echo $this->getJsUrl('varien/accordion.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/opcheckout.js') ?>"></script>
<script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>

<div id="content">
	<div id="checkout" class="clearfix">
		<div id="checkout-form-area" class="white-box">
			<ol class="opc" id="checkoutSteps">
			<?php $i=0; foreach($this->getSteps() as $_stepId => $_stepInfo): ?>
			<?php if (!$this->getChild($_stepId) || !$this->getChild($_stepId)->isShow()): continue; endif; $i++ ?>
			    <li id="opc-<?php echo $_stepId ?>" class="section<?php echo !empty($_stepInfo['allow'])?' allow':'' ?><?php echo !empty($_stepInfo['complete'])?' saved':'' ?>">
			        <div class="step-title">
			            <h3><?php echo $_stepInfo['label'] ?></h3>
			            <?php /* <a href="#" class="edit-link"><?php echo $this->__('Edit') ?></a> */ ?>
			        </div>
			        <div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">
			            <?php echo $this->getChildHtml($_stepId) ?>
			        </div>
			    </li>
			<?php endforeach ?>
			</ol>
		
			<script type="text/javascript">
			//<![CDATA[
			    var accordion = new Accordion('checkoutSteps', '.step-title', true);
			    <?php if($this->getActiveStep()): ?>
			    accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
			    <?php endif ?>
			    var checkout = new Checkout(accordion,{
			        progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
			        review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
			        saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
			        failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
			    );
			//]]>
			</script>
		</div>
	</div>
</div>