addJQUERYFunc = {}
addJQUERYFuncEnd = {}
$(document).ready(function(){	for(var i in addJQUERYFunc)
	  addJQUERYFunc[i]();
  $("#top_menu li").hover(
     function(){
      $(this).addClass('act');
      $(this).find('.top_menu_hover').slideDown();
  	  },
     function(){  	  $(this).find('.top_menu_hover').slideUp();
  	  $(this).removeClass('act');
  	  })

  $(".vflist .fotovideoitem").hover(
     function(){
  	  $(this).find('.textover').slideDown();
  	  },
     function(){
  	  $(this).find('.textover').slideUp();
  	  })

  $("#gidy_anons .item").hover(
     function(){
  	  $(this).find("img").animate({width: '68px'}, 800);
  	  },
     function(){
  	  $(this).find("img").animate({width: '45px'}, 800);
  	  })


  $("#gid_list .item").hover(
     function(){
  	  $(this).addClass('yellow');
  	  },
     function(){
  	  $(this).removeClass('yellow');
  	  })

  if(typeof(__SliderTut)!='undefined')
  {  	sampleSlider = new Slider('gid-slider');  }


	for(var i in addJQUERYFuncEnd)
	  addJQUERYFuncEnd[i]();
  setBgImgAndPos();
});

$(window).resize( function() { setBgImgAndPos();
  //alert($('body').width());

} );

imgBgPreloaded = false;

function setBgImgAndPos()
{
  if($(window).width()<=1000)
	{
  	$('body').removeClass('gBG1600').removeClass('gBG2500');
    $("body").css('background-position', '0px 0px');
    return;
	}
  var s2 = 1600;
  if($(window).width()>1000 && $(window).width()<=s2)
  {  	$('body').removeClass('gBG2500').addClass('gBG1600');    var x;
    var d;
    var c;
    var w;
    var max = 1600;
    x = 1320;
    if(typeof(BGFishkaPosition)!='undefined')
      x = BGFishkaPosition;
    c = 1000;
    w = $(window).width();
    d = Math.round((c+w)/2, 0);

    if(x>d)
    {
    	var xpos = x-d;
    	if(xpos+w>=max)
    	  xpos = max-w;
      $("body").css('background-position', '-'+xpos+'px 0px');
    }
    else
    {
      $("body").css('background-position', '0px 0px');
    }
    return;
	}
  if($(window).width()>s2)
  {
  	$('body').removeClass('gBG1600').addClass('gBG2500');
    var x;
    var d;
    var c;
    var w;
    var max = 2550;
    x = 1770;
    if(typeof(BGFishkaPosition2500)!='undefined')
      x = BGFishkaPosition2500;
    c = 1000;
    w = $(window).width();
    d = Math.round((c+w)/2, 0);

    if(x>d)
    {
    	var xpos = x-d;
    	if(xpos+w>=max)
    	  xpos = max-w;
      $("body").css('background-position', '-'+xpos+'px 0px');
    }
    else
    {
      $("body").css('background-position', '0px 0px');
    }
    return;
	}

}

