
$(document).ready(function() {
	
	/* ------------------------------------------------------------- */

	// initialize scrollable  
    $("div.scrollable").scrollable({ 
	             
        vertical:true,  
        size: 1, 
        
        // items are auto-scrolled in 2 secnod interval 
        interval: 2000, 
         
        // when last item is encountered go back to first item 
        loop: true,  
         
        // make animation a little slower than the default 
        speed: 600, 
         
        // when seek starts make items little transparent 
        onBeforeSeek: function() { 
            this.getItems().fadeTo(300, 0.2);         
        }, 
         
        // when seek ends resume items to full transparency 
        onSeek: function() { 
            this.getItems().fadeTo(300, 1); 
        } 
    }); 
    
    /* ---HOMEPAGE NEWS--------------------------------------------- */    
    
    // special way to calculate the expiration date of news items
    
    $('#events .listing').each( function() {
    	expDate = new Date($(this).attr('expiration-date'));
    	today = new Date();
    	if ((expDate - today) < 0) {
    		$(this).hide();
    	}
    }); 
    
});