$(document).ready(function () {

// this makes the script degrade gracefully
$('#navigation ul#menu li ul').addClass('init');

	$('h2.menu_head').click(function () {
	 var $this = $(this);

	 whichone = '.' + this.id.toUpperCase() + 'b';
	 if( $this.is('.active') ) {
			$(whichone).toggle("fast");
			$this.removeClass('active');
	 }
	 else {
			$(whichone).toggle("slow");
			$this.addClass('active');
	 }

	 return false;
	});


	// custom easing called "custom" 
	$.easing.custom = function (x, t, b, c, d) { 
			if ((t/=d/2) < 1) return c/2*t*t + b;
			return -c/2 * ((--t)*(t-2) - 1) + b;
	}

	$("div.scrollable").scrollable({hoverClass: 'hover',size: 1,easing: 'custom',speed: 900}).circular().mousewheel().autoscroll({ 
		steps: 1, 
		interval: 5000 
	});


});


google.load("feeds", "1");
 
    function initialize() {
      var feed = new google.feeds.Feed("http://shopatvirtu.wordpress.com/feed/");
	  feed.setNumEntries(6);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
			for (var i = 0; i < result.feed.entries.length; i++) {
					var entry = result.feed.entries[i];
					var link = document.createElement("a");
					link.setAttribute('href', entry.link);
					link.appendChild(document.createTextNode(entry.title));
					var div = document.createElement("li");
					div.appendChild(link);
					container.appendChild(div);
          }
        }
      });
      }
    google.setOnLoadCallback(initialize);
