function setCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
function getCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName+"=");
 if (ind==-1 || cookieName=="") return "";
 var ind1=theCookie.indexOf(";",ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

$(document).ready(function() {
 
 $("#legionDiv").click(function() {
		$.fancybox([
			{
    'href' : '/images/legion-donation.jpg',
    'title' : 'Shown is Dan and Frank Corbeil with legion president Preston Quirt.'
   }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
                        'titlePosition' : 'inside',
			'changeFade'        : 0
		});
});

 $("#steakDiv").click(function() {
		$.fancybox([
			{
    'href' : '/images/dinner_auction.jpg',
    'title' : 'Click the top X or anywhere off the poster to close this box.'
   }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
                        'titlePosition' : 'inside',
                        'changeFade'        : 0
		});
});

$("#whatsnew").click(function() {
    $.fancybox([
     {
    'href' : '/whatsnew.html',
    'title' : 'Click the top X or anywhere off this box to close.'
   }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
                        'titlePosition' : 'inside',
                        'width': 560,
                        'height': 600,
                        ' hideOnContentClick': false,
                        'type': 'iframe',
			'changeFade'        : 0
	});
       });


var vWhatsNew=getCookie("whats_new");
if(vWhatsNew==""|vWhatsNew==null)
{
 setCookie("whats_new","wasOpen",1);

 $.fancybox([
			{
    'href' : '/whatsnew.html',
    'title' : 'Click the top X or anywhere off this box to close.'
   }
		], {
			'padding'			: 0,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'              : 'image',
                        'titlePosition' : 'inside',
                        'width': 560,
                        'height': 600,
                        ' hideOnContentClick': false,
                        'type': 'iframe',
			'changeFade'        : 0
	});

}

});
