
$(function() {
	
	if ($('#gallery').size()) {
		var img_nrs = $('#gallery').attr('data-imgs');
		
		if (img_nrs) {		
			img_nrs = img_nrs.split(',');
		
			var src, tsrc, h = '';
		
			var cont = $('#gallery');
		
			if (img_nrs.length) {
				$.each(img_nrs, function(i, nr){
					src = 'img/gallery/' + nr + '.jpg';
					tsrc = 'img/gallery/t' + nr + '.jpg';
					h = '<a href="' +src+ '"><img src="' +tsrc+ '" height="66" width="88" /></a>';
				
					cont.append(h);
				});
			
				cont.show();
			
				cont.find('a').lightBox({
					containerResizeSpeed: 100,
					imageBtnPrev: 'img/lightbox/lightbox-btn-prev.gif',
					imageBtnNext: 'img/lightbox/lightbox-btn-next.gif',
					imageBtnClose: 'img/lightbox/lightbox-btn-close.gif',
					imageBlank: 'img/lightbox/lightbox-blank.gif',
					imageLoading: 'img/lightbox/lightbox-ico-loading.gif'
				});
			}
		
		}
	}
	
	
	if ($('#news .info.critical').size()) {
		var now = new Date();
		var end = new Date(2012, 1, 24, 23, 00, 00);
		
		if (now <= end) {
			$('#news .info.critical').show();
		}
	}
	
});
