/*
function wopen(url) {
	w = 750;
	h = 550;
	wleft = (screen.width - w) / 2;
	wtop = (screen.height - h) / 2;	
	newwindow=window.open(url,'name','width=' + w + ',height=' + h + ',left=' + wleft + ',top=' + wtop + ',location=yes,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}
*/


// jQuery
$(document).ready(function(){

	/* --- Only run Scrollable if more than one event! --- */
	var eNum = $("div.scrollable div.items div.event").size(); // number of events
	if(eNum > 1) {

		/* --- Scrollable Plugin --- */
		$("div.scrollable").scrollable({
			
			// number of items visible
			size: 1,
			// scroll every x seconds
			loop: true,
			speed: 900,
			// 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);
			}
		});
	} else {
		// disable prev, next buttons
		$(".prev").addClass("disabled");
		$(".next").addClass("disabled");
	}

});

