﻿$(document).ready(function () {
   makePager();
   $("#main article:odd").addClass("altRow");
   $('#header_panel').removeClass('hidden');
});

function makePager() {
     $('#RadDataPager1').removeClass('RadDataPager');
     $('#RadDataPager1').removeClass('RadDataPager_Sitefinity');
     var pager_txt = '<ul id="articlePagination">\r\n';

     $("#RadDataPager1 .rdpWrap a").each(function (i) {
         var link = '';
         var label = '';
         label = $(this).text();
         link = $(this).attr('href');
         if (label == '') {
             label = $(this).attr('title');
         }
         if ($(this).hasClass('rdpCurrentPage')) {
             pager_txt += '<li class="selected"><a href="' + link + '">' + label + '</a></li>\r\n';
         } else {
             pager_txt += '<li><a href="' + link + '">' + label + '</a></li>\r\n';
         }
     });
     pager_txt += '</ul>\r\n';

     $('#RadDataPager1').html(pager_txt);
     $('#RadDataPager1').removeClass('hidden');
 }

 function loadSocial(url, sender, articleTitle) {
 if($(sender).html()!=='') return;
 var html='<ul class="socialContainer">\r\n';
                    html+='<li class="facebook">\r\n';
                        html+='<div id="fb-root"></div>\r\n';
                        html += '<iframe src="//www.facebook.com/plugins/like.php?href=' + url + '&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>';
                            html += '<div class="fb-like" data-href="' + url + '" data-send="false"\r\n';
                            html+='data-layout="button_count" data-width="100" data-show-faces="false"></div>\r\n';
                    html+='</li>\r\n';
                    html+='<li class="twitter">\r\n';
                    	html+='<a href="https://twitter.com/share" class="twitter-share-button" data-url="' + url + '" data-count="horizontal" data-via="goodnewsgr" data-text="'+articleTitle+'">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>\r\n';
                       
                    html+='</li>\r\n';
                    html+='<li class="google">\r\n';
                        html+='<!-- Place this tag in your head or just before your close body tag -->\r\n';
                        html+='<script type="text/javascript" src="https://apis.google.com/js/plusone.js">\r\n';
                            html+='{ parsetags: \'explicit\' }\r\n';
                        html+='</script>\r\n';

                        html+='<!-- Place this tag where you want the +1 button to render -->\r\n';
                        html += '<g:plusone size="medium" href="' + url + '"></g:plusone>\r\n';

                        html+='<!-- Place this render call where appropriate -->\r\n';
                        html+='<script type="text/javascript">    gapi.plusone.go();</script>\r\n';
                   html+='</li><!-- template1 -->\r\n';
                html+='</ul>\r\n';
                $(sender).html(html);


         }
