$(document).ready(function () {
	$.fn.alignCenter = function() {
		var marginLeft = Math.max(40, parseInt($(window).width()/2 - $(this).width()/2)) + 'px';
		var marginTop = Math.max(40, parseInt($(window).height()/2 - $(this).height()/2)) + 'px';
		return $(this).css({'margin-left':marginLeft, 'margin-top':marginTop});
	};
	$('#rt-n-20880 a').attr('rel','nofollow');
	$('.tgfv a').attr('rel','nofollow');
/*
	if ( $('#join_informer_1464').length ){
		ShowInformer(document.getElementById("join_informer_1464"));
		$(".otherart td:odd").css("width","30%");
		$('#join_informer_1464 a').attr('rel', 'nofollow');
	}
*/
});

function horo(a){
	$('#horo').children("div").hide();
	$('#horo'+a).show();
}
function schedule(a){
	$('#schedule tr').hide();
	$('#schetitl').show();
	$('#schetitl td').removeClass('bcf');
	$('#d'+a).addClass('bcf');
	$('tr.sch'+a).show();
}

// Home
function add_favorite(a){ 
  title=document.title;
  url=document.location;
  try {window.external.AddFavorite(url, title);} 
  catch (e) {
    try {window.sidebar.addPanel(title, url, "");}
    catch (e) {
      if (typeof(opera)=="object") {a.rel="sidebar";a.title=title;a.url=url;return true;}
      else {alert('Нажмите Ctrl-D чтобы добавить страницу в закладки');}
    }
  }
  return false;
}


/*==================*/
/* Google analytics */
/*==================*/
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24439139-1']);
_gaq.push(['_setDomainName', '.xn--80atgp9c.com']);
_gaq.push(['_trackPageview']);
(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

/*****************************
**     Popup message
******************************/

function closePopup(){
	$('#opaco').toggleClass('hidden').removeAttr('style');
	$('#popup').toggleClass('hidden');
	return false;
}

function showPopup(popup_type){
  if($.browser.msie){
		$('#opaco').height($(document).height()).toggleClass('hidden');
	}
	else{
		$('#opaco').height($(document).height()).toggleClass('hidden').fadeTo('slow', 0.8);
	}
	$('#popup')
		.html($('#popup_' + popup_type).html())
		.alignCenter()
		.toggleClass('hidden');
		return false;
}
