﻿$(document).ready(
function() {
	$("a[href^=\"http://\"]").attr({ title: 'external link' });
	$("a[href^=\"mailto:\"]").attr({ title: 'email' });
	$("a[href$=.pdf]").attr({ title: 'PDF file' });
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$("a.deleteButton").click(function() {
		return confirm('Are you sure you want to delete this?');
	});
	$(".cat").css('display', 'block');
	$("select#categoryFilter").bind("change", function() {
		this.form.submit();
	});
});

(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/home?status='+title+'%20'+url;
    var facebook = 'http://www.facebook.com/sharer.php?u='+url
 
    var tbar = '<div id="socializethis"><span>Share</span><div id="sicons">';
    tbar += '<a href="'+twit+'" id="twit" title="Share on twitter"><img src="/Content/images/twitter.png"  alt="Share on Twitter" width="32" height="32" /></a>';
    tbar += '<a href="'+facebook+'" id="facebook" title="Share on Facebook"><img src="/Content/images/facebook.png"  alt="Share on facebook" 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', opacity: 1}, 300);
      $('#socializethis img').css('display', 'inline');   
    });
    //leave
    $('#socializethis').bind('mouseleave',function(){
      $(this).animate({height:'15px', opacity: .7}, 300);
    });  
 
    if($.cookie('minshare') == 1){
    minshare();
    }  
  });
})(jQuery);