function clockUpdater() {
  date = new Date(); hours = date.getHours(); minutes = date.getMinutes();
  month = date.getMonth()+1; day = date.getDate(); year = date.getFullYear();
  utcHours = date.getUTCHours(); utcMinutes = date.getUTCMinutes();
  diffHr = hours - utcHours; diffMt = Math.abs((minutes - utcMinutes));
  sign = diffHr > 0 ? '+' : '';
  if (diffMt < 10) {diffMt = diffMt + '0';}
  if (minutes < 10) {minutes = '0' + minutes;}
  if (month < 10) {month = '0' + month;}
  if (day < 10) {day = '0' + day;}
  $('#clockSpan').html(day+'.'+month+'.'+year+'&nbsp;&nbsp;&nbsp;'+hours + ':' + minutes+' (GMT' + sign + diffHr + ':' + diffMt+')');
};

function openBigFoto() {
    var win = window.open('http://pioglobal.ua/inc/bigphoto.html', '', 'width=820,height=495,status=no,resizable=no');
}

var obj = null;

$(function() {
    window.setInterval('clockUpdater()', 1000);
	$('.popupButton').hover(function() {
		if (obj) {
			obj.find('ul').fadeOut(50);
			/*obj.find('ul').css('visibility','hidden');*/
			obj = null;
		}
		$(this).find('ul').fadeIn('slow');
		/*$(this).find('ul').css('visibility', 'visible');*/
	}, function() {
		obj = $(this);
		setTimeout(function() {
        	if (obj) {
        		obj.find('ul').fadeOut(50);
        	}
        }, 200);
	});
});
