$(document).ready(
function(){
  $('div.news-head')
  .click(function() {
    $(this).toggleClass('unfolded');
    $(this).next('div.news-body').slideToggle('slow');
  });
/* $(function() {
  $('a[@href!="http://"]').each(
    function(){
            if(this.href.indexOf(location.hostname) == -1) {
        $(this).addClass('external').attr('target', '_blank');
      }
    }
  )
  });*/
 $('img').error(function() {
        $(this).attr({
        src: 'pic/imgmiss.gif'
        });
    });
        $(window).scroll(function()

        {

        $('#user_bar').css({bottom:-$(window).scrollTop()+"px" });

        });
});









function rateit(rid,rtype,rate) {
no_ajax=true;
      (function($){
      if ($) no_ajax = false;
      field = "#ratearea-"+rid+"-"+rtype;

   $(field).empty();
   $(field).append('<div align="center"><img src="pic/loading.gif" border="0"/></div>');
    $.get("rate.php", { ajax: 1, id: rid, type: rtype, act: rate}, function(data){
   $(field).empty();
   $(field).append(data);
});
})(jQuery);

return no_ajax;

}

function winop2()
{
windop = window.open("http://footbit.com/user_agreement.html","mywin","height=500,width=800");
}
function winop()
{
windop = window.open("http://footbit.com/advert.html","mywin","height=500,width=800");
}
function wincl()
{
windop.close();
}



var openedWindow;


function closeOpenedWindow() {
  openedWindow.close()
}





function show(id)
{
    obj = document.getElementById(id);
    obj.style.left = x - 120;
    obj.style.top = y + 25;
    obj.style.display = "block";
    tid = window.setTimeout("show("+id+")",10);
}

function hide(id)
{
    obj = document.getElementById(id);
    window.clearTimeout(tid);
    obj.style.display = "none";
}
function show_hide(id)
{
        var klappText = document.getElementById('s' + id);
        var klappBild = document.getElementById('pic' + id);

        if (klappText.style.display == 'none') {
                  klappText.style.display = 'block';
                  klappBild.src = 'pic/minus.gif';
                  klappBild.title = 'Скрыть';
        } else {
                  klappText.style.display = 'none';
                  klappBild.src = 'pic/plus.gif';
                  klappBild.title = 'Показать';
        }
}

$(document).ready(function() {
	$('div.spoiler-body img').each(function() {
		$(this).attr({
			alt: $(this).attr('src'),
			src: 'plus.gif'
		});
	});
	$('div.spoiler-head').live("click", function() {
		$(this).toggleClass('unfolded');
		var c = $(this).parent().children('div.spoiler-body');
		c.find('img').each(function() {
			$(this).attr('src', $(this).attr('alt'));
		});
		c.is(':visible') ? c.hide('fast') : c.show('fast');
	});
});





