$(document).ready(function(){

  $(".close").click(function(){    $(this).parent().parent().css('display', 'none');
    return false;
  });

  $("#menu td").click(function(){
  	  window.location = $(this).find("a:first").attr('href');
  });
  $("#menu td").hover(function(){
  		$(this).toggleClass("hover");
	},function(){
  		$(this).toggleClass("hover");
	});

  $("#video_big").parent().find("#d1 #video_other .item:first a").click();

  $("#gallery a").fancybox({
		hideOnContentClick: true,
		overlayShow: true,
		overlayOpacity: 0.5,
		zoomSpeedIn: 1500,
		zoomSpeedOut:600
	});

  $("#faq_list .item a.quest_red").click(function(){
    $("#faq_text").html("<a name='answer'></a><div class='red_text'>"+$(this).html()+"</div>"+$(this).parent().find(".answer:first").html());
//    window.location = "#answer";
  });
  $("#faq_list .item:first a.quest_red").click();
  $("#faq_text").html($("#faq_list .item0").html());

//всплывающее окно на главной
  $("#show_up").click(function(){    return false;  });
  var show_up_img_cnt = 0;
  function change_show_up_img()
  {
    r = show_up_img_cnt ? show_up_img_cnt : 1;
    $("#show_up_img").attr('src', "/img/skazi_"+r+".jpg");
    show_up_img_cnt = show_up_img_cnt+1;
    if(show_up_img_cnt>5)
      show_up_img_cnt = 0;
  }
  window.setInterval(change_show_up_img, 4000);
});

function new_video(way, pic, div_id)
{
  if(typeof(div_id)=='undefined')
    div_id = "video_big"	var flashvars = {way:way, swf:"/swf/uflvplayer_500x375.swf", w:"400", h:"300", skin:"black", pic:pic, autoplay:"0", tools:"2", q:"0", volume:"70", comment:""};
	var params = {bgcolor:"#000", allowFullScreen:"true"}
	var attributes = {id:div_id, name:div_id};
	swfobject.embedSWF("/swf/uflvplayer_500x375.swf", div_id, "400", "300", "9.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);
	return false;
}

