<?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
 */
?>
<div class="in-page">
    <div class="page-head">
        <h3><?php echo $this->__('Share Your Wishlist') ?></h3>
    </div>
    <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <form action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post">
    <?php echo $this->getBlockHtml('formkey')?>
    <fieldset class="group-select">
        <h4 class="legend"><?php echo $this->__('Sharing Information') ?></h4>
        <ul class="form-list">
            <li>
                <label for="email_address"><?php echo $this->__('Email addresses, separated by commas') ?> <span class="required">*</span></label><br/>
                <textarea name="emails" cols="5" rows="5" style="width:99%;height:50px;" class="validate-emails required-entry"><?php echo $this->getEnteredData('emails') ?></textarea>
            </li>
            <li>
                <label for="message"><?php echo $this->__('Message') ?></label><br/>
                <textarea id="message" name="message" cols="5" rows="5" style="width:99%;height:80px;"><?php echo $this->getEnteredData('message') ?></textarea>
            </li>
            <?php if($this->helper('wishlist')->isRssAllow()): ?>
            <li>
                <input type="checkbox" name="rss_url" id="rss_url" value="1" />
                <label for="rss_url"><?php echo $this->__('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></label>
            </li>
            <?php endif; ?>
        </ul>
    </fieldset>
    <div class="col2-alt-set button-set">
        <div class="col-1">
            <p class="required"><?php echo $this->__('* Required Fields') ?></p>
            <br /><br />
            <a href="<?php echo $this->getUrl('*/')?>" class="left">&laquo; <?php echo $this->__('Back')?></a>
        </div>
        <div class="col-2">
            <div class="form-buttons">
                <button type="submit" class="form-button"><span><?php echo $this->__('Share Wishlist') ?></span></button>
            </div>
        </div>
    </div><div class="clear"></div><br /><br />
    </form>
</div>
<script type="text/javascript">
<!--
Validation.addAllThese([
    ['validate-emails', '<?php echo $this->__('Please enter a valid email addresses, separated by commas. For example johndoe@domain.com, johnsmith@domain.com.') ?>', function (v) {
                if(Validation.get('IsEmpty').test(v)) {
                    return true;
                }

                var valid_regexp = /^[a-z0-9\._-]{1,30}@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/;
                var emails = v.split(',');

                for (var i=0; i<emails.length; i++) {
                    if(!valid_regexp.test(emails[i].strip())) {
                        return false;
                    }
                }

                return true;
            }]
]);
var dataForm = new VarienForm('form-validate', true);
//-->
</script>
