<?php
/**
 * @name          : Joomla Social Pinboard
 * @version	  	  : 1.5.0
 * @package       : apptha
 * @since         : Joomla 1.5
 * @author        : Apptha - http://www.apptha.com
 * @copyright     : Copyright (C) 2011 Powered by Apptha
 * @license       : http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 * @abstract      : Social Pinboard Module rss feed
 * @Creation Date : August 2013
 * @Modified Date : March 2014
 * */
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
?>

<script src="components/com_wishlogue/javascript/jquery.popupoverlay.js"></script>

<script type="text/javascript">
    function rssfeed()
    {
        var radios = document.getElementsByName('opt');
        if (radios[0].checked) {
            val = radios[0].value;
        }
        else if (radios[1].checked) {
            val = radios[1].value;
        }

        if (val == 'top10') {
			var url = "<?php echo JRoute::_('index.php?option=com_wishlogue&view=ajaxcontrol&tmpl=component&task=getWishesRSS'); ?>";
			window.open(url, '_blank');
        }
        else if (val == 'wwya') {
			var url = "<?php echo JRoute::_('index.php?option=com_wishlogue&view=ajaxcontrol&tmpl=component&task=getArticlesRSS'); ?>";
			window.open(url, '_blank');		
        }
        else {
            alert("Please select a option..");
        }
    }
</script>

<?php

    ?>

    <div id="my_modal" class="well" style="display:none;margin:1em;">
            <a href="#" class="my_modal_close" style="float:right;padding:0 0.4em;"></a>
            <input type="radio" id="opt1" name="opt" value="top10" checked>
			<span onclick="document.getElementById('opt1').checked = 'true';">Top 10 Wishes</span>
            <input type="radio" id="opt2" name="opt" value="wwya">
			<span onclick="document.getElementById('opt2').checked = 'true';">Articles from We Wish You A… page</span>
            <input type="button" onclick="rssfeed();" value="Show RSS Feed" >
    </div>
<a class="my_modal_open rightmodulebox rssfeed"><i></i><h2><?php echo JText::_('MOD_WISHLOGUE_RSS_FEED'); ?></h2></a>



<script>
    jQuery(document).ready(function() {
        jQuery('.my_modal_open').click(function() {
            jQuery('#my_modal').popup({
                'autoopen': true
            });
        });
    });
</script>