// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){

	/*if (!$.browser.msie)
	{
		$("#root,#body,#slider").corner("round");
	}*/

	
	$('#slider').s3Slider({
            timeOut: 4000
        });


	$('#search_menu > li').mouseover(function(){
		$('#search_menu > li').removeClass("hover");
		$(this).addClass("hover");
	});
	
	
	
	
	
	var $paneTarget = $('#sections,#sections_search');
	
	/*
	$('#news2').click(function(){
		var target = $paneTarget.find('##news2Content');
		$paneTarget.stop().scrollTo( target, 800 );
	});
	*/
	
	$paneTarget.stop().scrollTo( $paneTarget.find("#Contentnews1"), 400 );
	$('[id^=news]').mouseover(function(){
		var target = $paneTarget.find("#Content"+this.id);
		$paneTarget.stop().scrollTo( target, 400 );
	});
	
	
	$paneTarget.stop().scrollTo( $paneTarget.find("#Contentnews1"), 400 );
	$('[id^=msearch]').click(function(){
		var target = $paneTarget.find("#Content"+this.id);
		$paneTarget.stop().scrollTo( target, 400 );
		var id_element=$(this).attr('id');
		var id_block='msearch6';
		if(id_element==id_block)
		{
			$("#form_search_heavy").show();
		}
		else
		{
			$("#form_search_heavy").hide();
		}
	});
	
	
	
	$('#search_all_butt').click(function() {
	  $('#form_search_lite').hide(400);
	  $('#form_search_heavy').show(400);
	});
	
	$('#search_all_butt2').click(function() {
	  $('#form_search_lite').show(400);
	  $('#form_search_heavy').hide(400);
	});
	

	
	$("input[name=subscribe_period]").click(
		
		function()
		{
			var idElement=$(this).attr('id');
			$(".subscribe_price > li").hide();
			
			$("#"+idElement+"_itog").show();
		}
	);
	
	$(".itog_li").click(
	
		function()
		{
			var idElementLi=$(this).attr('id');
			$("#"+idElementLi+"_detail").toggle();
		}
	);
	$(".itog").show();
	$(".def").show();
	
	$("a.iframe").fancybox({
	  zoomSpeedIn: 0,
	  zoomSpeedOut:0,
	  frameWidth: 890,
	  frameHeight: 560
	});


	$(".zooms").fancybox(
	{
		overlayOpacity:0.7,
		overlayColor:'#000'
	});
	
});
