(function($){
  $.extend({
    jGFeed : function(url, fnk, num, key){
      // Make sure url to get is defined
      if(url == null) return false;
      // Build Google Feed API URL
      var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;
      if(num != null) gurl += "&num="+num;
      if(key != null) gurl += "&key="+key;
      // AJAX request the API
      $.getJSON(gurl, function(data){
        if(typeof fnk == 'function')
		  fnk.call(this, data.responseData.feed);
		else
		  return false;
      });
    }
  });
})(jQuery);

$(document).ready(function(){
		
	if($("#homesnippet").length > 0){
	
		$.jGFeed('http://notesonacting.blogspot.com/feeds/posts/default?alt=rss', function(feeds){
		  // Check for errors
		  if(!feeds){
		    // there was an error
		    return false;
		  }
		  $("#homesnippet p").html(feeds.entries[0].content);
		  var textcont = $("#homesnippet p").text();
		  $("#homesnippet p").html(textcont.substring(0,255)+'&#133;<br /><span>...more &gt;</span>');
		}, 1);    
	}
	
	//start dropdown behavior using the superfish plugin
		$('ul#sidenav').superfish({
			autoArrows:    true,
		    dropShadows:   false,
		    disableHI: 	true
	    });
	    
	   if($("#myPlayer").length > 0){ 
		   flowplayer("myPlayer", "http://www.davidmillstone.com/downloadables/flowplayer-3.1.5.swf", {
		    	clip: {
		    		autoBuffering: true,
		    		autoPlay: false
		    		}
			}).load();
			
	   }
});
