
/**
 *	Create popup window in center of screen and
 *	focus it if already open.
 *
 *	@param string url
 *	@param int height
 *	@param int width
 *	@param string scrollbar
 */
function popup(url, height, width) {
	var windowname = 'popupWindow';
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=yes';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=yes';
	params += ', status=no';
	params += ', toolbar=no';
	newwin=window.open(url, windowname, params);
	if (window.focus) {
		width = width + 8;
		height = height + 30;
		newwin.resizeTo(width, height);

		left = (screen.width  - width)/2;
		top = (screen.height - height)/2;
		newwin.moveTo(left,top);

		newwin.focus();
	}
	return false;
}



$(function() {
	// Highlight news items on rollover (home page)
	$(".news-item ").hover(
		function () {
			$(this).addClass("news-item-highlight");
		},
		function () {
			$(this).removeClass("news-item-highlight");
		}
  );

	// Video slideshows
	$('#video-selection-one').cycle({
		pause: 1,
		random: 1,
		timeout: 12000,
		delay:  4000
	});
	$('#video-selection-two').cycle({
		pause: 1,
		random: 1,
		timeout: 12000,
		delay:  8000
	});
	$('#video-selection-three').cycle({
		pause: 1,
		random: 1,
		timeout: 12000,
		delay:  12000
	});
});
