function OpenNewWindow(url, scrollbars, userwidth, userheight) {

	if (window.open) {
		dateVar = new Date();
		var windowName =dateVar.getTime();
		
		var border = 100;
		var w = (userwidth == null) ? screen.availWidth - 2*border : userwidth;
		var h = (userheight == null) ? screen.availHeight - 2*border : userheight;

		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		
		var winprops = 'height='+h+',width='+w;
		
		winprops = winprops+',top='+wint+',left='+winl+',scrollbars='+scrollbars+',resizable=yes,status=yes';
		newWindow = window.open(url, windowName, winprops);
		newWindow.window.focus();
	}
}


$().ready(function() {
   
   $('#nav-mailout a').click(function () {
     var target = $(this).attr("href");
     $(target).slideToggle('slow');
     return false;
   });
   
   $('a.closebtn').click(function(){
   	$(this).parent().slideToggle('slow');
   	$('#nav_global li a.current').removeClass("current");
   	return false;
   });
   
   $("a.scrollto").click(function(){
       var target = $(this).attr('href');
       var a = $(target).offset().top;
       $("html,body").animate({scrollTop:a},1000);
       return false;
   });
   
   $("a#toplink").click(function(){
       $("html,body").animate({scrollTop:0},1000);
       return false;
   });
   
   $(".slideshow a").fancybox({
       'cyclic': true,
       'titlePosition' : 'over',
       'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
           return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
       }
   });
   
});
