/*
This is the instructions on how to build your own social share toolbar using jQuery and CSS3. The toolbar should be visible at the bottom right corner of your browser. If you hover over the toolbar it will slide up, click the minimize button it will all but disappear, click one of the icons and you will be taken to either the login page or the share page of that social site.

http://www.jquery4u.com/tutorials/jquery-socialize-sharing-tool

*/

(function( $ ) {
  $(document).ready(function() { 
    var url = window.location.href;
    var host =  window.location.hostname;
    var title = $('title').text();
    title = escape(title); //clean up unusual characters

    var twit = 'http://twitter.com/yourastrology';
    var facebook = 'http://www.facebook.com/pages/Yourastrology/138084332940435';
    var digg = 'http://digg.com/submit?phase=2&url='+url+'&amp;title='+title;
    var stumbleupon = 'http://stumbleupon.com/submit?url='+url+'&amp;title='+title;
    var buzz = 'http://www.google.com/reader/link?url='+url+'&amp;title='+title+'&amp;srcURL='+host;
    var delicious  = 'http://del.icio.us/post?url='+url+'&amp;title='+title;
 
    var tbar = '<div id="socializethis"><span>Follow Us On<br /><a href="#min" id="minimize" title="Minimize"> <img src="http://www.yourastrology.co.in/images/minimize.png" /> </a></span><div id="sicons">';
    tbar += '<a href="'+twit+'" id="twit" target="_blank" title="Follow Us on twitter"><img src="http://www.yourastrology.co.in/images/twitter.png"  alt="Share on Twitter" width="32" height="32" /></a>';
    tbar += '<a href="'+facebook+'" id="facebook" target="_blank" title="Share on Facebook"><img src="http://www.yourastrology.co.in/images/facebook.png"  alt="Share on facebook" width="32" height="32" /></a>';
/*    tbar += '<a href="'+digg+'" id="digg" target="_blank" title="Share on Digg"><img src="http://www.yourastrology.co.in/images/digg.png"  alt="Share on Digg" width="32" height="32" /></a>';
    tbar += '<a href="'+stumbleupon+'" id="stumbleupon" target="_blank" title="Share on Stumbleupon"><img src="http://www.yourastrology.co.in/images/stumbleupon.png"  alt="Share on Stumbleupon" width="32" height="32" /></a>';
    tbar += '<a href="'+delicious+'" id="delicious" target="_blank" title="Share on Del.icio.us"><img src="http://www.yourastrology.co.in/images/delicious.png"  alt="Share on Delicious" width="32" height="32" /></a>';
    tbar += '<a href="'+buzz+'" id="buzz" target="_blank" title="Share on Buzz"><img src="http://www.yourastrology.co.in/images/google-buzz.png"  alt="Share on Buzz" width="32" height="32" /></a>';
*/    tbar += '</div></div>';
 
    // Add the share tool bar.
    $('body').append(tbar); 
    $('#socializethis').css({opacity: .7}); 
    // hover.
    $('#socializethis').bind('mouseenter',function(){
      $(this).animate({height:'35px', width:'260px', opacity: 1}, 300);
      $('#socializethis img').css('display', 'inline');   
    });
    //leave
    $('#socializethis').bind('mouseleave',function(){
      $(this).animate({ opacity: .7}, 300);
    });  
    // Click minimize
    $('#socializethis #minimize').click( function() { 
      minshare(); 
      $.cookie('minshare', '1');  
    }); 
 
    if($.cookie('minshare') == 1){
      minshare();
    }  
 
    function minshare(){
      $('#socializethis').animate({height:'15px', width: '40px', opacity: .7}, 300); 
      $('#socializethis img').css('display', 'none');
      return false;
    }  
  });
})(jQuery);
