
//open pop-up
function showPopup()
{
		//Показываем темный фон
		$('#opaco').removeClass('hidden');
		//Определяем центр окна
		$.fn.alignCenter = function() {
			//get margin left
			var marginLeft = Math.max(40, parseInt($(window).width()/2 - $(this).width()/2)) + 'px';
			//get margin top
			var marginTop = Math.max(40, parseInt($(window).height()/2 - $(this).height()/2)) + 'px';
			//return updated element
			return $(this).css({'margin-left':marginLeft, 'margin-top':marginTop});
		};
	
//Задаем ему приличную высоту)
$('#opaco').height($(document).height());

// Показываем сплеш-лого, по центру, плавно
  $('#logosplash')
   .alignCenter()
   .fadeIn('slow');
   
  return false;
};

//close pop-up box
function closePopup()
{
  $('#opaco').fadeOut('slow');
  $('#logosplash').fadeOut('fast');
  return false;
};


//set cookie function - 24H duration
function setCookie(name, value) {
      var valueEscaped = escape(value);
      var expiresDate = new Date();
      expiresDate.setTime(expiresDate.getTime() + 24 * 60 * 60 * 1000); // срок - 1 год, но его можно изменить
      var expires = expiresDate.toGMTString();
      var newCookie = name + "=" + valueEscaped + "; path=/; expires=" + expires;
      if (valueEscaped.length <= 4000) document.cookie = newCookie + ";";
}; 



 
google.setOnLoadCallback(function() {
		//document.write("JS Loaded!");	 


		
	
});





