jQuery.cookie = function (key, value, options) {

    // key and value given, set cookie...
    if (arguments.length > 1 && (value === null || typeof value !== "object")) {
        options = jQuery.extend({}, options);

        if (value === null) {
            options.expires = -1;
        }

        if (typeof options.expires === 'number') {
            var days = options.expires, t = options.expires = new Date();
            t.setDate(t.getDate() + days);
        }

        return (document.cookie = [
            encodeURIComponent(key), '=',
            options.raw ? String(value) : encodeURIComponent(String(value)),
            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
            options.path ? '; path=' + options.path : '',
            options.domain ? '; domain=' + options.domain : '',
            options.secure ? '; secure' : ''
        ].join(''));
    }

    // key and possibly options given, get cookie...
    options = value || {};
    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};




$(document).ready(function() {
			$("#home-lightbox").fancybox({
				'content'		: '<a href="https://www.facebook.com/AkumaRugby?sk=app_229557910452559" target="_blank"><img src="/images/home/lightbox/20120220.jpg" width="624" height="437" /></a>',
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'overlayShow' : true,
				'overlayColor' : '#000'
				
			});
			
			
			if($.cookie("akumarugbyLB") != 'set')
		{				
			 	$("#home-lightbox").trigger('click');
 
 
 				$('a#fancybox-close').live('click', function(e) {
					e.preventDefault();
					//$.cookie("eddiewrightlb", "true");
				
					$.cookie('akumarugbyLB', null);
					$.cookie('akumarugbyLB', 'set');
					$.fancybox.close();
					homeanim();
				});

		}
			

			
});



