<?php
/**
 * aheadWorks Co.
 *
 * 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://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<?php if(!$this->getScriptIncluded() && $this->getCanDisplayContainer()): ?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/giftmessage.js') ?>"></script>
<?php $this->setScriptIncluded(true); ?>
<?php endif; ?>
<?php if($this->getCanDisplayContainer()): ?>
<div id="<?php echo $this->getId() ?>">
<?php endif; ?>
<?php switch ($this->getType()): ?>
<?php case 'item': ?>
    <button class="form-button-alt listen-for-click" type="button"><span>
        <?php if($this->hasGiftMessage()): ?>
        <?php echo $this->__('Edit') ?>
        <?php else: ?>
        <?php echo $this->__('Add') ?>
        <?php endif; ?>
    </span></button>
    <?php break; ?>
<?php case 'main': ?>
    <a href="#" class="listen-for-click">
        <?php if($this->hasGiftMessage()): ?>
        <?php echo $this->__('Edit Gift Message') ?>
        <?php else: ?>
        <?php echo $this->__('Add Gift Message') ?>
        <?php endif; ?>
    </a>
    <?php break; ?>
<?php case 'address': ?>
    <a href="#" class="listen-for-click">
        <?php if($this->hasGiftMessage()): ?>
        <?php echo $this->__('Edit Gift Message') ?>
        <?php else: ?>
        <?php echo $this->__('Add Gift Message') ?>
        <?php endif; ?>
    </a>
    <?php break; ?>
<?php case 'address_item': ?>
    <button class="form-button-alt listen-for-click" type="button"><span>
        <?php if($this->hasGiftMessage()): ?>
        <?php echo $this->__('Edit') ?>
        <?php else: ?>
        <?php echo $this->__('Add') ?>
        <?php endif; ?>
    </span></button>
    <?php break; ?>
<?php endswitch ?>
<?php if($this->getCanDisplayContainer()): ?>
</div>
<script type="text/javascript">
<!--
var <?php echo $this->getJsObjectName() ?> = new GiftMessage('<?php echo $this->getId() ?>');
<?php echo $this->getJsObjectName() ?>.url = '<?php echo $this->getEditUrl() ?>';
//-->
</script>
<?php endif; ?>
